140 lines
3.8 KiB
C#
140 lines
3.8 KiB
C#
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(-7);
|
|
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(-7).ToString(), System.DateTime.Now.ToString());
|
|
|
|
}
|
|
|
|
|
|
#region 绑定数据
|
|
/// <summary>
|
|
/// 绑定数据
|
|
/// </summary>
|
|
/// <param name="model"></param>
|
|
private void BindData(CKReportModel model)
|
|
{
|
|
|
|
string str_list = "";
|
|
try
|
|
{
|
|
List<CKReportModel> list_CKReport = IBussFactory<BussCKReport>.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<CKReportModel> list = IBussFactory<BussCKReport>.Instance().GetReport2(date1, date2);
|
|
bs_Data.DataSource = list;
|
|
gdv_CKView.RefreshData();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
SystemCommon.ShowInfoMessageBox("网络连接错误!");
|
|
return;
|
|
}
|
|
|
|
}
|
|
|
|
#region 按钮
|
|
/// <summary>
|
|
/// 查询
|
|
/// </summary>
|
|
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
|
|
/// <summary>
|
|
/// 刷新
|
|
/// </summary>
|
|
public override void Refresh()
|
|
{
|
|
|
|
Search();
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 导出
|
|
/// </summary>
|
|
public void Export()
|
|
{
|
|
gdc_Ckdata.ShowExportDialog();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 打印
|
|
/// </summary>
|
|
public void PrintBarCode()
|
|
{
|
|
gdc_Ckdata.ShowPrintPreview();
|
|
}
|
|
}
|
|
}
|