F_PM_0101_2.cs 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. using Dongke.IBOSS.PRD.Basics.BaseResources;
  2. using Dongke.IBOSS.PRD.Client.CommonModule;
  3. using Dongke.IBOSS.PRD.Client.Controls;
  4. using Dongke.IBOSS.PRD.WCF.DataModels;
  5. using Dongke.IBOSS.PRD.WCF.Proxys;
  6. using System;
  7. using System.Reflection;
  8. using System.Windows.Forms;
  9. namespace Dongke.IBOSS.PRD.Client.PMModule
  10. {
  11. public partial class F_PM_0101_2 :DKFormBase
  12. {
  13. #region 成员变量
  14. //成型线ID
  15. string Groutingid = "";
  16. #endregion
  17. public F_PM_0101_2(string groutinglineid,string GROUTINGLINECODE, string NEWMOLDFLAG, string CONVERTPRODUCEFLAG, string CONVERTLINEGLAG)
  18. {
  19. InitializeComponent();
  20. Groutingid = groutinglineid;
  21. //金蝶代码
  22. this.groutinglineCode.Text = GROUTINGLINECODE;
  23. if (NEWMOLDFLAG == "1")
  24. {
  25. Newmold.SelectedIndex = 0;
  26. }
  27. else {
  28. Newmold.SelectedIndex = 1;
  29. }
  30. if (CONVERTPRODUCEFLAG == "1")
  31. {
  32. convertproduceflag.SelectedIndex = 0;
  33. }
  34. else
  35. {
  36. convertproduceflag.SelectedIndex = 1;
  37. }
  38. if (CONVERTLINEGLAG == "1")
  39. {
  40. convertLine.SelectedIndex = 0;
  41. }
  42. else
  43. {
  44. convertLine.SelectedIndex = 1;
  45. }
  46. }
  47. private void F_PM_0101_2_Load(object sender, EventArgs e)
  48. {
  49. this.groutinglineCode.ReadOnly = true;
  50. }
  51. private void btnSave_Click(object sender, EventArgs e)
  52. {
  53. try{
  54. ServiceResultEntity returnValue=EditData();
  55. if (returnValue != null && returnValue.Status == Constant.ServiceResultStatus.Success)
  56. {
  57. // 提示信息
  58. MessageBox.Show(string.Format(Messages.MSG_CMN_I001, this.Text, "保存"),
  59. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
  60. this.DialogResult = DialogResult.OK;
  61. }
  62. else
  63. {
  64. // 提示信息
  65. MessageBox.Show("保存失败",
  66. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
  67. }
  68. }
  69. catch (Exception ex)
  70. {
  71. // 对异常进行共通处理
  72. ExceptionManager.HandleEventException(this.ToString(),
  73. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  74. }
  75. this.Close();
  76. }
  77. private void btnCancel_Click(object sender, EventArgs e)
  78. {
  79. try {
  80. this.Close();
  81. }
  82. catch (Exception ex)
  83. {
  84. throw ex;
  85. }
  86. }
  87. private ServiceResultEntity EditData()
  88. {
  89. try
  90. {
  91. string NewMold = "0";
  92. string Convertprduceflag = "0";
  93. string ConvertLine = "0";
  94. if (Newmold.SelectedIndex ==0) {
  95. NewMold = "1";
  96. }
  97. if (convertproduceflag.SelectedIndex==0) {
  98. Convertprduceflag = "1";
  99. }
  100. if (convertLine.SelectedIndex==0) {
  101. ConvertLine = "1";
  102. }
  103. ClientRequestEntity cre = new ClientRequestEntity();
  104. cre.NameSpace = "F_PM_0101_1";
  105. cre.Name = "GroutingSpecialEtid";
  106. cre.Properties["GroutingLineID"] = Groutingid;
  107. cre.Properties["GroutingLineCode"] = this.groutinglineCode.Text.Trim();
  108. cre.Properties["NEWMOLDFLAG"] = NewMold;
  109. cre.Properties["CONVERTPRODUCEFLAG"] = Convertprduceflag;
  110. cre.Properties["CONVERTLINEGLAG"] = ConvertLine;
  111. ServiceResultEntity sre = DoAsync<ServiceResultEntity>(() =>
  112. {
  113. return PCModuleProxyNew.Service.HandleRequest(cre);
  114. }
  115. );
  116. return sre;
  117. }
  118. catch (Exception ex)
  119. {
  120. throw ex;
  121. }
  122. }
  123. }
  124. }