using Dongke.IBOSS.PRD.Basics.BaseResources; using Dongke.IBOSS.PRD.Client.CommonModule; using Dongke.IBOSS.PRD.Client.Controls; using Dongke.IBOSS.PRD.WCF.DataModels; using Dongke.IBOSS.PRD.WCF.Proxys; using System; using System.Reflection; using System.Windows.Forms; namespace Dongke.IBOSS.PRD.Client.PMModule { public partial class F_PM_0101_2 :DKFormBase { #region 成员变量 //成型线ID string Groutingid = ""; #endregion public F_PM_0101_2(string groutinglineid,string GROUTINGLINECODE, string NEWMOLDFLAG, string CONVERTPRODUCEFLAG, string CONVERTLINEGLAG) { InitializeComponent(); Groutingid = groutinglineid; //金蝶代码 this.groutinglineCode.Text = GROUTINGLINECODE; if (NEWMOLDFLAG == "1") { Newmold.SelectedIndex = 0; } else { Newmold.SelectedIndex = 1; } if (CONVERTPRODUCEFLAG == "1") { convertproduceflag.SelectedIndex = 0; } else { convertproduceflag.SelectedIndex = 1; } if (CONVERTLINEGLAG == "1") { convertLine.SelectedIndex = 0; } else { convertLine.SelectedIndex = 1; } } private void F_PM_0101_2_Load(object sender, EventArgs e) { this.groutinglineCode.ReadOnly = true; } private void btnSave_Click(object sender, EventArgs e) { try{ ServiceResultEntity returnValue=EditData(); if (returnValue != null && returnValue.Status == Constant.ServiceResultStatus.Success) { // 提示信息 MessageBox.Show(string.Format(Messages.MSG_CMN_I001, this.Text, "保存"), this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); this.DialogResult = DialogResult.OK; } else { // 提示信息 MessageBox.Show("保存失败", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning); } } catch (Exception ex) { // 对异常进行共通处理 ExceptionManager.HandleEventException(this.ToString(), System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex); } this.Close(); } private void btnCancel_Click(object sender, EventArgs e) { try { this.Close(); } catch (Exception ex) { throw ex; } } private ServiceResultEntity EditData() { try { string NewMold = "0"; string Convertprduceflag = "0"; string ConvertLine = "0"; if (Newmold.SelectedIndex ==0) { NewMold = "1"; } if (convertproduceflag.SelectedIndex==0) { Convertprduceflag = "1"; } if (convertLine.SelectedIndex==0) { ConvertLine = "1"; } ClientRequestEntity cre = new ClientRequestEntity(); cre.NameSpace = "F_PM_0101_1"; cre.Name = "GroutingSpecialEtid"; cre.Properties["GroutingLineID"] = Groutingid; cre.Properties["GroutingLineCode"] = this.groutinglineCode.Text.Trim(); cre.Properties["NEWMOLDFLAG"] = NewMold; cre.Properties["CONVERTPRODUCEFLAG"] = Convertprduceflag; cre.Properties["CONVERTLINEGLAG"] = ConvertLine; ServiceResultEntity sre = DoAsync(() => { return PCModuleProxyNew.Service.HandleRequest(cre); } ); return sre; } catch (Exception ex) { throw ex; } } } }