Browse Source

添加账套信息

章政 8 years ago
parent
commit
f56068d5ca

+ 12 - 0
UAS_KanBan/App.config

@@ -1,6 +1,18 @@
 <?xml version="1.0" encoding="utf-8"?>
 <configuration>
+    <configSections>
+        <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
+            <section name="UAS_KanBan.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
+        </sectionGroup>
+    </configSections>
     <startup> 
         <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
     </startup>
+    <userSettings>
+        <UAS_KanBan.Properties.Settings>
+            <setting name="MES" serializeAs="String">
+                <value>Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=117.25.180.218)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</value>
+            </setting>
+        </UAS_KanBan.Properties.Settings>
+    </userSettings>
 </configuration>

+ 1 - 1
UAS_KanBan/DataHelper.cs

@@ -608,7 +608,7 @@ namespace UAS_KanBan
                 for (int i = 0; i < addpar.Length; i++)
                     command.Parameters.Add(new OracleParameter(addpar[i].ToString(), OracleDbType.Varchar2, names[i], ParameterDirection.Input));
             }
-
+            Console.WriteLine(SQL);
             switch (Type.ToUpper())
             {
                 case "SELECT":

+ 14 - 0
UAS_KanBan/Properties/Settings.Designer.cs

@@ -22,5 +22,19 @@ namespace UAS_KanBan.Properties {
                 return defaultInstance;
             }
         }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_" +
+            "LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=117.25.180.218)(PORT=1521)))(CONNECT_DATA=(SER" +
+            "VER=DEDICATED)(SERVICE_NAME=orcl)));")]
+        public string MES {
+            get {
+                return ((string)(this["MES"]));
+            }
+            set {
+                this["MES"] = value;
+            }
+        }
     }
 }

+ 8 - 6
UAS_KanBan/Properties/Settings.settings

@@ -1,7 +1,9 @@
 <?xml version='1.0' encoding='utf-8'?>
-<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
-  <Profiles>
-    <Profile Name="(Default)" />
-  </Profiles>
-  <Settings />
-</SettingsFile>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="UAS_KanBan.Properties" GeneratedClassName="Settings">
+  <Profiles />
+  <Settings>
+    <Setting Name="MES" Type="System.String" Scope="User">
+      <Value Profile="(Default)">Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=117.25.180.218)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</Value>
+    </Setting>
+  </Settings>
+</SettingsFile>

+ 16 - 14
UAS_KanBan/Setting.Designer.cs

@@ -52,7 +52,7 @@
             this.WorkCenter_Label.BackColor = System.Drawing.Color.Transparent;
             this.WorkCenter_Label.BorderColor = System.Drawing.Color.White;
             this.WorkCenter_Label.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.WorkCenter_Label.Location = new System.Drawing.Point(35, 57);
+            this.WorkCenter_Label.Location = new System.Drawing.Point(35, 108);
             this.WorkCenter_Label.Name = "WorkCenter_Label";
             this.WorkCenter_Label.Size = new System.Drawing.Size(37, 19);
             this.WorkCenter_Label.TabIndex = 1;
@@ -64,7 +64,7 @@
             this.Line_Label.BackColor = System.Drawing.Color.Transparent;
             this.Line_Label.BorderColor = System.Drawing.Color.White;
             this.Line_Label.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Line_Label.Location = new System.Drawing.Point(255, 57);
+            this.Line_Label.Location = new System.Drawing.Point(255, 108);
             this.Line_Label.Name = "Line_Label";
             this.Line_Label.Size = new System.Drawing.Size(37, 19);
             this.Line_Label.TabIndex = 2;
@@ -76,7 +76,7 @@
             this.Span_Label.BackColor = System.Drawing.Color.Transparent;
             this.Span_Label.BorderColor = System.Drawing.Color.White;
             this.Span_Label.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Span_Label.Location = new System.Drawing.Point(447, 57);
+            this.Span_Label.Location = new System.Drawing.Point(447, 108);
             this.Span_Label.Name = "Span_Label";
             this.Span_Label.Size = new System.Drawing.Size(37, 19);
             this.Span_Label.TabIndex = 3;
