FrmJGSC.cs 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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 System.Windows.Forms;
  9. using Infragistics.Win.UltraWinGrid;
  10. using CoreFS.CA06;
  11. using Infragistics.Win;
  12. using Core.Mes.Client.Comm.Server;
  13. using Core.Mes.Client.Comm.Control;
  14. using Core.Mes.Client.Comm.Tool;
  15. namespace Core.StlMes.Client.BuyBillet
  16. {
  17. public partial class FrmJGSC : FrmBase
  18. {
  19. public FrmJGSC()
  20. {
  21. InitializeComponent();
  22. }
  23. private void Form1_Load(object sender, EventArgs e)
  24. {
  25. Query();
  26. }
  27. //重写按钮查询方法
  28. public override void ToolBar_Click(object sender, string ToolbarKey)
  29. {
  30. base.ToolBar_Click(sender, ToolbarKey);
  31. switch (ToolbarKey)
  32. {
  33. case "doQuery":
  34. Query();
  35. break;
  36. }
  37. }
  38. //查询
  39. private void Query()
  40. {
  41. ultraGrid1_bind();
  42. }
  43. //gridbind方法
  44. private void ultraGrid1_bind()
  45. {
  46. DataTable dt = new DataTable();
  47. DateTime dtime = ultraDateTimeEditor1.DateTime;
  48. //本月第一天时间
  49. DateTime dt_First = dtime.AddDays(-(dtime.Day) + 1);
  50. //将本月月数+1
  51. DateTime dtime2 = dtime.AddMonths(1);
  52. //本月最后一天时间
  53. DateTime dt_Last = dtime2.AddDays(-(dtime.Day));
  54. string year1 = dt_First.ToString("yyyy-MM-dd hh:mm:ss");
  55. string year2 = dt_Last.ToString("yyyy-MM-dd")+" 23:59:59";
  56. dt = ServerHelper.GetData("com.steering.pss.buybillet.Buybillet.get_FrmJGSC_All", new object[] { year1, year2 }, this.ob);
  57. // dt = ServerHelper.GetData("com.steering.pss.indvprod.IndvProd.get_FrmIndvProd_All", new object[] { year1, year2 }, this.ob);
  58. //生成列
  59. GridHelper.CopyDataToDatatable(ref dt, ref dataTable1, true);
  60. //DataColumn colum;
  61. //string[] myArray = new string[5] { "应用代金券", "换工具", "实用代金券", "产量合计", "代金券盈亏" };
  62. //for (int i = 0; i < myArray.Length; i++)
  63. //{
  64. // colum = new DataColumn();
  65. // colum.DataType = System.Type.GetType("System.String");
  66. // colum.ColumnName = myArray[i].ToString();
  67. // dt.Columns.Add(colum);
  68. //}
  69. //this.ultraGrid1.DataSource = dt;
  70. }
  71. }
  72. }