private void ShiftCode_FormClosed(object sender, FormClosedEventArgs e) { var bl = new BLSales(); if(!string.IsNullOrWhiteSpace(SCode)) bl.UpdateShitCode(SCode); }
void DoCloseSale() { if (!validateform()) { var bl = new BlDailySales(); var sprice = new BLReports().GetSumSprice(); var cprice = new BLReports().GetSumCprice(); int ret = 0; var f = new RptDailySalesReport {ClosingDifference = decimal.Parse(txtcashdiff.EditValue.ToString())}; f.LoadDailyReport(); f.watermark = "Closed"; //if ((DateTime.Now.TimeOfDay > new TimeSpan(0, 1, 0)) && (DateTime.Now.TimeOfDay <= new TimeSpan(2, 50, 0))) //{ // f.aMonth = dateEdit1.DateTime.AddDays(-1).ToShortTimeString(); //} //else //{ f.aMonth = dateEdit1.DateTime.ToShortDateString(); // } // f.Show(); f.CreateReport(); f.Hide(); simpleButton1.Enabled = false; var dtc = dateEdit1.DateTime; if (bl.DoSave(1, "Opening Cash", decimal.Parse(txtclosing.EditValue.ToString()), dtc) != 0) { var blP = new BLSales(); blP.UpdateShitCode(1.ToString()); if (bl.DoSave(2, "Opening Sprice", sprice, dtc) != 0) if (bl.DoSave(3, "Opening Cprice", cprice, dtc) != 0) if (decimal.Parse(txtcashtrans.EditValue.ToString()) > 0) bl.DoSave(4, "Transfer Amt", decimal.Parse(txtcashtrans.EditValue.ToString()), dtc); if (decimal.Parse(txtcashdiff.EditValue.ToString()) > 0) bl.DoSave(5, "Difference Amt", decimal.Parse(txtcashdiff.EditValue.ToString()), dtc); bl.DoSave(6, "Last Opening", decimal.Parse(txtlastclosing.EditValue.ToString()), dtc); new VIRETAILDAL.Masters.DailyClosing().CloseDailySales(dtc); } } else { simpleButton1.Enabled = true; } }