OQC_PlanMaintain_NEW.cs 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Data;
  4. using System.Drawing;
  5. using System.Text;
  6. using System.Windows.Forms;
  7. using UAS_MES_NEW.DataOperate;
  8. using UAS_MES_NEW.Entity;
  9. using UAS_MES_NEW.PublicMethod;
  10. namespace UAS_MES_NEW.OQC
  11. {
  12. public partial class OQC_PlanMaintain_NEW : Form
  13. {
  14. AutoSizeFormClass asc = new AutoSizeFormClass();
  15. LogStringBuilder sql = new LogStringBuilder();
  16. DataTable dt;
  17. DataHelper dh;
  18. string ErrorMessage = "";
  19. DataTable Dbfind;
  20. public OQC_PlanMaintain_NEW()
  21. {
  22. InitializeComponent();
  23. }
  24. private void 抽样计划维护_Load(object sender, EventArgs e)
  25. {
  26. asc.controllInitializeSize(this);
  27. dh = SystemInf.dh;
  28. pr_code.TableName = "QUA_Project";
  29. pr_code.SelectField = "pr_code # 方案编号,pr_name # 方案名称,pr_class # 检验单类型,pr_standard # 方案标准,pr_startdate # 生效日期,pr_enddate #失效日期 ,pr_status # 状态";
  30. pr_code.SetValueField = new string[] { "pr_code" };
  31. pr_code.FormName = Name;
  32. pr_code.DbChange += Pr_code_DbChange;
  33. ChooseAll.ChooseAll(CheckTypeDGV);
  34. }
  35. private void Pr_code_DbChange(object sender, EventArgs e)
  36. {
  37. Dbfind = pr_code.ReturnData;
  38. BaseUtil.SetFormValue(this.Controls, Dbfind);
  39. }
  40. private void 抽样计划维护_SizeChanged(object sender, EventArgs e)
  41. {
  42. asc.controlAutoSize(this);
  43. }
  44. /// <summary>
  45. /// 获取批次点击按钮
  46. /// </summary>
  47. /// <param name="sender"></param>
  48. /// <param name="e"></param>
  49. private void SaveConfiguration_Click(object sender, EventArgs e)
  50. {
  51. }
  52. private void Save_Click(object sender, EventArgs e)
  53. {
  54. }
  55. private void Clean_Click(object sender, EventArgs e)
  56. {
  57. OperateResult.Clear();
  58. }
  59. private void ob_projectcode_UserControlTextChanged(object sender, EventArgs e)
  60. {
  61. sql.Clear();
  62. sql.Append("select nvl(max(oi_id),0)oi_id,ci_kind,nvl(max(oi_sampleqty),0) oi_sampleqty from QUA_PROJECT left join ");
  63. sql.Append(" QUA_ProjectDetail on pd_prid=pr_id left join QUA_CheckItem on pd_ciid=ci_id ");
  64. sql.Append("left join OQCITEMS on oi_checkno ='' and oi_projectcode='" + pr_code.Text + "' ");
  65. sql.Append("and oi_projectcode = pr_code and oi_checkkind = ci_kind where pr_code='" + pr_code.Text + "' group by ci_kind");
  66. DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
  67. BaseUtil.FillDgvWithDataTable(CheckTypeDGV, dt);
  68. }
  69. private void OQC_PlanMaintain_FormClosing(object sender, FormClosingEventArgs e)
  70. {
  71. dh.Dispose();
  72. }
  73. private void ms_sncode_KeyDown(object sender, KeyEventArgs e)
  74. {
  75. if (Keys.Enter == e.KeyCode)
  76. {
  77. }
  78. }
  79. }
  80. }