FrmPlnOrderDownLog.cs 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. using Core.Mes.Client.Comm.Control;
  2. using Core.Mes.Client.Comm.Tool;
  3. using Core.StlMes.Client.PlnSaleOrd.BaseMethod;
  4. using Core.StlMes.Client.PlnSaleOrd.Entity;
  5. using CoreFS.CA06;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.ComponentModel;
  9. using System.Data;
  10. using System.Drawing;
  11. using System.Linq;
  12. using System.Text;
  13. using System.Windows.Forms;
  14. using Core.Mes.Client.Comm.Server;
  15. namespace Core.StlMes.Client.PlnSaleOrd
  16. {
  17. public partial class FrmPlnOrderDownLog : FrmBase
  18. {
  19. public FrmPlnOrderDownLog()
  20. {
  21. InitializeComponent();
  22. this.IsLoadUserView = true;
  23. }
  24. private void chc_CheckedChanged(object sender, EventArgs e)
  25. {
  26. if (chcTime.Checked) { timeBegin.ReadOnly = false; timeEnd.ReadOnly = false; } else { timeBegin.ReadOnly = true; timeEnd.ReadOnly = true; }
  27. if (chcVrsionNo.Checked) { txtVrsionNo.ReadOnly = false; } else { txtVrsionNo.ReadOnly = true; }
  28. if (chcOrderNo.Checked) { txtOrderNo.ReadOnly = false; } else { txtOrderNo.ReadOnly = true; }
  29. if (chcType.Checked) { txtType.ReadOnly = false; } else { txtType.ReadOnly = true; }
  30. if (chcOrdersource.Checked) { txtSource.ReadOnly = false; } else { txtSource.ReadOnly = true; }
  31. }
  32. private void FrmPlnOrderDownLog_Load(object sender, EventArgs e)
  33. {
  34. EntityHelper.ShowGridCaption<PlnOrderDownLogEntity>(ultraGridDownlog.DisplayLayout.Bands[0]);
  35. BaseHelper.setOtherColumnReadOnly(ultraGridDownlog,new string[]{""});
  36. BaseHelper.InitCellPosition(ultraGridDownlog, new string[] { "PlnDivideId", "OrderSeq", "DeliveryNo" });
  37. InitDate();
  38. }
  39. /// <summary>
  40. /// 初始时间
  41. /// </summary>
  42. private void InitDate()
  43. {
  44. timeBegin.Value = DateTime.Now.AddDays(-30);
  45. timeEnd.Value = DateTime.Now.AddDays(1).AddSeconds(-1);
  46. txtVrsionNo.Text = DateTime.Today.ToString("yyyyMMdd");
  47. }
  48. public override void ToolBar_Click(object sender, string ToolbarKey)
  49. {
  50. switch (ToolbarKey)
  51. {
  52. case "Query":
  53. Query();
  54. break;
  55. case "Export":
  56. GridHelper.ulGridToExcel(ultraGridExport, "合同下发及回退日志");
  57. break;
  58. case "Close":
  59. this.Close();
  60. break;
  61. default:
  62. break;
  63. }
  64. }
  65. void Query()
  66. {
  67. string beginTime = "";//开始时间
  68. string endTime = "";//结束时间
  69. if (chcTime.Checked && timeBegin.Value != null && timeEnd.Value != null)
  70. {
  71. beginTime = timeBegin.DateTime.ToString("yyyy-MM-dd") + " 0:0:0";
  72. endTime = timeEnd.DateTime.ToString("yyyy-MM-dd") + " 23:59:59";
  73. }
  74. string vrsionNo = "";//版次号
  75. if (chcVrsionNo.Checked) { vrsionNo = txtVrsionNo.Text.Trim(); }
  76. string orderno = "";//合同号
  77. if (chcOrderNo.Checked) { orderno = txtOrderNo.Text.Trim(); }
  78. string type = "";//类型
  79. if (chcType.Checked && txtType.Value != null) { type = txtType.Value.ToString(); }
  80. string ordersource = "";//合同来源
  81. if (chcOrdersource.Checked && txtSource.Value != null) { ordersource = txtSource.Value.ToString(); }
  82. //List<PlnOrderDownLogEntity> listSource = EntityHelper.GetData<PlnOrderDownLogEntity>
  83. // ("com.steering.pss.plnsaleord.FrmPlnOrderDownLog.queryOrderDownLog", new object[] { beginTime, endTime, vrsionNo, orderno, type, ordersource }, this.ob);
  84. //plnOrderDownLogEntityBindingSource.DataSource = listSource;
  85. DataTable dt = ServerHelper.GetData("com.steering.pss.plnsaleord.FrmPlnOrderDownLog.queryOrderDownLog", new object[] { beginTime, endTime, vrsionNo, orderno, type, ordersource }, this.ob);
  86. GridHelper.CopyDataToDatatable(dt, dataTable1, true);
  87. ///设置grid不可编辑
  88. PlanComm.setGridActivation(ultraGridExport.DisplayLayout.Bands[0]);
  89. PlanComm.setGridDigitalCol(ultraGridExport.DisplayLayout.Bands[0], 6, 3,
  90. "ORDER_QTY", "ORDERWEIGHT", "CONFIRM_WT_SUM", "Z_ORDERWEIGHT", "ZG_WT_MIN");
  91. PlanComm.setGridDigitalCol(ultraGridExport.DisplayLayout.Bands[0], 5, 2,
  92. "TOTLENGTH", "HEIGHT_YLG", "DIMATER_YLG", "AIMWALLTHICK_ZG");
  93. PlanComm.setGridDigitalCol(ultraGridExport.DisplayLayout.Bands[0], 5, 0,
  94. "Z_ORDERNUM");
  95. }
  96. }
  97. }