using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Shapes; using System.IO; using System.Xml; using System.Data; using System.Reflection; namespace SiaSun.LMS.WPFClient.SYS { public partial class RECORD_SUMMARY : AvalonDock.DocumentContent { public RECORD_SUMMARY() { InitializeComponent(); } private void DocumentContent_Loaded(object sender, RoutedEventArgs e) { this.dtpStart.SelectedDate = DateTime.Now; this.dtpEnd.SelectedDate = DateTime.Now; this.dgRecordSummary.U_WindowName = this.GetType().Name; this.dgRecordSummary.U_TableName = "RECORD_SUMMARY"; this.dgRecordSummary.U_XmlTableName = "RECORD_SUMMARY"; this.dgRecordSummary.U_OrderField = "GOODS_NAME"; this.dgRecordSummary.U_Where = "1<>1"; this.dgRecordSummary.U_AllowOperatData = false; this.dgRecordSummary.U_AllowChecked = false; this.dgRecordSummary.U_InitControl(); } private void WrapPanel_Click(object sender, RoutedEventArgs e) { Button btn = e.OriginalSource as Button; if (btn != null) { switch (btn.Name) { case "btnSearch": string sStart = string.Empty; string sEnd = string.Empty; if (this.dtpStart.SelectedDate.HasValue && this.dtpEnd.SelectedDate.HasValue) { sStart = this.dtpStart.SelectedDate.Value.ToString("yyyy-MM-dd 00:00:00"); sEnd = this.dtpEnd.SelectedDate.Value.ToString("yyyy-MM-dd 23:59:59"); } else { MainApp._MessageDialog.ShowResult(false, "请选择时间段"); return; } //DataTable dtQuantity = MainApp._I_BaseService.GetList(string.Format( // "select GOODS_NAME,(select count(0) as QUANTITY from V_RECORD_LIST where GOODS_ID=GOODS_MAIN.GOODS_ID and LEN(START_POSITION)=5 and LEN(END_POSITION)=8 and MANAGE_END_TIME>='{0}' and MANAGE_END_TIME<='{1}') as IN_QUANTITY,(select count(0) as QUANTITY from V_RECORD_LIST where GOODS_ID=GOODS_MAIN.GOODS_ID and LEN(START_POSITION)=8 and LEN(END_POSITION)=5 and MANAGE_END_TIME>='{0}' and MANAGE_END_TIME<='{1}') as OUT_QUANTITY from GOODS_MAIN order by GOODS_ORDER", // sStart, sEnd)); DataTable dtQuantity = MainApp._I_BaseService.GetList(string.Format( "select GOODS_NAME,GOODS_ORDER,(select count(0) as QUANTITY from V_RECORD_LIST where GOODS_ID=GOODS_MAIN.GOODS_ID and LEN(START_POSITION)=5 and LEN(END_POSITION)=8 and MANAGE_END_TIME>='{0}' and MANAGE_END_TIME<='{1}') as IN_QUANTITY,(select count(0) as QUANTITY from V_RECORD_LIST where GOODS_ID=GOODS_MAIN.GOODS_ID and LEN(START_POSITION)=8 and LEN(END_POSITION)=5 and MANAGE_END_TIME>='{0}' and MANAGE_END_TIME<='{1}') as OUT_QUANTITY from GOODS_MAIN " + "union all select USER_NAME as GOODS_NAME, 10 as GOODS_ORDER,(select count(0) as QUANTITY from V_RECORD_LIST where RECORD_OPERATOR=SYS_USER.USER_NAME and LEN(START_POSITION)=5 and LEN(END_POSITION)=8 and MANAGE_END_TIME>='{0}' and MANAGE_END_TIME<='{1}') as IN_QUANTITY,(select count(0) as QUANTITY from V_RECORD_LIST where RECORD_OPERATOR=SYS_USER.USER_NAME and LEN(START_POSITION)=8 and LEN(END_POSITION)=5 and MANAGE_END_TIME>='{0}' and MANAGE_END_TIME<='{1}') as OUT_QUANTITY from SYS_USER where USER_ID>0 order by GOODS_ORDER", sStart, sEnd)); this.dgRecordSummary.U_DataSource = dtQuantity.DefaultView; break; case "btnClear": this.dgRecordSummary.U_InitControl(); break; } } } } }