FrmYdmGpInitialManage.cs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. using Core.Mes.Client.Comm.Control;
  2. using Core.Mes.Client.Comm.Format;
  3. using Core.Mes.Client.Comm.Tool;
  4. using Core.StlMes.Client.YdmStuffManage.Entity;
  5. using CoreFS.CA06;
  6. using Infragistics.Win.UltraWinGrid;
  7. using System;
  8. using System.Collections;
  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.YdmStuffManage
  17. {
  18. public partial class FrmYdmGpInitialManage : FrmBase
  19. {
  20. public FrmYdmGpInitialManage()
  21. {
  22. InitializeComponent();
  23. }
  24. private void FrmYdmGpInitialManage_Load(object sender, EventArgs e)
  25. {
  26. DateTime d1 = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
  27. this.StartTime.Value = DateTime.Parse(DateTime.Now.ToString("yyyy-MM"));
  28. EntityHelper.ShowGridCaption<YdmGpInitialEntity>(ultraGrid1.DisplayLayout.Bands[0]);
  29. }
  30. public override void ToolBar_Click(object sender, string ToolbarKey)
  31. {
  32. switch (ToolbarKey)
  33. {
  34. case "Query":
  35. doQuery();
  36. break;
  37. case "Export":
  38. exportData();
  39. break;
  40. case "Close":
  41. this.Close();
  42. break;
  43. }
  44. }
  45. /// <summary>
  46. /// 查询
  47. /// </summary>
  48. private void doQuery()
  49. {
  50. string bathYear = "";
  51. string judgeNo = "";
  52. string belongCode = "";
  53. if (this.chkTim.Checked)
  54. {
  55. bathYear = this.StartTime.Value.ToString("yyyyMM");
  56. }
  57. if (this.chkJugeHeatNo.Checked && this.txtJugeNo.Text.Trim() != "")
  58. {
  59. judgeNo = this.txtJugeNo.Text.Trim();
  60. }
  61. //if (this.chkBelong.Checked && this.cmbBelong.Text != "")
  62. //{
  63. // belongCode = this.cmbBelong.Value.ToString();
  64. //}
  65. ArrayList parmList = new ArrayList();
  66. parmList.Add(bathYear);
  67. parmList.Add(judgeNo);
  68. parmList.Add(belongCode);
  69. List<YdmGpInitialEntity> listSource = EntityHelper.GetData<YdmGpInitialEntity>(
  70. "Core.LgMes.Server.Stuffmanage.FrmYdmGpInitialManage.doQuery", new object[] { parmList }, this.ob);
  71. bindingSource2.DataSource = listSource;
  72. }
  73. /// <summary>
  74. /// 导出
  75. /// </summary>
  76. private void exportData()
  77. {
  78. GridHelper.ulGridToExcel(ultraGrid1, "管坯期初数据");
  79. }
  80. private void chkJugeHeatNo_CheckedChanged(object sender, EventArgs e)
  81. {
  82. this.txtJugeNo.Enabled = this.chkJugeHeatNo.Checked;
  83. }
  84. private void chkTim_CheckedChanged(object sender, EventArgs e)
  85. {
  86. this.StartTime.Enabled = this.chkTim.Checked;
  87. }
  88. }
  89. }