using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using Infragistics.Win.UltraWinGrid; using CoreFS.CA06; using Infragistics.Win; using Core.Mes.Client.Comm.Server; using Core.Mes.Client.Comm.Control; using Core.Mes.Client.Comm.Tool; namespace Core.StlMes.Client.BuyBillet { public partial class FrmJGSC : FrmBase { public FrmJGSC() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { Query(); } //重写按钮查询方法 public override void ToolBar_Click(object sender, string ToolbarKey) { base.ToolBar_Click(sender, ToolbarKey); switch (ToolbarKey) { case "doQuery": Query(); break; } } //查询 private void Query() { ultraGrid1_bind(); } //gridbind方法 private void ultraGrid1_bind() { DataTable dt = new DataTable(); DateTime dtime = ultraDateTimeEditor1.DateTime; //本月第一天时间 DateTime dt_First = dtime.AddDays(-(dtime.Day) + 1); //将本月月数+1 DateTime dtime2 = dtime.AddMonths(1); //本月最后一天时间 DateTime dt_Last = dtime2.AddDays(-(dtime.Day)); string year1 = dt_First.ToString("yyyy-MM-dd hh:mm:ss"); string year2 = dt_Last.ToString("yyyy-MM-dd")+" 23:59:59"; dt = ServerHelper.GetData("com.steering.pss.buybillet.Buybillet.get_FrmJGSC_All", new object[] { year1, year2 }, this.ob); // dt = ServerHelper.GetData("com.steering.pss.indvprod.IndvProd.get_FrmIndvProd_All", new object[] { year1, year2 }, this.ob); //生成列 GridHelper.CopyDataToDatatable(ref dt, ref dataTable1, true); //DataColumn colum; //string[] myArray = new string[5] { "应用代金券", "换工具", "实用代金券", "产量合计", "代金券盈亏" }; //for (int i = 0; i < myArray.Length; i++) //{ // colum = new DataColumn(); // colum.DataType = System.Type.GetType("System.String"); // colum.ColumnName = myArray[i].ToString(); // dt.Columns.Add(colum); //} //this.ultraGrid1.DataSource = dt; } } }