You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
100 lines
2.5 KiB
100 lines
2.5 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
using Stone.Common;
|
|
using Gm_WMS.DataAccess.DataService;
|
|
|
|
namespace Stone.WinModule.Report
|
|
{
|
|
public partial class frmReport2 : Stone.WinModule.frmBase
|
|
{
|
|
private LocalDBService db = null;
|
|
public frmReport2()
|
|
{
|
|
InitializeComponent();
|
|
|
|
db = new LocalDBService();
|
|
|
|
this.txtD1.Value = DateTime.Now.AddMonths(-1);
|
|
}
|
|
|
|
private void frmReport1_Load(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
UpdateGrid();
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MyMessageBox.ShowErrorMessage(ex.Message);
|
|
}
|
|
}
|
|
|
|
private void tlbRefresh_Click(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
UpdateGrid();
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MyMessageBox.ShowErrorMessage(ex.Message);
|
|
}
|
|
}
|
|
|
|
private void tlbOutPut_Click(object sender, EventArgs e)
|
|
{
|
|
MyExport.ShowExport(this.dgrdView);
|
|
}
|
|
|
|
private void tlbExit_Click(object sender, EventArgs e)
|
|
{
|
|
this.Close();
|
|
}
|
|
|
|
private void btnSerach_Click(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
UpdateGrid();
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MyMessageBox.ShowErrorMessage(ex.Message);
|
|
}
|
|
}
|
|
|
|
private void UpdateGrid()
|
|
{
|
|
string sql = @"
|
|
select CONVERT(varchar(100), AddTime, 23) as Date, ISNULL(SUM(Qty), 0) as Qty from t_BarCode
|
|
WHERE [AddTime] >= '{0}' and [AddTime] <= '{1}'
|
|
group by CONVERT(varchar(100), AddTime, 23)
|
|
order by [Date] asc
|
|
";
|
|
|
|
string d1 = this.txtD1.Value.ToString("yyyy-MM-dd 00:00:00");
|
|
string d2 = this.txtD2.Value.ToString("yyyy-MM-dd 23:59:59");
|
|
|
|
sql = string.Format(sql, d1, d2);
|
|
|
|
DataTable dtData = db.Exec_DataSet(sql).Tables[0];
|
|
|
|
this.dgrdView.DataSource = dtData;
|
|
this.dgrdView.Columns["Date"].HeaderText = "日期";
|
|
this.dgrdView.Columns["Qty"].HeaderText = "数量";
|
|
|
|
|
|
this.lblStateRecord.Text = "记录数:" + dtData.Rows.Count;
|
|
|
|
MyGridViewStyle.SetDataGridMenuCommon(this.dgrdView);
|
|
}
|
|
}
|
|
}
|
|
|