FrmUpdateFlagJugeStoveNo.cs 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. using Core.Mes.Client.Comm.Format;
  2. using Core.Mes.Client.Comm.Tool;
  3. using Core.StlMes.Client.ZGMil.Entity;
  4. using CoreFS.CA06;
  5. using Infragistics.Win.UltraWinGrid;
  6. using System;
  7. using System.Collections;
  8. using System.Collections.Generic;
  9. using System.ComponentModel;
  10. using System.Data;
  11. using System.Drawing;
  12. using System.Linq;
  13. using System.Text;
  14. using System.Windows.Forms;
  15. namespace Core.StlMes.Client.ZGMil.Signature
  16. {
  17. public partial class FrmUpdateFlagJugeStoveNo : FrmBase
  18. {
  19. public FrmUpdateFlagJugeStoveNo()
  20. {
  21. InitializeComponent();
  22. }
  23. /// <summary>
  24. /// 重写基类方法
  25. /// </summary>
  26. /// <param name="sender"></param>
  27. /// <param name="ToolbarKey"></param>
  28. public override void ToolBar_Click(object sender, string ToolbarKey)
  29. {
  30. switch (ToolbarKey)
  31. {
  32. case "Query":
  33. QueryXMat();
  34. break;
  35. case "updateFlagStove":
  36. updateFlagStove();
  37. break;
  38. case "Close":
  39. this.Close();
  40. break;
  41. }
  42. }
  43. /// <summary>
  44. /// 查询待处理库存
  45. /// </summary>
  46. private void QueryXMat()
  47. {
  48. string jugeNo = "";
  49. string plinCode = "";
  50. //string departMentId = PipeManageClass.GetDepartIdBySectionId(UserInfo.GetDeptid(), ob);
  51. string departMentId = UserInfo.GetDeptid();
  52. NativeMethodNew na = new NativeMethodNew(this.ob);
  53. plinCode = na.GetPCode(this.UserInfo.GetDepartment());
  54. if (this.chkJugeHeatNo.Checked && this.txtJugeNo.Text.Trim() != "")
  55. {
  56. jugeNo = this.txtJugeNo.Text.Trim();
  57. }
  58. if(this.chkJugeHeatNo.Checked && this.txtJugeNo.Text == "")
  59. {
  60. MessageUtil.ShowTips("请输入判定炉号!");
  61. return;
  62. }
  63. List<MatZcMEntity> listSource = EntityHelper.GetData<MatZcMEntity>(
  64. "com.steering.mes.signature.FrmInOnlineStore.queryXMat", new object[] { jugeNo, plinCode, departMentId }, this.ob);
  65. MatZcMEntitybindingSource.DataSource = listSource;
  66. }
  67. /// <summary>
  68. /// 修改标识炉号
  69. /// </summary>
  70. private void updateFlagStove()
  71. {
  72. this.ultraGrid1.UpdateData();
  73. IQueryable<UltraGridRow> checkMagRows = this.ultraGrid1.Rows.AsQueryable().Where(" CHK = 'True'");
  74. if (checkMagRows.Count() == 0)
  75. {
  76. MessageUtil.ShowTips("请选择需要修改的主信息!");
  77. return;
  78. }
  79. ArrayList parm = new ArrayList();
  80. foreach (UltraGridRow uRow in checkMagRows)
  81. {
  82. MatZcMEntity matZcEntity = (MatZcMEntity)uRow.ListObject;
  83. string matZcTity = JSONFormat.Format(matZcEntity);
  84. parm.Add(matZcTity);
  85. }
  86. CoreClientParam ccp = new CoreClientParam();
  87. ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
  88. ccp.MethodName = "updateFlagStove";
  89. ccp.ServerParams = new object[] { parm };
  90. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  91. if (ccp.ReturnCode != -1)
  92. {
  93. if (ccp.ReturnInfo.Equals("修改成功!"))
  94. {
  95. QueryXMat();
  96. MessageUtil.ShowTips(ccp.ReturnInfo);
  97. }
  98. else
  99. {
  100. MessageUtil.ShowTips(ccp.ReturnInfo);
  101. }
  102. }
  103. }
  104. private void FrmUpdateFlagJugeStoveNo_Load(object sender, EventArgs e)
  105. {
  106. EntityHelper.ShowGridCaption<MatZcMEntity>(ultraGrid1.DisplayLayout.Bands[0]);
  107. }
  108. private void chkJugeHeatNo_CheckedChanged(object sender, EventArgs e)
  109. {
  110. this.txtJugeNo.Enabled = this.chkJugeHeatNo.Checked;
  111. }
  112. }
  113. }