@@ -86,17 +86,18 @@
             // 
             this.WorkCenter.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
             this.WorkCenter.FormattingEnabled = true;
-            this.WorkCenter.Location = new System.Drawing.Point(103, 56);
+            this.WorkCenter.Location = new System.Drawing.Point(103, 107);
             this.WorkCenter.Name = "WorkCenter";
             this.WorkCenter.Size = new System.Drawing.Size(125, 22);
             this.WorkCenter.TabIndex = 4;
             this.WorkCenter.WaterText = "";
+            this.WorkCenter.SelectedIndexChanged += new System.EventHandler(this.WorkCenter_SelectedIndexChanged);
             // 
             // Line
             // 
             this.Line.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
             this.Line.FormattingEnabled = true;
-            this.Line.Location = new System.Drawing.Point(298, 56);
+            this.Line.Location = new System.Drawing.Point(298, 107);
             this.Line.Name = "Line";
             this.Line.Size = new System.Drawing.Size(125, 22);
             this.Line.TabIndex = 5;
@@ -106,7 +107,7 @@
             // 
             this.Span.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
             this.Span.FormattingEnabled = true;
-            this.Span.Location = new System.Drawing.Point(491, 56);
+            this.Span.Location = new System.Drawing.Point(490, 107);
             this.Span.Name = "Span";
             this.Span.Size = new System.Drawing.Size(125, 22);
             this.Span.TabIndex = 6;
@@ -118,7 +119,7 @@
             this.skinLabel4.BackColor = System.Drawing.Color.Transparent;
             this.skinLabel4.BorderColor = System.Drawing.Color.White;
             this.skinLabel4.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.skinLabel4.Location = new System.Drawing.Point(35, 117);
+            this.skinLabel4.Location = new System.Drawing.Point(35, 168);
             this.skinLabel4.Name = "skinLabel4";
             this.skinLabel4.Size = new System.Drawing.Size(65, 19);
             this.skinLabel4.TabIndex = 7;
@@ -130,7 +131,7 @@
             this.skinLabel5.BackColor = System.Drawing.Color.Transparent;
             this.skinLabel5.BorderColor = System.Drawing.Color.White;
             this.skinLabel5.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.skinLabel5.Location = new System.Drawing.Point(35, 175);
+            this.skinLabel5.Location = new System.Drawing.Point(35, 226);
             this.skinLabel5.Name = "skinLabel5";
             this.skinLabel5.Size = new System.Drawing.Size(65, 19);
             this.skinLabel5.TabIndex = 9;
@@ -144,7 +145,7 @@
             this.skinRadioButton1.ControlState = CCWin.SkinClass.ControlState.Normal;
             this.skinRadioButton1.DownBack = null;
             this.skinRadioButton1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.skinRadioButton1.Location = new System.Drawing.Point(79, 214);
+            this.skinRadioButton1.Location = new System.Drawing.Point(79, 265);
             this.skinRadioButton1.MouseBack = null;
             this.skinRadioButton1.Name = "skinRadioButton1";
             this.skinRadioButton1.NormlBack = null;
@@ -165,7 +166,7 @@
             this.skinRadioButton2.DownBack = null;
             this.skinRadioButton2.Enabled = false;
             this.skinRadioButton2.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.skinRadioButton2.Location = new System.Drawing.Point(238, 214);
+            this.skinRadioButton2.Location = new System.Drawing.Point(238, 265);
             this.skinRadioButton2.MouseBack = null;
             this.skinRadioButton2.Name = "skinRadioButton2";
             this.skinRadioButton2.NormlBack = null;
@@ -183,7 +184,7 @@
             this.skinLabel6.BackColor = System.Drawing.Color.Transparent;
             this.skinLabel6.BorderColor = System.Drawing.Color.White;
             this.skinLabel6.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.skinLabel6.Location = new System.Drawing.Point(234, 117);
+            this.skinLabel6.Location = new System.Drawing.Point(234, 168);
             this.skinLabel6.Name = "skinLabel6";
             this.skinLabel6.Size = new System.Drawing.Size(23, 19);
             this.skinLabel6.TabIndex = 12;
