FrmUpdateLenth.cs 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. using Core.Mes.Client.Comm.Format;
  2. using Core.Mes.Client.Comm.Tool;
  3. using Core.StlMes.Client.YdmStuffManage.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.YdmStuffManage
  16. {
  17. public partial class FrmUpdateLenth : FrmBase
  18. {
  19. public FrmUpdateLenth()
  20. {
  21. InitializeComponent();
  22. }
  23. private void FrmUpdateLenth_Load(object sender, EventArgs e)
  24. {
  25. EntityHelper.ShowGridCaption<MatGpMEntity3>(ultraGrid1.DisplayLayout.Bands[0]);
  26. }
  27. /// <summary>
  28. /// 重写基类方法
  29. /// </summary>
  30. /// <param name="sender"></param>
  31. /// <param name="ToolbarKey"></param>
  32. public override void ToolBar_Click(object sender, string ToolbarKey)
  33. {
  34. switch (ToolbarKey)
  35. {
  36. case "DoQuery":
  37. doQuery();
  38. break;
  39. case"Update":
  40. updateLength();
  41. break;
  42. case "Close":
  43. this.Close();
  44. break;
  45. }
  46. }
  47. /// <summary>
  48. /// 查询未送判 余材
  49. /// </summary>
  50. private void doQuery()
  51. {
  52. string stoveNo = "";
  53. string judgeNo = "";
  54. if(this.chkStoveNo.Checked)
  55. {
  56. stoveNo = this.txtStoveNo.Text.Trim();
  57. }
  58. if(this.chkJugeHeatNo.Checked)
  59. {
  60. judgeNo = this.txtJugeNo.Text.Trim();
  61. }
  62. ArrayList parmList = new ArrayList();
  63. parmList.Add(stoveNo);
  64. parmList.Add(judgeNo);
  65. List<MatGpMEntity3> listSource = EntityHelper.GetData<MatGpMEntity3>(
  66. "Core.LgMes.Server.Stuffmanage.FrmUpdateLenth.doQuery", new object[] { parmList }, this.ob);
  67. MatGpMEntity3bindingSource.DataSource = listSource;
  68. }
  69. /// <summary>
  70. /// 修改坯长
  71. /// </summary>
  72. private void updateLength()
  73. {
  74. this.ultraGrid1.UpdateData();
  75. IQueryable<UltraGridRow> checkMagRows = this.ultraGrid1.Rows.AsQueryable().Where(" CHK = 'True'");
  76. if (checkMagRows.Count() == 0)
  77. {
  78. MessageUtil.ShowTips("请选择需要修改的库存信息!");
  79. return;
  80. }
  81. ArrayList parmList = new ArrayList();
  82. foreach (UltraGridRow row in checkMagRows)
  83. {
  84. MatGpMEntity3 matBcEntity = (MatGpMEntity3)row.ListObject;
  85. string matBcTity = JSONFormat.Format(matBcEntity);
  86. parmList.Add(matBcTity);
  87. }
  88. CoreClientParam ccp = new CoreClientParam();
  89. ccp.ServerName = "Core.LgMes.Server.Stuffmanage.FrmUpdateLenth";
  90. ccp.MethodName = "updateLen";
  91. ccp.ServerParams = new object[] { parmList };
  92. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  93. if (ccp.ReturnCode != -1)
  94. {
  95. if (ccp.ReturnInfo.Equals("修改成功!"))
  96. {
  97. doQuery();
  98. MessageUtil.ShowTips(ccp.ReturnInfo);
  99. }
  100. else
  101. {
  102. MessageUtil.ShowTips(ccp.ReturnInfo);
  103. }
  104. }
  105. }
  106. private void chkStoveNo_CheckedChanged(object sender, EventArgs e)
  107. {
  108. this.txtStoveNo.Enabled = this.chkStoveNo.Checked;
  109. }
  110. private void chkJugeHeatNo_CheckedChanged(object sender, EventArgs e)
  111. {
  112. this.txtJugeNo.Enabled = this.chkJugeHeatNo.Checked;
  113. }
  114. }
  115. }