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 WMS.Common; using WMS.Model.Report; using WMS.Frm.Base; using WMS.Model.Base; using WMS.Business; using WMS.Business.Base; using WMS.Business.Report; namespace WMS.FrmReport { public partial class FrmRKReport : FormBase { private List listRKReportModel = new List();//入库报表集合 private RKReportModel RKReport = new RKReportModel(); public FrmRKReport() { InitializeComponent(); } private void FrmRKReport_Load(object sender, EventArgs e) { Refresh(); } /// /// 绑定数据 /// private void bindGrid(RKReportModel model) { string errText = string.Empty; try { listRKReportModel = IBussFactory.Instance().GetReport(model); if (errText == string.Empty) { bgcRKData.DataSource = listRKReportModel; gdvStorage.RefreshData(); } else { SystemCommon.ShowInfoMessageBox(errText); } } catch (Exception) { SystemCommon.ShowInfoMessageBox("未知错误,请检查网络连接!如仍无法解决问题请联系我们!"); } if (errText == string.Empty && listRKReportModel.Count > 0) { DateTime minDate = RKReport.ONDATE; DateTime maxDate = RKReport.ONDATE; } } private void bindGrid2(string date1,string date2) { string errText = string.Empty; try { //DataTable ds= IBussFactory.Instance().GetReport2(date1, date2); List list = IBussFactory.Instance().GetReport2(date1, date2); bgcRKData.DataSource = list; gdvStorage.RefreshData(); } catch (Exception) { SystemCommon.ShowInfoMessageBox("未知错误,请检查网络连接!如仍无法解决问题请联系我们!"); } if (errText == string.Empty && listRKReportModel.Count > 0) { DateTime minDate = RKReport.ONDATE; DateTime maxDate = RKReport.ONDATE; } } /// /// 清空 /// public override void Clear() { dateEdit1.DateTime = DateTime.MinValue; dateEdit2.DateTime = DateTime.MinValue; RKReport = new RKReportModel(); } /// /// 刷新 /// public override void Refresh() { RKReport = new RKReportModel(); dateEdit1.DateTime = DateTime.Now.Date.AddDays(-7); dateEdit2.DateTime = DateTime.Now; Search(); } /// /// 查询 /// public override void Search() { if (RKReport.ONDATE > RKReport.ONDATE) { SystemCommon.ShowInfoMessageBox("起始日期不能大于结束日期"); return; } //System.DateTime.Now.AddDays(-7).ToString(), System.DateTime.Now.ToString() // bindGrid(RKReport); bindGrid2(dateEdit1.DateTime.ToString(), dateEdit2.DateTime.ToString()); } /// /// 导出 /// public void Export() { gridControlCustom1.ShowExportDialog(); } /// /// 打印 /// public void PrintBarCode() { gridControlCustom1.ShowPrintPreview(); } private void dateEdit1_EditValueChanged(object sender, EventArgs e) { } } }