private void backgroundWorker_ShowData_DoWork(object sender, DoWorkEventArgs e) { this.BeginInvoke(new Action(() => { lbl_Status.Text = "Status : กำลังโหลดข้อมูลกรุณารอสักครู่...."; btn_Search.Enabled = false; btn_Close.Enabled = false; })); this.BeginInvoke(new Action(() => { SplashScreenManager.ShowForm(this, typeof(Frm_WaitProcess), true, true, false); })); using (var srv = new StockTranferArInvoiceService(Utility.ConnSDB)) { DateTime DtpStart = dtp_Tranfer.DateTime.Date; DateTime DtpEnd = dtp_TranferEnd.DateTime.Date; bool UserDate = chk_DateCurrent.Checked; List <int> Status = new List <int>(); if (ck_0.Checked) { Status.Add(0); } if (Ck_1.Checked) { Status.Add(1); } if (ck_2.Checked) { Status.Add(2); } Item_TranAll = srv.LoadAll(DtpStart, DtpEnd, UserDate, Status); } }
private void Fn_LoadDataTran() { lbl_status.BeginInvoke(new MethodInvoker(delegate { lbl_status.Text = "Status : กำลังโหลดข้อมูลกรุณารอสักครู่.......";; })); using (var srv = new BcArInvoiceSubService(Utility.ConnSDB)) { string[] WhCode = Utility._SettingWarehouseValue.Split(';'); // new string[] { "02", "03" }; DateTime DtpStart = dtp_Tranfer.DateTime.Date; DateTime DtpEnd = dtp_Tranfer.DateTime.Date; bool UseDate = chk_DateCurrent.Checked; Item_Result = srv.LoadAllForTranferByDate(DtpStart, DtpEnd, UseDate, WhCode); //srv.LoadAllForTranfer(WhCode); //srv.LoadAllForTranferShow("02"); } using (var srv = new StockTranferArInvoiceService(Utility.ConnSDB)) { Item_TranComplete = srv.LoadAll(); } }