@@ -199,7 +200,7 @@
             this.TimeSpan.IsPasswordChat = '\0';
             this.TimeSpan.IsSystemPasswordChar = false;
             this.TimeSpan.Lines = new string[0];
-            this.TimeSpan.Location = new System.Drawing.Point(103, 113);
+            this.TimeSpan.Location = new System.Drawing.Point(103, 164);
             this.TimeSpan.Margin = new System.Windows.Forms.Padding(0);
             this.TimeSpan.MaxLength = 32767;
             this.TimeSpan.MinimumSize = new System.Drawing.Size(28, 28);
@@ -236,7 +237,7 @@
             this.MasterCombo_Label.BackColor = System.Drawing.Color.Transparent;
             this.MasterCombo_Label.BorderColor = System.Drawing.Color.White;
             this.MasterCombo_Label.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.MasterCombo_Label.Location = new System.Drawing.Point(35, 272);
+            this.MasterCombo_Label.Location = new System.Drawing.Point(32, 54);
             this.MasterCombo_Label.Name = "MasterCombo_Label";
             this.MasterCombo_Label.Size = new System.Drawing.Size(37, 19);
             this.MasterCombo_Label.TabIndex = 14;
@@ -246,11 +247,12 @@
             // 
             this.MasterCombo.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
             this.MasterCombo.FormattingEnabled = true;
-            this.MasterCombo.Location = new System.Drawing.Point(103, 269);
+            this.MasterCombo.Location = new System.Drawing.Point(100, 51);
             this.MasterCombo.Name = "MasterCombo";
             this.MasterCombo.Size = new System.Drawing.Size(128, 22);
             this.MasterCombo.TabIndex = 15;
             this.MasterCombo.WaterText = "";
+            this.MasterCombo.SelectedIndexChanged += new System.EventHandler(this.MasterCombo_SelectedIndexChanged);
             // 
             // Start
             // 

+ 35 - 1
UAS_KanBan/Setting.cs

@@ -15,6 +15,10 @@ namespace UAS_KanBan
     public partial class Setting : CCSkinMain
     {
 
+        DataHelper dh = new DataHelper();
+
+        DataTable dt;
+
         public static int RefreshRate = 0;
 
         public Setting()
@@ -24,7 +28,10 @@ namespace UAS_KanBan
 
         private void Setting_Load(object sender, EventArgs e)
         {
-
+            MasterCombo.DisplayMember = "ma_user";
+            MasterCombo.ValueMember = "ma_user";
+            dt =(DataTable) dh.ExecuteSql("select ms_pwd,ma_user,ma_address from master", "select");
+            MasterCombo.DataSource = dt;
         }
 
         private void Start_Click(object sender, EventArgs e)
@@ -43,5 +50,32 @@ namespace UAS_KanBan
             pr.ShowDialog();
             Close();
         }
+
+        private void WorkCenter_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            Line.DisplayMember = "li_name";
+            Line.ValueMember = "li_code";
+            Line.DataSource = dh.ExecuteSql("select li_code,li_name from line where li_wccode='"+WorkCenter.SelectedValue.ToString()+"'", "select");
+        }
+
+        private void MasterCombo_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            for (int i = 0; i < dt.Rows.Count; i++)
+            {
+                if (MasterCombo.SelectedValue.ToString() == dt.Rows[i]["ma_user"].ToString())
+                {
+                    DataHelper.DBConnectionString = "Data Source=" + dt.Rows[i]["ma_address"] + ";User ID=" + dt.Rows[i]["ma_user"] + ";PassWord=" + dt.Rows[i]["ms_pwd"];
+                    //重新执行一遍构造函数使得重置之后的链接字符串生效
+                    dh = new DataHelper();
+                }
+            }
+
+            Line.DisplayMember = "li_name";
+            Line.ValueMember = "li_code";
+            Line.DataSource = dh.ExecuteSql("select li_code,li_name from line", "select");
+            WorkCenter.DisplayMember = "wc_name";
+            WorkCenter.ValueMember = "wc_code";
+            WorkCenter.DataSource = dh.ExecuteSql("select wc_code,wc_name from workcenter", "select");
+        }
     }
 }