FrmHotCheck.cs 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using CoreFS.CA06;
  9. using System.Windows.Forms;
  10. using Infragistics.Win.UltraWinGrid;
  11. using System.Collections;
  12. using com.steering.mes.zgmil.entity;
  13. using Core.Mes.Client.Comm.Server;
  14. using Core.Mes.Client.Comm.Tool;
  15. using Core.StlMes.Client.ZGMil.Entity;
  16. using Core.Mes.Client.Comm.Control;
  17. namespace Core.StlMes.Client.ZGMil.Result
  18. {
  19. public partial class FrmHotCheck : FrmBase
  20. {
  21. //private OpeBase ob;
  22. public OpeBase Ob
  23. {
  24. get { return ob; }
  25. set { ob = value; }
  26. }
  27. public FrmHotCheck(DataTable dt, OpeBase _Ob)
  28. {
  29. InitializeComponent();
  30. Ob = _Ob;
  31. DataRow row1 = dt.Rows[0];
  32. LH_TEXT.Text = row1[3].ToString();
  33. BH_TEXT.Text = "";
  34. BZ_TEXT.Text = "";
  35. PZ_TEXT.Text = row1[18].ToString();
  36. GZ_TEXT.Text = row1[25].ToString();
  37. GJ_TEXT.Text = row1[27].ToString();
  38. GG_TEXT.Text = row1[19].ToString();
  39. JY_TEXT.Text = "";
  40. textBox11.Text = "";
  41. Infragistics.Win.ValueList valulist = new Infragistics.Win.ValueList();//复探原因
  42. valulist.ValueListItems.Add("管端");
  43. valulist.ValueListItems.Add("管体");
  44. valulist.ValueListItems.Add("管尾");
  45. foreach (UltraGridRow ugr in ultraGrid1.Rows)
  46. {
  47. ugr.Cells["pipe_location"].ValueList = valulist;
  48. }
  49. DataTable dt1 = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmHotCheck.CheckHotCheckDetail", new Object[] { LH_TEXT.Text }, this.ob);
  50. if (dt1.Rows.Count > 0)
  51. {
  52. GridHelper.CopyDataToDatatable(ref dt1, ref this.dataTable1, true);
  53. //foreach (UltraGridRow ugr in ultraGrid1.Rows)
  54. //{
  55. // if (ultraGrid1.ActiveRow.Cells["pipe_location"].Value.ToString() == "0")
  56. // {
  57. // ultraGrid1.ActiveRow.Cells["pipe_location"].Value = "管头";
  58. // }
  59. // if (ultraGrid1.ActiveRow.Cells["pipe_location"].Value.ToString() == "1")
  60. // {
  61. // ultraGrid1.ActiveRow.Cells["pipe_location"].Value = "管体";
  62. // }
  63. // if (ultraGrid1.ActiveRow.Cells["pipe_location"].Value.ToString() == "2")
  64. // {
  65. // ultraGrid1.ActiveRow.Cells["pipe_location"].Value = "管尾";
  66. // }
  67. //}
  68. }
  69. else
  70. {
  71. this.dataTable1.Rows.Add(new object[] { row1[3].ToString(), "管头" });
  72. this.dataTable1.Rows.Add(new object[] { row1[3].ToString(), "管体" });
  73. this.dataTable1.Rows.Add(new object[] { row1[3].ToString(), "管尾" });
  74. }
  75. }
  76. private void ultraButton1_Click(object sender, EventArgs e)
  77. {
  78. string heatno = this.LH_TEXT.Text.ToString().Trim();
  79. string flag = "0";
  80. MilHotCheckEntity Hot_check = new MilHotCheckEntity();
  81. Hot_check.JudgeStoveNo = LH_TEXT.Text;
  82. Hot_check.Steel = GJ_TEXT.Text;
  83. Hot_check.SeralNum = BH_TEXT.Text;
  84. Hot_check.Kidn = PZ_TEXT.Text;
  85. Hot_check.Grade = GZ_TEXT.Text;
  86. Hot_check.Inspector = JY_TEXT.Text;
  87. Hot_check.Standard = PZ_TEXT.Text;
  88. Hot_check.PipeSize = GG_TEXT.Text;
  89. Hot_check.Remark = textBox11.Text;
  90. MilHotCheckDetailEntity Hot_check_detail0 = new MilHotCheckDetailEntity();
  91. MilHotCheckDetailEntity Hot_check_detail1 = new MilHotCheckDetailEntity();
  92. MilHotCheckDetailEntity Hot_check_detail2 = new MilHotCheckDetailEntity();
  93. Hot_check_detail0=NativeMethod.GetUltraGridToEntity(this.ultraGrid1,Hot_check_detail0,0);
  94. Hot_check_detail1=NativeMethod.GetUltraGridToEntity(this.ultraGrid1,Hot_check_detail1,1);
  95. Hot_check_detail2=NativeMethod.GetUltraGridToEntity(this.ultraGrid1,Hot_check_detail2,2);
  96. Hot_check_detail0.PipeLocation = "0";
  97. Hot_check_detail1.PipeLocation = "1";
  98. Hot_check_detail2.PipeLocation = "2";
  99. DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmHotCheck.CheckHotCheck", new object[] { heatno }, this.ob);
  100. if (dt.Rows.Count > 0)
  101. {
  102. flag="1";
  103. }
  104. int count =ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmHotCheck.UpdateMilHot",new object[] {Hot_check,Hot_check_detail0,Hot_check_detail1,Hot_check_detail2,flag},this.ob);
  105. //ServerHelper.SetData("com.steering.mes.fpr[]ecall.corefprecall.tb", new object[] { list }, ob);
  106. //MessageUtil.ShowTips("提交成功!");
  107. }
  108. }
  109. }