Esempio n. 1
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            if(dateEdit1.EditValue==null)
            {
                XtraMessageBox.Show("Please enter the date ", "POS", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if(textEdit1.EditValue==null)
            {
                XtraMessageBox.Show("Please enter the initial amount ", "POS", MessageBoxButtons.OK, MessageBoxIcon.Information);
                textEdit1.Focus();
                return;
            }
            int ret = 0; //1 - OPENING CASH 2 - SALE VALUE 3 - COST VALUE 4 - TRANSFER AMOUNT 5 - END CASH
            var bl = new BlDailySales();
            var sprice = new BLReports().GetSumSprice();
            var cprice = new BLReports().GetSumCprice();
            var dtc = dateEdit1.DateTime;
            if(bl.DoSave(1,"Opening Cash",decimal.Parse(textEdit1.EditValue.ToString()),dtc,true)!=0)
            {
                ret = 1;
                if (bl.DoSave(2, "Opening Sprice", sprice, dtc, true) != 0)
                    bl.DoSave(3, "Opening Cprice", cprice, dtc, true); 
            }
            if (ret == 1)
                Close();
            else
                XtraMessageBox.Show("Data not saved contact to system administrator", "POS", MessageBoxButtons.OK,
                                    MessageBoxIcon.Information);



        }
Esempio n. 2
0
 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;
     }
 }