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 DevExpress.XtraCharts; using WMS.Frm.Base; using WMS.Common; using WMS.Model.Report; using WMS.Model.Base; using WMS.Business.Report; using WMS.Business; namespace WMS.FrmReport { public partial class FrmCKReport : FormBase { CKReportModel ck_mdoel = new CKReportModel(); public FrmCKReport() { InitializeComponent(); } private void ForCK_Load(object sender, EventArgs e) { dt_End.DateTime = System.DateTime.Now; dt_Start.DateTime = System.DateTime.Now.AddDays(-3); ck_mdoel.StartDateTime = System.DateTime.Now.AddDays(-1); ck_mdoel.EndDateTime = System.DateTime.Now; //ck_mdoel.Storage_id = userData.STORAGE_ID; // BindData(ck_mdoel); BindData2(System.DateTime.Now.AddDays(-3).ToString(), System.DateTime.Now.ToString()); } #region 绑定数据 /// /// 绑定数据 /// /// private void BindData(CKReportModel model) { string str_list = ""; try { List list_CKReport = IBussFactory.Instance().GetReport(model); if (list_CKReport == null || list_CKReport.Count == 0) { return; } bs_Data.DataSource = list_CKReport; gdv_CKView.RefreshData(); } catch (Exception ex) { SystemCommon.ShowInfoMessageBox("网络连接错误!"); return; } } #endregion private void BindData2(string date1,string date2) { try { List list = IBussFactory.Instance().GetReport2(date1, date2); bs_Data.DataSource = list; //gdv_CKView.RefreshData(); } catch (Exception ex) { SystemCommon.ShowInfoMessageBox("网络连接错误!"); return; } } #region 按钮 /// /// 查询 /// public void Search() { if (dt_Start.DateTime > System.DateTime.Now) { SystemCommon.ShowInfoMessageBox("起始时间不应大于当前时间"); dt_Start.DateTime = System.DateTime.Now; return; } if (dt_Start.DateTime > dt_End.DateTime) { SystemCommon.ShowInfoMessageBox("起始时间不应小于结束时间"); dt_Start.DateTime = dt_End.DateTime.AddDays(-1); return; } // BindData(ctr_Goods.TextBoxValue, dateEdit1.DateTime, dateEdit2.DateTime); ck_mdoel = new CKReportModel(); ck_mdoel.StartDateTime = dt_Start.DateTime; ck_mdoel.EndDateTime = dt_End.DateTime; //BindData(ck_mdoel); BindData2(dt_Start.DateTime.ToString(), dt_End.DateTime.ToString()); } #endregion /// /// 刷新 /// public override void Refresh() { Search(); } /// /// 导出 /// public void Export() { gdc_Ckdata.ShowExportDialog(); } /// /// 打印 /// public void PrintBarCode() { gdc_Ckdata.ShowPrintPreview(); } } }