Browse Source

添加账套切换功能,自动生成本地数据库

callm 4 years ago
parent
commit
ce21233f05

+ 92 - 0
UAS-出货标签管理(贸易版)/ChangeMaster.Designer.cs

@@ -0,0 +1,92 @@
+namespace UAS_LabelMachine
+{
+    partial class ChangeMaster
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.Master = new System.Windows.Forms.Label();
+            this.MasterCombox = new System.Windows.Forms.ComboBox();
+            this.button1 = new System.Windows.Forms.Button();
+            this.SuspendLayout();
+            // 
+            // Master
+            // 
+            this.Master.AutoSize = true;
+            this.Master.BackColor = System.Drawing.Color.Transparent;
+            this.Master.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Master.Location = new System.Drawing.Point(29, 97);
+            this.Master.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.Master.Name = "Master";
+            this.Master.Size = new System.Drawing.Size(82, 41);
+            this.Master.TabIndex = 10;
+            this.Master.Text = "账套";
+            // 
+            // MasterCombox
+            // 
+            this.MasterCombox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.MasterCombox.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.MasterCombox.FormattingEnabled = true;
+            this.MasterCombox.Location = new System.Drawing.Point(141, 94);
+            this.MasterCombox.Margin = new System.Windows.Forms.Padding(6);
+            this.MasterCombox.Name = "MasterCombox";
+            this.MasterCombox.Size = new System.Drawing.Size(346, 49);
+            this.MasterCombox.TabIndex = 9;
+            // 
+            // button1
+            // 
+            this.button1.Location = new System.Drawing.Point(189, 225);
+            this.button1.Name = "button1";
+            this.button1.Size = new System.Drawing.Size(130, 39);
+            this.button1.TabIndex = 11;
+            this.button1.Text = "确认";
+            this.button1.UseVisualStyleBackColor = true;
+            this.button1.Click += new System.EventHandler(this.button1_Click);
+            // 
+            // ChangeMaster
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(513, 308);
+            this.Controls.Add(this.button1);
+            this.Controls.Add(this.Master);
+            this.Controls.Add(this.MasterCombox);
+            this.MaximizeBox = false;
+            this.Name = "ChangeMaster";
+            this.Text = "切换账套";
+            this.Load += new System.EventHandler(this.ChangeMaster_Load);
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Label Master;
+        private System.Windows.Forms.ComboBox MasterCombox;
+        private System.Windows.Forms.Button button1;
+    }
+}

+ 52 - 0
UAS-出货标签管理(贸易版)/ChangeMaster.cs

@@ -0,0 +1,52 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+using UAS_LabelMachine.Entity;
+
+namespace UAS_LabelMachine
+{
+    public partial class ChangeMaster : Form
+    {
+
+        DataHelper dh = SystemInf.dh;
+
+        SqliteDBHelper sdh;
+        DataTable Masterdt;
+        public ChangeMaster()
+        {
+            InitializeComponent();
+        }
+
+        private void ChangeMaster_Load(object sender, EventArgs e)
+        {
+            Masterdt = (DataTable)dh.ExecuteSql("select ma_function,ms_pwd,ma_user from master ", "select");
+            MasterCombox.DisplayMember = "ma_function";
+            MasterCombox.ValueMember = "ma_user";
+            MasterCombox.DataSource = Masterdt;
+        }
+
+        private void button1_Click(object sender, EventArgs e)
+        {
+            string Ms_Pwd = "";
+            for (int i = 0; i < Masterdt.Rows.Count; i++)
+            {
+                if (MasterCombox.SelectedValue == Masterdt.Rows[i]["ma_user"])
+                    Ms_Pwd = Masterdt.Rows[i]["ms_pwd"].ToString();
+            }
+            //切换至用户选择的数据源
+            string ConnectionString = "Connection Timeout=0;Pooling=false;Password=" + Ms_Pwd + ";User ID=" + MasterCombox.SelectedValue.ToString() + ";Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=" + SystemInf.IP + ")(PORT=" + DataHelper.OraclePort + ")))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+            DataHelper.DBConnectionString = ConnectionString;
+            //设置当前账套
+            SystemInf.Master = MasterCombox.SelectedValue.ToString();
+            SystemInf.sdh = sdh = new SqliteDBHelper(SystemInf.Master + ".db3");
+            //设置了Connection,重新执行构造函数,重置数据库连接
+            dh = new DataHelper();
+            Close();
+        }
+    }
+}

