FrmQcmAddAsk.cs 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using CoreFS.CA06;
  10. using Core.Mes.Client.Comm.Server;
  11. using Core.Mes.Client.Comm.Control;
  12. using Infragistics.Win.UltraWinGrid;
  13. using Infragistics.Win;
  14. using System.Collections;
  15. using Core.Mes.Client.Comm.Tool;
  16. using Core.Mes.Client.Comm.Format;
  17. using Core.StlMes.Client.Mcp.Entity;
  18. namespace Core.StlMes.Client.Mcp.Coupling
  19. {
  20. public partial class FrmQcmAddAsk : FrmBase
  21. {
  22. private string _JugdeApplyCode = "";
  23. private string _JudgeStoveNo = "";
  24. private string _ProOrderNo = "";
  25. private string User = "";
  26. private DataTable _dtMatList = null;
  27. private OpeBase _ob = null;
  28. public FrmQcmAddAsk(string jugdeApplyCode, string judgeStoveNo, string ordenNo, OpeBase ob)
  29. {
  30. InitializeComponent();
  31. _JugdeApplyCode = jugdeApplyCode;
  32. _JudgeStoveNo = judgeStoveNo;
  33. _ProOrderNo = ordenNo;
  34. _ob = ob;
  35. InitCol();
  36. }
  37. /// <summary>
  38. /// 初始化控件
  39. /// </summary>
  40. private void InitCol()
  41. {
  42. QueryQcmAddAsk();
  43. }
  44. /// <summary>
  45. /// 查询附加要求信息
  46. /// </summary>
  47. /// <param name="JudgeStoveNo"></param>
  48. private void QueryQcmAddAsk()
  49. {
  50. List<QcmAddAskEntity> listSource = null;
  51. DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.coup.FrmCouplingAppl.QueryQcmAddAsk", new object[] { _JugdeApplyCode, _JudgeStoveNo }, this._ob);
  52. if (dt.Rows.Count > 0 && dt != null)
  53. {
  54. listSource = EntityHelper.GetData<QcmAddAskEntity>(
  55. "com.steering.mes.mcp.coup.FrmCouplingAppl.QueryQcmAddAsk", new object[] { _JugdeApplyCode, _JudgeStoveNo }, this._ob);
  56. qcmAddAskEntityBindingSource.DataSource = listSource;
  57. }
  58. else
  59. {
  60. listSource = EntityHelper.GetData<QcmAddAskEntity>(
  61. "com.steering.mes.mcp.coup.FrmCouplingAppl.QueryQcmAddAsk", new object[] { _ProOrderNo }, this._ob);
  62. qcmAddAskEntityBindingSource.DataSource = listSource;
  63. }
  64. }
  65. /// <summary>
  66. /// 确认
  67. /// </summary>
  68. /// <param name="sender"></param>
  69. /// <param name="e"></param>
  70. private void btnOK_Click(object sender, EventArgs e)
  71. {
  72. this.ultraGrid3.UpdateData();
  73. ArrayList arrayList = new ArrayList();
  74. for (int i = 0; i < ultraGrid3.Rows.Count; i++)
  75. {
  76. QcmAddAskEntity ParmEntity = new QcmAddAskEntity();
  77. ParmEntity = (QcmAddAskEntity)this.ultraGrid3.Rows[i].ListObject;
  78. ParmEntity.JugdeApplyCode = _JugdeApplyCode;
  79. ParmEntity.JudgeStoveNo = _JudgeStoveNo;
  80. ParmEntity.ComfrimName = this.UserInfo.GetUserName();
  81. arrayList.Add(JSONFormat.Format(ParmEntity));
  82. }
  83. int count2 = ServerHelper.SetData("com.steering.mes.mcp.coup.FrmCouplingAppl.insertQcmAddAsk", new object[] { arrayList }, this._ob);
  84. if (count2 > 0)
  85. {
  86. this.DialogResult = System.Windows.Forms.DialogResult.OK;
  87. }
  88. MessageUtil.ShowTips("确认成功!");
  89. this.Close();
  90. }
  91. /// <summary>
  92. /// 取消
  93. /// </summary>
  94. /// <param name="sender"></param>
  95. /// <param name="e"></param>
  96. private void btnCancel_Click(object sender, EventArgs e)
  97. {
  98. this.Close();
  99. }
  100. private void FrmQcmAddAsk_Load(object sender, EventArgs e)
  101. {
  102. EntityHelper.ShowGridCaption<QcmAddAskEntity>(ultraGrid3.DisplayLayout.Bands[0]);
  103. }
  104. }
  105. }