FrmYieldInOutputQuery.cs 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Windows.Forms;
  4. using Core.Mes.Client.Comm.Control;
  5. using Core.Mes.Client.Comm.Tool;
  6. using Core.StlMes.Client.PlnSaleOrd.PopupWindow;
  7. using CoreFS.CA06;
  8. using Infragistics.Win.UltraWinGrid;
  9. using Core.StlMes.Client.PlnSaleOrd.Entity;
  10. namespace Core.StlMes.Client.PlnSaleOrd
  11. {
  12. public partial class FrmYieldInOutputQuery : FrmBase
  13. {
  14. public FrmYieldInOutputQuery()
  15. {
  16. InitializeComponent();
  17. this.IsLoadUserView = true;
  18. }
  19. public override void ToolBar_Click(object sender, string ToolbarKey)
  20. {
  21. switch (ToolbarKey)
  22. {
  23. case "Query":
  24. Query();
  25. break;
  26. case "Export":
  27. GridHelper.ulGridToExcel(ugData, "产量投入产出价格信息", true);
  28. break;
  29. case "Close":
  30. Close();
  31. break;
  32. }
  33. }
  34. protected override void OnLoad(EventArgs e)
  35. {
  36. base.OnLoad(e);
  37. EntityHelper.ShowGridCaption<QcmZgJugdeApplyEntity>(ugData.DisplayLayout.Bands[0]);
  38. GridHelper.SetAllColumnsActive(ugData);
  39. }
  40. private void Query()
  41. {
  42. var Message = "";
  43. var wf = new WaitingForm2("正在查询,请稍候....");
  44. try
  45. {
  46. Cursor = Cursors.WaitCursor;
  47. var dic = new Dictionary<string, object>();
  48. if (chkTim.Checked)
  49. {
  50. dic.Add("time", DateTime.Parse(txtMonth.Value.ToString()).ToString("yyyyMM"));
  51. }
  52. if (chkCarNo.Checked)
  53. dic.Add("judgeStoveNo", txtNo.Text);
  54. //dic.Add("validflag", new List<string>() { "1" });
  55. QueryBS.DataSource = EntityHelper.GetData<QcmZgJugdeApplyEntity>(
  56. "com.steering.pss.plnsaleord.report.FrmYieldInOutputQuery.doQuery",
  57. new object[] { dic },
  58. ob);
  59. GridHelper.RefreshAndAutoSizeExceptColumns(ugData, "");
  60. }
  61. catch (Exception ex)
  62. {
  63. if (ex.Message.ToString2() != "")
  64. Message = ex.Message;
  65. }
  66. finally
  67. {
  68. wf.Close();
  69. Cursor = Cursors.Default;
  70. }
  71. if (!string.IsNullOrWhiteSpace(Message))
  72. MessageBox.Show(Message);
  73. }
  74. }
  75. }