FrmCancelAll.cs 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. 
  2. using Core.Mes.Client.Comm.Format;
  3. using Core.Mes.Client.Comm.Server;
  4. using Core.Mes.Client.Comm.Tool;
  5. using Core.StlMes.Client.ZGMil.Entity;
  6. using CoreFS.CA06;
  7. using Infragistics.Win.UltraWinGrid;
  8. using System;
  9. using System.Collections.Generic;
  10. using System.ComponentModel;
  11. using System.Data;
  12. using System.Drawing;
  13. using System.Linq;
  14. using System.Text;
  15. using System.Windows.Forms;
  16. namespace Core.StlMes.Client.ZGMil.Signature
  17. {
  18. public partial class FrmCancelAll : FrmBase
  19. {
  20. public FrmCancelAll()
  21. {
  22. InitializeComponent();
  23. }
  24. /// <summary>
  25. /// 重写基类方法
  26. /// </summary>
  27. /// <param name="sender"></param>
  28. /// <param name="ToolbarKey"></param>
  29. public override void ToolBar_Click(object sender, string ToolbarKey)
  30. {
  31. switch (ToolbarKey)
  32. {
  33. case "Query":
  34. doQueryOutList();
  35. break;
  36. case "Cancel":
  37. cancelData();
  38. break;
  39. case "Close":
  40. this.Close();
  41. break;
  42. }
  43. }
  44. /// <summary>
  45. /// 查询发运记录
  46. /// </summary>
  47. private void doQueryOutList()
  48. {
  49. string jugeNo = "";
  50. if (this.txtJugeNo.Text.Trim() == "")
  51. {
  52. MessageUtil.ShowTips("请输入判定炉号");
  53. return;
  54. }
  55. else
  56. {
  57. jugeNo = this.txtJugeNo.Text.Trim();
  58. }
  59. List<YdmZcOutlistEntity> listSource = EntityHelper.GetData<YdmZcOutlistEntity>(
  60. "com.steering.mes.signature.FrmCancelAll.doQueryOutList", new object[] { jugeNo }, this.ob);
  61. YdmZcOutlistbindingSource.DataSource = listSource;
  62. }
  63. /// <summary>
  64. /// 撤销发运
  65. /// </summary>
  66. private void cancelData()
  67. {
  68. UltraGridRow uRow = this.ultraGrid1.ActiveRow;
  69. if (uRow == null)
  70. {
  71. return;
  72. }
  73. YdmZcOutlistEntity ydmZcEntity = (YdmZcOutlistEntity)uRow.ListObject;
  74. DataTable ds = ServerHelper.GetData("com.steering.mes.signature.FrmCancelAll.doQueryJugde", new object[] { ydmZcEntity.JudgeStoveNo.ToString() }, ob);
  75. if (int.Parse(ds.Rows[0][0].ToString()) > 0)
  76. {
  77. MessageUtil.ShowTips("该炉已经申请判定,不允许撤销!");
  78. return;
  79. }
  80. //DataTable dd = ServerHelper.GetData("com.steering.mes.signature.FrmCancelAll.doQueryInstoreRs", new object[] { ydmZcEntity.JudgeStoveNo.ToString() }, ob);
  81. //if (dd.Rows[0][0].ToString() == "0")
  82. //{
  83. // MessageUtil.ShowTips("该炉在交库点未结炉,不允许撤销!");
  84. // return;
  85. //}
  86. string ydmTity = JSONFormat.Format(ydmZcEntity);
  87. if (MessageUtil.ShowYesNoAndQuestion("是否确认一键撤销?") == DialogResult.No) return;
  88. CoreClientParam ccp = new CoreClientParam();
  89. ccp.ServerName = "com.steering.mes.signature.FrmCancelAll";
  90. ccp.MethodName = "cancelAll";
  91. ccp.ServerParams = new object[] { ydmTity,UserInfo.GetUserName() };
  92. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  93. if (ccp.ReturnCode != -1)
  94. {
  95. if (ccp.ReturnInfo.Equals("撤销成功!"))
  96. {
  97. doQueryOutList();
  98. MessageUtil.ShowTips(ccp.ReturnInfo);
  99. }
  100. else
  101. {
  102. MessageUtil.ShowTips(ccp.ReturnInfo);
  103. }
  104. }
  105. }
  106. private void FrmCancelAll_Load(object sender, EventArgs e)
  107. {
  108. EntityHelper.ShowGridCaption<YdmZcOutlistEntity>(ultraGrid1.DisplayLayout.Bands[0]);
  109. }
  110. }
  111. }