+ 120 - 0
UAS-出货标签管理(贸易版)/ChangeMaster.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 2 - 0
UAS-出货标签管理(贸易版)/Entity/SystemInf.cs

@@ -17,5 +17,7 @@ namespace UAS_LabelMachine.Entity
         public static string Master;
 
         public static bool CheckDcAndLotNo = false;
+
+        public static string IP = "";
     }
 }

+ 2 - 1
UAS-出货标签管理(贸易版)/Login.cs

@@ -32,7 +32,6 @@ namespace UAS_LabelMachine
         private void Login_Load(object sender, EventArgs e)
         {
             SystemInf.dh = dh = new DataHelper();
-            SystemInf.sdh = sdh = new SqliteDBHelper("LabelPrint.db3");
             if (dh.GetConfig("FTPNET", "FTPNET").ToString() != "")
             {
                 FTPNet.Visible = true;
@@ -72,6 +71,8 @@ namespace UAS_LabelMachine
             DataHelper.DBConnectionString = ConnectionString;
             //设置当前账套
             SystemInf.Master = MasterCombox.SelectedValue.ToString();
+            SystemInf.sdh = sdh = new SqliteDBHelper(SystemInf.Master + ".db3");
+            SystemInf.IP = IP.Text;
             //设置了Connection,重新执行构造函数,重置数据库连接
             dh = new DataHelper();
             string oMsg = "";

+ 19 - 19
UAS-出货标签管理(贸易版)/PublicMethod/DataHelper.cs

@@ -11,30 +11,30 @@ namespace UAS_LabelMachine
     public class DataHelper
     {
 
-        //深爱地址
-        private readonly string ConnectionStrings = "Data Source=172.16.0.22/orcl;User ID=SZSI_P;PassWord=select!#%*(";
+        ////深爱地址
+        //private readonly string ConnectionStrings = "Data Source=172.16.0.22/orcl;User ID=SZSI_P;PassWord=select!#%*(";
 
-        private readonly string IPConnectionStrings = "Data Source=172.16.0.22/orcl;User ID=SZSI_P;PassWord=select!#%*(";
-        //深爱ERP地址
-        public static readonly string ERPAddesss = "http://172.16.0.20:8099/ERP/";
-        //深爱FTP
-        public static readonly string FTPAddress = "ftp://172.16.0.20|vsftpd|shenaftp";
+        //private readonly string IPConnectionStrings = "Data Source=172.16.0.22/orcl;User ID=SZSI_P;PassWord=select!#%*(";
+        ////深爱ERP地址
+        //public static readonly string ERPAddesss = "http://172.16.0.20:8099/ERP/";
+        ////深爱FTP
+        //public static readonly string FTPAddress = "ftp://172.16.0.20|vsftpd|shenaftp";
 
-        public static readonly string InnerFTPAddress = "ftp://172.16.0.20|vsftpd|shenaftp";
-        //Oracle端口
-        public static readonly string OraclePort = "1521";
+        //public static readonly string InnerFTPAddress = "ftp://172.16.0.20|vsftpd|shenaftp";
+        ////Oracle端口
+        //public static readonly string OraclePort = "1521";
 
-        //private readonly string ConnectionStrings = "Data Source=cmityj.gicp.net/orcl;User ID=HC_TEST;PassWord=select!#%*(";
+        private readonly string ConnectionStrings = "Data Source=183.237.197.78/orcl;User ID=N_HC;PassWord=select!#%*(";
 
-        //private readonly string IPConnectionStrings = "Data Source=183.237.197.78/orcl;User ID=HC_TEST;PassWord=select!#%*(";
-        ////海创ERP地址
-        //public static readonly string ERPAddesss = "http://cmityj.gicp.net:8099/ERP/";
-        ////海创FTP
-        //public static readonly string FTPAddress = "ftp://cmityj.gicp.net|HCFTP|Admin1@#";
+        private readonly string IPConnectionStrings = "Data Source=183.237.197.78/orcl;User ID=N_HC;PassWord=select!#%*(";
+        //海创ERP地址
+        public static readonly string ERPAddesss = "http://183.237.197.78:8099/ERP/";
+        //海创FTP
+        public static readonly string FTPAddress = "ftp://183.237.197.78|HCFTP|Admin1@#";
 
-        //public static readonly string InnerFTPAddress = "ftp://192.168.1.8|HCFTP|Admin1@#";
-        ////Oracle端口
-        //public static readonly string OraclePort = "1521";
+        public static readonly string InnerFTPAddress = "ftp://192.168.1.8|HCFTP|Admin1@#";
+        //Oracle端口
+        public static readonly string OraclePort = "1521";
 
         ////凯而高地址
         //private readonly string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=KRG_TEST;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=112.25.154.186)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";

+ 2 - 1
UAS-出货标签管理(贸易版)/PublicMethod/SqliteDBHelper.cs

@@ -30,10 +30,11 @@ namespace UAS_LabelMachine
                 this._odcConnection = new SQLiteConnection(this._connectionString);
                 // 打开连接
                 this._odcConnection.Open();
+                ExecuteSql("select 1 from prodiobarcode", "select");
             }
             catch (Exception ex)
             {
-                MessageBox.Show(ex.Message);
+                ExecuteSql("create table prodiobarcode (pib_inoutno char(50))", "select");
             }
         }
 

+ 9 - 0
UAS-出货标签管理(贸易版)/UAS-出货标签管理(贸易版).csproj

@@ -148,6 +148,12 @@
     <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="ChangeMaster.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="ChangeMaster.Designer.cs">
+      <DependentUpon>ChangeMaster.cs</DependentUpon>
+    </Compile>
     <Compile Include="CustomControl\BlurSearch.cs">
       <SubType>UserControl</SubType>
     </Compile>
@@ -354,6 +360,9 @@
     <Compile Include="附件内容打印.Designer.cs">
       <DependentUpon>附件内容打印.cs</DependentUpon>
     </Compile>
+    <EmbeddedResource Include="ChangeMaster.resx">
+      <DependentUpon>ChangeMaster.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="CustomControl\BlurSearch.resx">
       <DependentUpon>BlurSearch.cs</DependentUpon>
     </EmbeddedResource>

+ 40 - 40
UAS-出货标签管理(贸易版)/UAS_出货标签管理.Designer.cs

@@ -909,7 +909,7 @@
             // 
             this.label18.AutoSize = true;
             this.label18.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label18.Location = new System.Drawing.Point(137, 275);
+            this.label18.Location = new System.Drawing.Point(139, 277);
             this.label18.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label18.Name = "label18";
             this.label18.Size = new System.Drawing.Size(24, 31);
@@ -944,7 +944,7 @@
             // 
             this.label16.AutoSize = true;
             this.label16.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label16.Location = new System.Drawing.Point(135, 129);
+            this.label16.Location = new System.Drawing.Point(137, 131);
             this.label16.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label16.Name = "label16";
             this.label16.Size = new System.Drawing.Size(24, 31);
@@ -979,7 +979,7 @@
             // 
             this.label12.AutoSize = true;
             this.label12.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label12.Location = new System.Drawing.Point(19, 221);
+            this.label12.Location = new System.Drawing.Point(21, 223);
             this.label12.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label12.Name = "label12";
             this.label12.Size = new System.Drawing.Size(110, 31);
@@ -990,7 +990,7 @@
             // 
             this.label7.AutoSize = true;
             this.label7.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label7.Location = new System.Drawing.Point(19, 79);
+            this.label7.Location = new System.Drawing.Point(21, 81);
             this.label7.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label7.Name = "label7";
             this.label7.Size = new System.Drawing.Size(110, 31);
@@ -1044,7 +1044,7 @@
             // 
             this.Capacity.AutoSize = true;
             this.Capacity.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Capacity.Location = new System.Drawing.Point(117, 135);
+            this.Capacity.Location = new System.Drawing.Point(119, 137);
             this.Capacity.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.Capacity.Name = "Capacity";
             this.Capacity.Size = new System.Drawing.Size(0, 31);
@@ -1054,7 +1054,7 @@
             // 
             this.Process_midboxcode.AutoSize = true;
             this.Process_midboxcode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Process_midboxcode.Location = new System.Drawing.Point(117, 223);
+            this.Process_midboxcode.Location = new System.Drawing.Point(119, 225);
             this.Process_midboxcode.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.Process_midboxcode.Name = "Process_midboxcode";
             this.Process_midboxcode.Size = new System.Drawing.Size(28, 31);
@@ -1065,7 +1065,7 @@
             // 
             this.Process_outboxcode.AutoSize = true;
             this.Process_outboxcode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Process_outboxcode.Location = new System.Drawing.Point(117, 175);
+            this.Process_outboxcode.Location = new System.Drawing.Point(119, 177);
             this.Process_outboxcode.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.Process_outboxcode.Name = "Process_outboxcode";
             this.Process_outboxcode.Size = new System.Drawing.Size(28, 31);
@@ -1077,7 +1077,7 @@
             this.TotalCount.AutoSize = true;
             this.TotalCount.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.TotalCount.ForeColor = System.Drawing.Color.Blue;
-            this.TotalCount.Location = new System.Drawing.Point(185, 39);
+            this.TotalCount.Location = new System.Drawing.Point(187, 41);
             this.TotalCount.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.TotalCount.Name = "TotalCount";
             this.TotalCount.Size = new System.Drawing.Size(28, 31);
@@ -1088,7 +1088,7 @@
             // 
             this.label17.AutoSize = true;
             this.label17.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label17.Location = new System.Drawing.Point(157, 39);
+            this.label17.Location = new System.Drawing.Point(159, 41);
             this.label17.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label17.Name = "label17";
             this.label17.Size = new System.Drawing.Size(24, 31);
@@ -1100,7 +1100,7 @@
             this.CollectedCount.AutoSize = true;
             this.CollectedCount.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.CollectedCount.ForeColor = System.Drawing.Color.Red;
-            this.CollectedCount.Location = new System.Drawing.Point(121, 39);
+            this.CollectedCount.Location = new System.Drawing.Point(123, 41);
             this.CollectedCount.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.CollectedCount.Name = "CollectedCount";
             this.CollectedCount.Size = new System.Drawing.Size(28, 31);
@@ -1111,7 +1111,7 @@
             // 
             this.label14.AutoSize = true;
             this.label14.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label14.Location = new System.Drawing.Point(17, 175);
+            this.label14.Location = new System.Drawing.Point(19, 177);
             this.label14.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label14.Name = "label14";
             this.label14.Size = new System.Drawing.Size(62, 31);
@@ -1122,7 +1122,7 @@
             // 
             this.label11.AutoSize = true;
             this.label11.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label11.Location = new System.Drawing.Point(17, 221);
+            this.label11.Location = new System.Drawing.Point(19, 223);
             this.label11.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label11.Name = "label11";
             this.label11.Size = new System.Drawing.Size(62, 31);
@@ -1133,7 +1133,7 @@
             // 
             this.label13.AutoSize = true;
             this.label13.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label13.Location = new System.Drawing.Point(17, 95);
+            this.label13.Location = new System.Drawing.Point(19, 97);
             this.label13.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label13.Name = "label13";
             this.label13.Size = new System.Drawing.Size(86, 31);
@@ -1144,7 +1144,7 @@
             // 
             this.Installed.AutoSize = true;
             this.Installed.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Installed.Location = new System.Drawing.Point(117, 95);
+            this.Installed.Location = new System.Drawing.Point(119, 97);
             this.Installed.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.Installed.Name = "Installed";
             this.Installed.Size = new System.Drawing.Size(0, 31);
@@ -1154,7 +1154,7 @@
             // 
             this.Process.AutoSize = true;
             this.Process.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Process.Location = new System.Drawing.Point(17, 39);
+            this.Process.Location = new System.Drawing.Point(19, 41);
             this.Process.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.Process.Name = "Process";
             this.Process.Size = new System.Drawing.Size(86, 31);
@@ -1536,7 +1536,7 @@
             // 
             this.LabelSpace.AutoSize = true;
             this.LabelSpace.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.LabelSpace.Location = new System.Drawing.Point(17, 277);
+            this.LabelSpace.Location = new System.Drawing.Point(19, 279);
             this.LabelSpace.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.LabelSpace.Name = "LabelSpace";
             this.LabelSpace.Size = new System.Drawing.Size(142, 35);
@@ -1549,7 +1549,7 @@
             // 
             this.label8.AutoSize = true;
             this.label8.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.label8.Location = new System.Drawing.Point(9, 39);
+            this.label8.Location = new System.Drawing.Point(11, 41);
             this.label8.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label8.Name = "label8";
             this.label8.Size = new System.Drawing.Size(102, 35);
@@ -1559,7 +1559,7 @@
             // SingleDocRefresh
             // 
             this.SingleDocRefresh.AutoSize = true;
-            this.SingleDocRefresh.Location = new System.Drawing.Point(117, 39);
+            this.SingleDocRefresh.Location = new System.Drawing.Point(119, 41);
             this.SingleDocRefresh.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.SingleDocRefresh.Name = "SingleDocRefresh";
             this.SingleDocRefresh.Size = new System.Drawing.Size(82, 41);
@@ -1582,7 +1582,7 @@
             // 
             this.SingleLabelPrint.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
             this.SingleLabelPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.SingleLabelPrint.Location = new System.Drawing.Point(134, 408);
+            this.SingleLabelPrint.Location = new System.Drawing.Point(137, 415);
             this.SingleLabelPrint.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.SingleLabelPrint.Name = "SingleLabelPrint";
             this.SingleLabelPrint.Size = new System.Drawing.Size(136, 52);
@@ -1595,7 +1595,7 @@
             // 
             this.SingleLabelAutoPrint.AutoSize = true;
             this.SingleLabelAutoPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.SingleLabelAutoPrint.Location = new System.Drawing.Point(19, 221);
+            this.SingleLabelAutoPrint.Location = new System.Drawing.Point(21, 223);
             this.SingleLabelAutoPrint.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.SingleLabelAutoPrint.Name = "SingleLabelAutoPrint";
             this.SingleLabelAutoPrint.Size = new System.Drawing.Size(142, 35);
@@ -1643,7 +1643,7 @@
             // MidLabelPreView
             // 
             this.MidLabelPreView.AutoSize = true;
-            this.MidLabelPreView.Location = new System.Drawing.Point(195, 39);
+            this.MidLabelPreView.Location = new System.Drawing.Point(197, 41);
             this.MidLabelPreView.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.MidLabelPreView.Name = "MidLabelPreView";
             this.MidLabelPreView.Size = new System.Drawing.Size(82, 41);
@@ -1668,7 +1668,7 @@
             // 
             this.label9.AutoSize = true;
             this.label9.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.label9.Location = new System.Drawing.Point(9, 39);
+            this.label9.Location = new System.Drawing.Point(11, 41);
             this.label9.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label9.Name = "label9";
             this.label9.Size = new System.Drawing.Size(102, 35);
@@ -1678,7 +1678,7 @@
             // MidDocRefresh
             // 
             this.MidDocRefresh.AutoSize = true;
-            this.MidDocRefresh.Location = new System.Drawing.Point(113, 39);
+            this.MidDocRefresh.Location = new System.Drawing.Point(115, 41);
             this.MidDocRefresh.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.MidDocRefresh.Name = "MidDocRefresh";
             this.MidDocRefresh.Size = new System.Drawing.Size(82, 41);
@@ -1704,7 +1704,7 @@
             // 
             this.label5.AutoSize = true;
             this.label5.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label5.Location = new System.Drawing.Point(15, 347);
+            this.label5.Location = new System.Drawing.Point(17, 349);
             this.label5.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label5.Name = "label5";
             this.label5.Size = new System.Drawing.Size(62, 31);
@@ -1715,7 +1715,7 @@
             // 
             this.label4.AutoSize = true;
             this.label4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label4.Location = new System.Drawing.Point(15, 285);
+            this.label4.Location = new System.Drawing.Point(17, 287);
             this.label4.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label4.Name = "label4";
             this.label4.Size = new System.Drawing.Size(62, 31);
@@ -1736,7 +1736,7 @@
             // 
             this.label15.AutoSize = true;
             this.label15.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label15.Location = new System.Drawing.Point(197, 287);
+            this.label15.Location = new System.Drawing.Point(199, 289);
             this.label15.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label15.Name = "label15";
             this.label15.Size = new System.Drawing.Size(38, 31);
@@ -1769,7 +1769,7 @@
             // 
             this.MidLabelAutoPrint.AutoSize = true;
             this.MidLabelAutoPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.MidLabelAutoPrint.Location = new System.Drawing.Point(9, 211);
+            this.MidLabelAutoPrint.Location = new System.Drawing.Point(11, 213);
             this.MidLabelAutoPrint.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.MidLabelAutoPrint.Name = "MidLabelAutoPrint";
             this.MidLabelAutoPrint.Size = new System.Drawing.Size(142, 35);
@@ -1818,7 +1818,7 @@
             // 
             this.DiffCustOutBoxCode.AutoSize = true;
             this.DiffCustOutBoxCode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.DiffCustOutBoxCode.Location = new System.Drawing.Point(193, 331);
+            this.DiffCustOutBoxCode.Location = new System.Drawing.Point(195, 333);
             this.DiffCustOutBoxCode.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.DiffCustOutBoxCode.Name = "DiffCustOutBoxCode";
             this.DiffCustOutBoxCode.Size = new System.Drawing.Size(142, 35);
@@ -1847,7 +1847,7 @@
             // 
             this.cu_print_ordercode.AutoSize = true;
             this.cu_print_ordercode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.cu_print_ordercode.Location = new System.Drawing.Point(11, 133);
+            this.cu_print_ordercode.Location = new System.Drawing.Point(13, 135);
             this.cu_print_ordercode.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.cu_print_ordercode.Name = "cu_print_ordercode";
             this.cu_print_ordercode.Size = new System.Drawing.Size(142, 35);
@@ -1859,7 +1859,7 @@
             // 
             this.cu_print_outpo.AutoSize = true;
             this.cu_print_outpo.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.cu_print_outpo.Location = new System.Drawing.Point(11, 87);
+            this.cu_print_outpo.Location = new System.Drawing.Point(13, 89);
             this.cu_print_outpo.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.cu_print_outpo.Name = "cu_print_outpo";
             this.cu_print_outpo.Size = new System.Drawing.Size(142, 35);
@@ -1871,7 +1871,7 @@
             // 
             this.cu_print_outdc.AutoSize = true;
             this.cu_print_outdc.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.cu_print_outdc.Location = new System.Drawing.Point(11, 229);
+            this.cu_print_outdc.Location = new System.Drawing.Point(13, 231);
             this.cu_print_outdc.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.cu_print_outdc.Name = "cu_print_outdc";
             this.cu_print_outdc.Size = new System.Drawing.Size(80, 35);
@@ -1883,7 +1883,7 @@
             // 
             this.cu_print_outlotno.AutoSize = true;
             this.cu_print_outlotno.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.cu_print_outlotno.Location = new System.Drawing.Point(11, 179);
+            this.cu_print_outlotno.Location = new System.Drawing.Point(13, 181);
             this.cu_print_outlotno.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.cu_print_outlotno.Name = "cu_print_outlotno";
             this.cu_print_outlotno.Size = new System.Drawing.Size(117, 35);
@@ -1895,7 +1895,7 @@
             // 
             this.cu_print_outprod.AutoSize = true;
             this.cu_print_outprod.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.cu_print_outprod.Location = new System.Drawing.Point(11, 37);
+            this.cu_print_outprod.Location = new System.Drawing.Point(13, 39);
             this.cu_print_outprod.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.cu_print_outprod.Name = "cu_print_outprod";
             this.cu_print_outprod.Size = new System.Drawing.Size(142, 35);
@@ -1907,7 +1907,7 @@
             // 
             this.label19.AutoSize = true;
             this.label19.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.label19.Location = new System.Drawing.Point(5, 41);
+            this.label19.Location = new System.Drawing.Point(7, 43);
             this.label19.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label19.Name = "label19";
             this.label19.Size = new System.Drawing.Size(102, 35);
@@ -1917,7 +1917,7 @@
             // OutDocRefresh
             // 
             this.OutDocRefresh.AutoSize = true;
-            this.OutDocRefresh.Location = new System.Drawing.Point(111, 41);
+            this.OutDocRefresh.Location = new System.Drawing.Point(113, 43);
             this.OutDocRefresh.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.OutDocRefresh.Name = "OutDocRefresh";
             this.OutDocRefresh.Size = new System.Drawing.Size(82, 41);
@@ -1929,13 +1929,13 @@
             // LogingOut
             // 
             this.LogingOut.AutoSize = true;
-            this.LogingOut.Location = new System.Drawing.Point(225, 31);
+            this.LogingOut.Location = new System.Drawing.Point(195, 43);
             this.LogingOut.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.LogingOut.Name = "LogingOut";
-            this.LogingOut.Size = new System.Drawing.Size(82, 41);
+            this.LogingOut.Size = new System.Drawing.Size(146, 41);
             this.LogingOut.TabIndex = 77;
             this.LogingOut.TabStop = true;
-            this.LogingOut.Text = "注销";
+            this.LogingOut.Text = "切换账套";
             this.LogingOut.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LogingOut_LinkClicked);
             // 
             // GetOutBoxCode
