170 lines
4.2 KiB
C#
170 lines
4.2 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 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<RKReportModel> listRKReportModel = new List<RKReportModel>();//入库报表集合
|
|||
|
|
private RKReportModel RKReport = new RKReportModel();
|
|||
|
|
|
|||
|
|
public FrmRKReport()
|
|||
|
|
{
|
|||
|
|
InitializeComponent();
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void FrmRKReport_Load(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
Refresh();
|
|||
|
|
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 绑定数据
|
|||
|
|
/// </summary>
|
|||
|
|
private void bindGrid(RKReportModel model)
|
|||
|
|
{
|
|||
|
|
string errText = string.Empty;
|
|||
|
|
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
listRKReportModel = IBussFactory<BussRKReport>.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<BussRKReport>.Instance().GetReport2(date1, date2);
|
|||
|
|
|
|||
|
|
List<RKReportModel> list = IBussFactory<BussRKReport>.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;
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 清空
|
|||
|
|
/// </summary>
|
|||
|
|
public override void Clear()
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
dateEdit1.DateTime = DateTime.MinValue;
|
|||
|
|
dateEdit2.DateTime = DateTime.MinValue;
|
|||
|
|
|
|||
|
|
RKReport = new RKReportModel();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 刷新
|
|||
|
|
/// </summary>
|
|||
|
|
public override void Refresh()
|
|||
|
|
{
|
|||
|
|
RKReport = new RKReportModel();
|
|||
|
|
|
|||
|
|
dateEdit1.DateTime = DateTime.Now.Date.AddDays(-7);
|
|||
|
|
dateEdit2.DateTime = DateTime.Now;
|
|||
|
|
|
|||
|
|
Search();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 查询
|
|||
|
|
/// </summary>
|
|||
|
|
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());
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 导出
|
|||
|
|
/// </summary>
|
|||
|
|
public void Export()
|
|||
|
|
{
|
|||
|
|
gridControlCustom1.ShowExportDialog();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 打印
|
|||
|
|
/// </summary>
|
|||
|
|
public void PrintBarCode()
|
|||
|
|
{
|
|||
|
|
gridControlCustom1.ShowPrintPreview();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void dateEdit1_EditValueChanged(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|