F_PC_0101_1_7.cs 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. /*******************************************************************************
  2. * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential
  3. * 类的信息:
  4. * 1.程序名称:F_PC_0101_1_7.cs
  5. * 2.功能描述:操作时间及备注录入
  6. * 编辑履历:
  7. * 作者 日期 版本 修改内容
  8. * 王鑫 2015/09/25 1.00 新建
  9. *******************************************************************************/
  10. using System;
  11. using System.Windows.Forms;
  12. using System.Data;
  13. using Dongke.IBOSS.PRD.Basics.BaseControls;
  14. using Dongke.IBOSS.PRD.Basics.BaseResources;
  15. using Dongke.IBOSS.PRD.WCF.Proxys;
  16. using Dongke.IBOSS.PRD.Client.CommonModule;
  17. using Dongke.IBOSS.PRD.WCF.DataModels;
  18. namespace Dongke.IBOSS.PRD.Client.PCModule
  19. {
  20. public partial class F_PC_0101_1_7 : FormBase
  21. {
  22. #region 成员变量
  23. // 窗体标题
  24. private string _titleStr = "";
  25. private DataTable _dtBindSource = null;
  26. private string _S_PC_001 = "";
  27. private int _gridIndex = -1;
  28. private DataRowView _currentRow = null;
  29. #endregion
  30. #region 构造函数
  31. /// <summary>
  32. ///
  33. /// </summary>
  34. /// <param name="dtBindSource"></param>
  35. /// <param name="titleStr"></param>
  36. public F_PC_0101_1_7()
  37. {
  38. InitializeComponent();
  39. }
  40. #endregion
  41. #region 属性
  42. public DataTable SelData { set; get; }
  43. #endregion
  44. #region 事件
  45. /// <summary>
  46. /// 窗体加载事件
  47. /// </summary>
  48. /// <param name="sender"></param>
  49. /// <param name="e"></param>
  50. private void F_PC_0101_1_2_Load(object sender, EventArgs e)
  51. {
  52. try
  53. {
  54. DataTable dt = new DataTable();
  55. dt.Columns.Add("TestMouldFlag");
  56. dt.Columns.Add("TestMouldFlagName");
  57. dt.Rows.Add("0", "正常");
  58. dt.Rows.Add("1", "试验");
  59. cmbTestMouldFlag.ValueMember = "TestMouldFlag";
  60. cmbTestMouldFlag.DisplayMember = "TestMouldFlagName";
  61. cmbTestMouldFlag.DataSource = dt;
  62. cmbTestMouldFlag.SelectedValue = SelData.Rows[0]["TestMouldFlag"];
  63. }
  64. catch (Exception ex)
  65. {
  66. // 对异常进行共通处理
  67. ExceptionManager.HandleEventException(this.ToString(),
  68. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  69. }
  70. }
  71. /// <summary>
  72. /// 保存按钮事件
  73. /// </summary>
  74. /// <param name="sender"></param>
  75. /// <param name="e"></param>
  76. private void btnSave_Click(object sender, EventArgs e)
  77. {
  78. try
  79. {
  80. ClientRequestEntity cre = new ClientRequestEntity();
  81. cre.NameSpace = "F_PC_0101_1_7";
  82. cre.Name = "SaveTestMouldFlag";
  83. cre.Properties["TestMouldFlag"] = cmbTestMouldFlag.SelectedValue;
  84. string mouldIDs = ",";
  85. foreach (DataRow row in SelData.Rows)
  86. {
  87. mouldIDs += row["MouldID"] + ",";
  88. }
  89. cre.Properties["MouldIDs"] = mouldIDs;
  90. ServiceResultEntity sre = (ServiceResultEntity)DoAsync(() =>
  91. {
  92. return PCModuleProxyNew.Service.HandleRequest(cre);
  93. });
  94. if (sre.OtherStatus > 0)
  95. {
  96. MessageBox.Show(this.Text + "成功", this.Text,
  97. MessageBoxButtons.OK, MessageBoxIcon.Information);
  98. this.DialogResult = DialogResult.OK;
  99. }
  100. else if (sre.OtherStatus < 0 && !string.IsNullOrEmpty(sre.Message))
  101. {
  102. MessageBox.Show(this.Text + "失败,原因:" + sre.Message, this.Text,
  103. MessageBoxButtons.OK, MessageBoxIcon.Warning);
  104. }
  105. else
  106. {
  107. MessageBox.Show(this.Text + "失败", this.Text,
  108. MessageBoxButtons.OK, MessageBoxIcon.Warning);
  109. }
  110. }
  111. catch (Exception ex)
  112. {
  113. // 对异常进行共通处理
  114. ExceptionManager.HandleEventException(this.ToString(),
  115. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  116. }
  117. }
  118. /// <summary>
  119. /// 取消按钮事件
  120. /// </summary>
  121. /// <param name="sender"></param>
  122. /// <param name="e"></param>
  123. private void btnCancel_Click(object sender, EventArgs e)
  124. {
  125. this.Close();
  126. }
  127. #endregion
  128. }
  129. }