FrmCancelOutList.cs 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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 FrmCancelOutList : FrmBase
  18. {
  19. public FrmCancelOutList()
  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. QueryXOut();
  34. break;
  35. case "cancelOutList":
  36. cancelOutList();
  37. break;
  38. case "Close":
  39. this.Close();
  40. break;
  41. }
  42. }
  43. /// <summary>
  44. /// 查询待处理出库单记录
  45. /// </summary>
  46. private void QueryXOut()
  47. {
  48. string jugeNo = "";
  49. string outDoc = "";
  50. string plinCode = "";
  51. //string departMentId = PipeManageClass.GetDepartIdBySectionId(UserInfo.GetDeptid(), ob);
  52. string departMentId = UserInfo.GetDeptid();
  53. NativeMethodNew na = new NativeMethodNew(this.ob);
  54. plinCode = na.GetPCode(this.UserInfo.GetDepartment());
  55. if (this.chkJugeHeatNo.Checked && this.txtJugeNo.Text.Trim() != "")
  56. {
  57. jugeNo = this.txtJugeNo.Text.Trim();
  58. }
  59. if (this.chkOutDoc.Checked && this.txtOutDoc.Text.Trim() != "")
  60. {
  61. }
  62. if (this.chkJugeHeatNo.Checked && this.txtJugeNo.Text.Trim() == "")
  63. {
  64. MessageUtil.ShowTips("请输入判定炉号!");
  65. return;
  66. }
  67. if (this.chkOutDoc.Checked && this.txtOutDoc.Text.Trim() == "")
  68. {
  69. MessageUtil.ShowTips("请输入出库单号!");
  70. return;
  71. }
  72. List<YdmZcOutlistEntity> listSource = EntityHelper.GetData<YdmZcOutlistEntity>(
  73. "com.steering.mes.signature.FrmInOnlineStore.queryXOut", new object[] { jugeNo,outDoc,plinCode, departMentId }, this.ob);
  74. YdmZcOutlistEntitybindingSource.DataSource = listSource;
  75. }
  76. /// <summary>
  77. /// 撤销待处理出库单
  78. /// </summary>
  79. private void cancelOutList()
  80. {
  81. this.ultraGrid1.UpdateData();
  82. IQueryable<UltraGridRow> checkMagRows = this.ultraGrid1.Rows.AsQueryable().Where(" CHK = 'True'");
  83. if (checkMagRows.Count() == 0)
  84. {
  85. MessageUtil.ShowTips("请选择需要撤销的主信息!");
  86. return;
  87. }
  88. ArrayList parm = new ArrayList();
  89. foreach (UltraGridRow uRow in checkMagRows)
  90. {
  91. YdmZcOutlistEntity outListEnTity = (YdmZcOutlistEntity)uRow.ListObject;
  92. string outListTity = JSONFormat.Format(outListEnTity);
  93. parm.Add(outListTity);
  94. }
  95. if (MessageUtil.ShowYesNoAndQuestion("是否确认撤销?") == DialogResult.No)
  96. {
  97. return;
  98. }
  99. CoreClientParam ccp = new CoreClientParam();
  100. ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
  101. ccp.MethodName = "cancelOutList";
  102. ccp.ServerParams = new object[] { parm };
  103. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  104. if (ccp.ReturnCode != -1)
  105. {
  106. if (ccp.ReturnInfo.Equals("撤销成功!"))
  107. {
  108. QueryXOut();
  109. MessageUtil.ShowTips(ccp.ReturnInfo);
  110. }
  111. else
  112. {
  113. MessageUtil.ShowTips(ccp.ReturnInfo);
  114. }
  115. }
  116. }
  117. private void FrmCancelOutList_Load(object sender, EventArgs e)
  118. {
  119. EntityHelper.ShowGridCaption<YdmZcOutlistEntity>(ultraGrid1.DisplayLayout.Bands[0]);
  120. }
  121. private void chkOutDoc_CheckedChanged(object sender, EventArgs e)
  122. {
  123. this.txtOutDoc.Enabled = this.chkOutDoc.Checked;
  124. }
  125. private void chkJugeHeatNo_CheckedChanged(object sender, EventArgs e)
  126. {
  127. this.txtJugeNo.Enabled = this.chkJugeHeatNo.Checked;
  128. }
  129. }
  130. }