using ClientLib; using ClientLib.CommonService2; using DevExpress.XtraEditors; using DevExpress.XtraTreeList; using DevExpress.XtraTreeList.Nodes; using PublicLib; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.IO; using System.Linq; using System.Text; using System.Windows.Forms; namespace HANMI_J_SALE { public partial class SalesTotalManager : CommonMDI { public SalesTotalManager() { InitializeComponent(); dateEdit_SDATE.DateTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1); dateEdit_FDATE.DateTime = dateEdit_SDATE.DateTime.AddMonths(1).AddDays(-1); this.Shown += (sender, e) => { searchProc(); }; this.simpleButton_PREV_DATE.Click += (sender, e) => { DateTime BaseDate = dateEdit_SDATE.DateTime; DateTime MonthLastDate = BaseDate.AddDays(0 - BaseDate.Day); DateTime MonthFirstDate = MonthLastDate.AddDays(1 - MonthLastDate.Day); dateEdit_SDATE.DateTime = MonthFirstDate; dateEdit_FDATE.DateTime = MonthLastDate; searchProc(); }; this.simpleButton_NEXT_DATE.Click += (sender, e) => { DateTime BaseDate = dateEdit_FDATE.DateTime.AddDays(1); DateTime MonthFirstDate = BaseDate.AddDays(1 - BaseDate.Day); DateTime MonthLastDate = MonthFirstDate.AddMonths(1).AddDays(-1); dateEdit_SDATE.DateTime = MonthFirstDate; dateEdit_FDATE.DateTime = MonthLastDate; searchProc(); }; } public override void searchProc() { try { this.Cursor = Cursors.WaitCursor; gridControl_Main.DataSource = null; SerializedSqlParam[] aParam = new SerializedSqlParam[] { ClientClass.CreateSqlParameter("COMP_CD", SqlDbType.NVarChar, ConstClass._COMP_CD), ClientClass.CreateSqlParameter("SDATE", SqlDbType.NVarChar, dateEdit_SDATE.DateTime.ToString("yyyy.MM.dd")), ClientClass.CreateSqlParameter("FDATE", SqlDbType.NVarChar, dateEdit_FDATE.DateTime.ToString("yyyy.MM.dd")), ClientClass.CreateSqlParameter("TYPE", SqlDbType.Int, checkEdit_ITEM_NM.Checked ? 0 : 1), }; ResultData result = ClientClass.GetData("GetSaleTotalManager", aParam); if (result.isError) { throw new Exception(result.ResultValue); } gridControl_Main.DataSource = result.TableData; this.Cursor = Cursors.Arrow; } catch (Exception ex) { this.Cursor = Cursors.Arrow; MessageBox.Show(ex.Message); } } public override void newProc() { } public override void deleteProc() { } public override void saveProc() { } public override void printProc() { } public override void excelProc() { this.ExportExcelGrid(gridControl_Main); } private void checkEdit_ITEM_NM_CheckedChanged(object sender, EventArgs e) { searchProc(); } } }