Selaa lähdekoodia

金蝶对应代码界面编辑下拉框设置优先选中值

忠帅 张 2 vuotta sitten
vanhempi
commit
18f457ef62
2 muutettua tiedostoa jossa 27 lisäystä ja 9 poistoa
  1. 4 2
      DK.Client/SystemModule/F_MST_1301.cs
  2. 23 7
      DK.Client/SystemModule/F_MST_1302.cs

+ 4 - 2
DK.Client/SystemModule/F_MST_1301.cs

@@ -130,7 +130,7 @@ namespace Dongke.IBOSS.PRD.Client.SystemModule
 		{
 			try
 			{
-				F_MST_1302 frmMST1302 = new F_MST_1302(Constant.FormMode.Add,"");
+				F_MST_1302 frmMST1302 = new F_MST_1302(Constant.FormMode.Add,"","","");
 				DialogResult dialogResult = frmMST1302.ShowDialog();
 				// 重新加载GridView
 				btnSearch_Click(sender, null);
@@ -155,7 +155,9 @@ namespace Dongke.IBOSS.PRD.Client.SystemModule
 				if (this.dgvGoosKingdeecode.SelectedRows.Count != 0)
 				{
 					string KingdeeCode = this.dgvGoosKingdeecode.SelectedRows[0].Cells["KINGDEECODE"].Value.ToString();
-					F_MST_1302 frmFPC1302 = new F_MST_1302(Constant.FormMode.Edit, KingdeeCode);
+					string logname= this.dgvGoosKingdeecode.SelectedRows[0].Cells["LOGONAME"].Value.ToString();
+					string GLAZETYPE= this.dgvGoosKingdeecode.SelectedRows[0].Cells["GLAZETYPE"].Value.ToString();
+					F_MST_1302 frmFPC1302 = new F_MST_1302(Constant.FormMode.Edit, KingdeeCode, logname, GLAZETYPE);
 					DialogResult dialogresult = frmFPC1302.ShowDialog();
 					btnSearch_Click(sender, null);
 				}

+ 23 - 7
DK.Client/SystemModule/F_MST_1302.cs

@@ -11,6 +11,7 @@ using System.Drawing;
 using System.Linq;
 using System.Text;
 using System.Windows.Forms;
+using static System.Windows.Forms.VisualStyles.VisualStyleElement;
 
 namespace Dongke.IBOSS.PRD.Client.SystemModule
 {
@@ -21,6 +22,10 @@ namespace Dongke.IBOSS.PRD.Client.SystemModule
 		private Constant.FormMode _editStatus;
 		//记录金蝶代码
 		private string KingdeeCodeOne;
+
+		private string lognameOne;
+
+		private string GLAZETYPEOne;
 		#endregion
 
 		#region 构造函数
@@ -29,7 +34,7 @@ namespace Dongke.IBOSS.PRD.Client.SystemModule
 			InitializeComponent();
 		}
 
-		public F_MST_1302(Constant.FormMode frmStatus, string KingdeeCode)
+		public F_MST_1302(Constant.FormMode frmStatus, string KingdeeCode, string logname,string GLAZETYPE)
 		{
 			InitializeComponent();
 			_editStatus = frmStatus;
@@ -52,8 +57,8 @@ namespace Dongke.IBOSS.PRD.Client.SystemModule
 					cre.Name = "GetKingdeeCode";
 					cre.Properties["KingdeeCode"] = KingdeeCode;
 					cre.Properties["GoodsCode"] = "";
-					cre.Properties["GlazeType"] = "";
-					cre.Properties["LogoName"] = "";
+					lognameOne = logname;
+					GLAZETYPEOne = GLAZETYPE;
 					ServiceResultEntity sre = SystemModuleProxy.Service.DoRequest(cre);
 					if (sre.Status == Basics.BaseResources.Constant.ServiceResultStatus.Success)
 					{
@@ -65,7 +70,8 @@ namespace Dongke.IBOSS.PRD.Client.SystemModule
 						//商标名称
 						this.ddlLogoName.InitValue(item["LOGONAME"].ToString(), 1);
 						//釉料类别
-						this.ddlLogoName.InitValue(item["GLAZETYPE"].ToString(),1);
+						this.ddlLogoName.InitValue(item["GLAZETYPE"].ToString(), 1);
+
 					}
 				}
 			}
@@ -177,6 +183,12 @@ namespace Dongke.IBOSS.PRD.Client.SystemModule
 				this.ddlGlazeTypeID.ClearValue();
 				this.ddlLogoName.ClearValue();
 				this.loadDataSource();
+				this.ddlGlazeTypeID.SelectedText = GLAZETYPEOne;
+				int logindex = ddlLogoName.FindString(lognameOne);
+				this.ddlLogoName.SelectedIndex = logindex;
+
+				int index = ddlGlazeTypeID.FindString(GLAZETYPEOne);
+				this.ddlGlazeTypeID.SelectedIndex = index;
 
 			}
 			catch (Exception ex)
@@ -203,6 +215,7 @@ namespace Dongke.IBOSS.PRD.Client.SystemModule
 					ddlGlazeTypeID.ValueMember = "DictionarylD";
 					ddlGlazeTypeID.DataSource = dtGlazeType;
 				}
+
 				ClientRequestEntity cre = new ClientRequestEntity();
 				cre.NameSpace = "F_MST_1301";
 				cre.Name = "GetLogoName";
@@ -215,6 +228,7 @@ namespace Dongke.IBOSS.PRD.Client.SystemModule
 						ddlLogoName.DisplayMember = "LogoNameCode";
 						ddlLogoName.ValueMember = "LogoID";
 						ddlLogoName.DataSource = dtLogoName;
+
 					}
 				}
 			}
@@ -306,8 +320,10 @@ namespace Dongke.IBOSS.PRD.Client.SystemModule
 							"",
 							MessageBoxButtons.OK,
 							MessageBoxIcon.Warning);
-				return;
-			}
-		}
+return;
+}
+}
+
+
 	}
 }