FrmQcmAddAsk.cs 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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.StlMes.Client.Mcp.VRP.Entity;
  17. using Core.Mes.Client.Comm.Format;
  18. namespace Core.StlMes.Client.Mcp.VRP.Vrp
  19. {
  20. public partial class FrmQcmAddAsk : FrmBase
  21. {
  22. private string _JugdeApplyCode = "";
  23. private string _JudgeStoveNo = "";
  24. private string _ProOrderNo = "";
  25. private OpeBase _ob = null;
  26. public FrmQcmAddAsk(string jugdeApplyCode, string judgeStoveNo, string ordenNo, OpeBase ob)
  27. {
  28. InitializeComponent();
  29. _JugdeApplyCode = jugdeApplyCode;
  30. _JudgeStoveNo = judgeStoveNo;
  31. _ProOrderNo = ordenNo;
  32. _ob = ob;
  33. InitCol();
  34. }
  35. /// <summary>
  36. /// 初始化控件
  37. /// </summary>
  38. private void InitCol()
  39. {
  40. QueryQcmAddAsk();
  41. }
  42. /// <summary>
  43. /// 查询附加要求信息
  44. /// </summary>
  45. /// <param name="JudgeStoveNo"></param>
  46. private void QueryQcmAddAsk()
  47. {
  48. List<QcmAddAskEntity> listSource = null;
  49. DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.QueryQcmAddAsk", new object[] { _JugdeApplyCode, _JudgeStoveNo }, this._ob);
  50. if (dt.Rows.Count > 0 && dt != null)
  51. {
  52. listSource = EntityHelper.GetData<QcmAddAskEntity>(
  53. "com.steering.mes.mcp.Vrp.FrmVrpApplyNew.QueryQcmAddAsk", new object[] { _JugdeApplyCode, _JudgeStoveNo }, this._ob);
  54. qcmAddAskEntityBindingSource.DataSource = listSource;
  55. }
  56. else
  57. {
  58. listSource = EntityHelper.GetData<QcmAddAskEntity>(
  59. "com.steering.mes.mcp.Vrp.FrmVrpApplyNew.QueryQcmAddAsk", new object[] { _ProOrderNo }, this._ob);
  60. qcmAddAskEntityBindingSource.DataSource = listSource;
  61. }
  62. }
  63. /// <summary>
  64. /// 确认
  65. /// </summary>
  66. /// <param name="sender"></param>
  67. /// <param name="e"></param>
  68. private void btnOK_Click(object sender, EventArgs e)
  69. {
  70. this.ultraGrid3.UpdateData();
  71. ArrayList arrayList = new ArrayList();
  72. for (int i = 0; i < ultraGrid3.Rows.Count; i++)
  73. {
  74. QcmAddAskEntity ParmEntity = new QcmAddAskEntity();
  75. ParmEntity = (QcmAddAskEntity)this.ultraGrid3.Rows[i].ListObject;
  76. ParmEntity.JugdeApplyCode = _JugdeApplyCode;
  77. ParmEntity.JudgeStoveNo = _JudgeStoveNo;
  78. ParmEntity.ComfrimName = this.UserInfo.GetUserName();
  79. arrayList.Add(JSONFormat.Format(ParmEntity));
  80. }
  81. int count2 = ServerHelper.SetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.insertQcmAddAsk", new object[] { arrayList, _JugdeApplyCode, _JudgeStoveNo }, this._ob);
  82. CoreClientParam ccp = new CoreClientParam();
  83. ccp.ServerName = "com.steering.mes.mcp.Vrp.FrmVrpApplyNew";
  84. ccp.MethodName = "updateBundleNum";
  85. ccp.ServerParams = new object[] { _JugdeApplyCode, _JudgeStoveNo };
  86. ccp = _ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  87. this.DialogResult = System.Windows.Forms.DialogResult.OK;
  88. MessageUtil.ShowTips(ccp.ReturnInfo);
  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. }