FrmCheckConsignBaseInfo.cs 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Data;
  6. using System.Drawing;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Windows.Forms;
  10. using Core.Mes.Client.Comm.Control;
  11. using Core.Mes.Client.Comm.Server;
  12. using Core.Mes.Client.Comm.Tool;
  13. using CoreFS.CA06;
  14. namespace Core.StlMes.Client.Lims.Data.PipeAndOutdec
  15. {
  16. public partial class FrmCheckConsignBaseInfo : FrmBase
  17. {
  18. public FrmCheckConsignBaseInfo()
  19. {
  20. InitializeComponent();
  21. }
  22. public override void ToolBar_Click(object sender, string ToolbarKey)
  23. {
  24. switch (ToolbarKey)
  25. {
  26. case "doQuery":
  27. doQuery();
  28. break;
  29. case "doUpdate":
  30. doUpdate();
  31. break;
  32. case "Close":
  33. this.Close();
  34. break;
  35. }
  36. }
  37. /// <summary>
  38. /// 查询
  39. /// </summary>
  40. public void doQuery()
  41. {
  42. string checkNo = ""; //检验编号
  43. string heatNo = ""; //炉号
  44. if (uchkCheckNo.Checked)
  45. {
  46. checkNo = txtCheckNo.Text.Trim();
  47. }
  48. if (uchkHeatNo.Checked)
  49. {
  50. heatNo = txtHeatNo.Text.Trim();
  51. }
  52. if (checkNo.Equals("")&& heatNo.Equals("")) {
  53. MessageUtil.ShowTips("请输入检验编号或炉号查询!");
  54. return;
  55. }
  56. DataTable dt = ServerHelper.GetData("com.steering.lims.data.pipe.FrmCheckConsignBaseInfo.doQuery", new Object[] { checkNo, heatNo}, this.ob);
  57. GridHelper.CopyDataToDatatable(ref dt, ref this.dataTable1, true);
  58. }
  59. /// <summary>
  60. /// 修改
  61. /// </summary>
  62. public void doUpdate()
  63. {
  64. try
  65. {
  66. ultraGrid1.Update();
  67. if (ultraGrid1.ActiveRow == null)
  68. {
  69. MessageUtil.ShowTips("请选择需要修改的数据!");
  70. return;
  71. }
  72. String craftSource = ultraGrid1.ActiveRow.Cells["CRAFT_SOURCE"].Value.ToString();
  73. if (!craftSource.Equals("生产样") && !craftSource.Equals("首日样"))
  74. {
  75. MessageUtil.ShowTips("改数据非生产样,不能修改!");
  76. return;
  77. }
  78. if (MessageUtil.ShowYesNoAndQuestion("是否确定修改?") == DialogResult.No)
  79. {
  80. return;
  81. }
  82. ArrayList all = new ArrayList();
  83. String checkNo = ultraGrid1.ActiveRow.Cells["CHECK_NO"].Value.ToString();
  84. all.Add(checkNo);
  85. CoreClientParam ccp = new CoreClientParam();
  86. ccp.ServerName = "com.steering.lims.data.pipe.FrmCheckConsignBaseInfo";
  87. ccp.MethodName = "doUpdate";
  88. ccp.ServerParams = new object[] { all };
  89. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  90. if (ccp.ReturnCode == -1) return;
  91. MessageBox.Show("修改成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  92. doQuery();
  93. }
  94. catch (System.Exception ex)
  95. {
  96. MessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  97. }
  98. }
  99. private void FrmCheckConsignBaseInfo_Load(object sender, EventArgs e)
  100. {
  101. }
  102. }
  103. }