@@ -1967,7 +1967,7 @@
             // 
             this.label10.AutoSize = true;
             this.label10.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label10.Location = new System.Drawing.Point(185, 283);
+            this.label10.Location = new System.Drawing.Point(187, 285);
             this.label10.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label10.Name = "label10";
             this.label10.Size = new System.Drawing.Size(62, 31);
@@ -1978,7 +1978,7 @@
             // 
             this.label6.AutoSize = true;
             this.label6.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label6.Location = new System.Drawing.Point(183, 223);
+            this.label6.Location = new System.Drawing.Point(185, 225);
             this.label6.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label6.Name = "label6";
             this.label6.Size = new System.Drawing.Size(62, 31);

+ 10 - 15
UAS-出货标签管理(贸易版)/UAS_出货标签管理.cs

@@ -2021,21 +2021,16 @@ namespace UAS_LabelMachine
 
         private void LogingOut_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
         {
-            string close = MessageBox.Show(this.ParentForm, "是否注销", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
-            if (close.ToString() == "Yes")
-            {
-                Login login = new Login();
-                //注销的时候需要将拼接的连接字符串置空
-                DataHelper.DBConnectionString = null;
-                logout = true;
-                if (lbl != null)
-                    lbl.Quit();
-                if (engine != null)
-                    engine.Dispose();
-                this.Hide();
-                login.ShowDialog();
-                this.Close();
-            }
+            ChangeMaster ch = new ChangeMaster();
+            BaseUtil.SetFormCenter(ch);
+            ch.FormClosed += Ch_FormClosed;
+            ch.ShowDialog();
+        }
+
+        private void Ch_FormClosed(object sender, FormClosedEventArgs e)
+        {
+            dh = SystemInf.dh;
+            sdh = SystemInf.sdh;
         }
 
         private void LabelInf_DataError(object sender, DataGridViewDataErrorEventArgs e) { }