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.
114 lines
4.3 KiB
114 lines
4.3 KiB
3 years ago
|
using Stone.Common;
|
||
|
using Stone.Entity;
|
||
|
using System;
|
||
|
using System.Collections.Generic;
|
||
|
using System.ComponentModel;
|
||
|
using System.Data;
|
||
|
using System.Drawing;
|
||
|
using System.Text;
|
||
|
using System.Windows.Forms;
|
||
|
using Gm_WMS.DataAccess.DataService;
|
||
|
|
||
|
namespace Stone.WinModule.JISData
|
||
|
{
|
||
|
public partial class frmJISLAB_All_new : Stone.WinModule.frmBase
|
||
|
{
|
||
|
public frmJISLAB_All_new()
|
||
|
{
|
||
|
InitializeComponent();
|
||
|
|
||
|
this.txtStartDate1.Value = DateTime.Now;
|
||
|
this.txtStartDate2.Value = DateTime.Now.AddDays(10);
|
||
|
|
||
|
this.txtReleaseDate1.Value = DateTime.Now.AddDays(-7);
|
||
|
this.txtReleaseDate2.Value = DateTime.Now;
|
||
|
}
|
||
|
|
||
|
private void frmJISLABCompare_Load(object sender, EventArgs e)
|
||
|
{
|
||
|
|
||
|
}
|
||
|
|
||
|
private void txtPartNumber_OnSelectClick(object sender, EventArgs e)
|
||
|
{
|
||
|
try
|
||
|
{
|
||
|
Stone.WinModule.BasicData.frmProduct frm = new BasicData.frmProduct();
|
||
|
frm.m_Base = new WinBiz.BasicData.F_Product();
|
||
|
frm.init();
|
||
|
|
||
|
if (frm.ShowSelect("") == DialogResult.OK)
|
||
|
{
|
||
|
this.txtPartNumber.Text = frm.SelectValue;
|
||
|
}
|
||
|
frm.Dispose();
|
||
|
|
||
|
}
|
||
|
catch (Exception ex)
|
||
|
{
|
||
|
MyMessageBox.ShowErrorMessage(ex.Message);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
private void btnQuery_Click(object sender, EventArgs e)
|
||
|
{
|
||
|
try
|
||
|
{
|
||
|
string PartNumber = this.txtPartNumber.Text.Trim();
|
||
|
string StartDate1 = this.txtStartDate1.Value.ToString("yyyy-MM-dd");
|
||
|
string StartDate2 = this.txtStartDate2.Value.ToString("yyyy-MM-dd");
|
||
|
string ReleaseDate1 = this.txtReleaseDate1.Value.ToString("yyyy-MM-dd 00:00:00");
|
||
|
string ReleaseDate2 = this.txtReleaseDate2.Value.ToString("yyyy-MM-dd 23:59:59");
|
||
|
string ReleaseID1 = this.tbReleaseID1.Text.Trim();
|
||
|
string ReleaseID2 = this.tbReleaseID2.Text.Trim();
|
||
|
|
||
|
var strsql = "";
|
||
|
var strWhere = "";
|
||
|
var strOrderBy = "";
|
||
|
strsql = "select fileType as '工厂',partNumber as '零件号',Description as '零件描述',Variant as '车型',StartDate as '需求日期起'," +
|
||
|
"EndDate as '需求日期止',quantity as '需求数量',quantity_print as '发货数量',quantity_diff as '发货差异',cumulativeQuantity as '累计收货数量'," +
|
||
|
"releaseId as '版本号',IsStandard as '是否STD件',PackNumer as '包装数量',location as '卸货点',time as '发布日期'," +
|
||
|
"locationCode as '卸货点代码',orderNumber as '采购订单号',addtime as '解析时间',filename as '文件名'" +
|
||
|
" from v_JIS_Lab_All where 1 =1 ";
|
||
|
strOrderBy = " order by [releaseId] asc, [StartDate] asc";
|
||
|
strWhere += " and StartDate >= '" + StartDate1 + "'";
|
||
|
strWhere += " and StartDate <= '" + StartDate2 + "'";
|
||
|
strWhere += " and Time >= '" + ReleaseDate1 + "'";
|
||
|
strWhere += " and Time <= '" + ReleaseDate2 + "'";
|
||
|
if (!string.IsNullOrEmpty(PartNumber))
|
||
|
{
|
||
|
strWhere += " and PartNumber = '" + PartNumber + "'";
|
||
|
}
|
||
|
|
||
|
if (!string.IsNullOrEmpty(ReleaseID1))
|
||
|
{
|
||
|
strWhere += " and releaseId >= '" + ReleaseID1 + "'";
|
||
|
}
|
||
|
if (!string.IsNullOrEmpty(ReleaseID1))
|
||
|
{
|
||
|
strWhere += " and releaseId <= '" + ReleaseID2 + "'";
|
||
|
}
|
||
|
|
||
|
strsql += strWhere;
|
||
|
strsql += strOrderBy;
|
||
|
DataTable dtShow = new DataTable();
|
||
|
var db = new LocalDBService();
|
||
|
dtShow = db.Exec_DataSet(strsql).Tables[0];
|
||
|
|
||
|
this.dgrdView.DataSource = dtShow;
|
||
|
|
||
|
this.lblState.Text = "记录:" + dtShow.Rows.Count;
|
||
|
}
|
||
|
catch (Exception ex)
|
||
|
{
|
||
|
MyMessageBox.ShowErrorMessage(ex.Message);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
private void btnExport_Click(object sender, EventArgs e)
|
||
|
{
|
||
|
MyExport.ShowExport(this.dgrdView);
|
||
|
}
|
||
|
}
|
||
|
}
|