示例#1
0
        protected void BtnProcessReport_Click(object sender, EventArgs e)
        {
            //Collects current method for error tracking
            string method = "BtnProcessReport_Click";

            object[] objPageDetails = { Session["currPage"].ToString(), method };
            try
            {
                CalculteMethod();
                object[] args    = { DateTime.Parse(Request.QueryString["selectedDate"].ToString()), Convert.ToInt32(Request.QueryString["location"].ToString()) };
                Cashout  cashout = R.CallSelectedCashoutToReturn(args, objPageDetails);

                //Creates new cashout
                cashout.fltManuallyCountedBasedOnReceiptsTradeIn    = Convert.ToDouble(txtTradeIn.Text);
                cashout.fltManuallyCountedBasedOnReceiptsGiftCard   = Convert.ToDouble(txtGiftCard.Text);
                cashout.fltManuallyCountedBasedOnReceiptsCash       = Convert.ToDouble(txtCash.Text);
                cashout.fltManuallyCountedBasedOnReceiptsDebit      = Convert.ToDouble(txtDebit.Text);
                cashout.fltManuallyCountedBasedOnReceiptsMastercard = Convert.ToDouble(txtMasterCard.Text);
                cashout.fltManuallyCountedBasedOnReceiptsVisa       = Convert.ToDouble(txtVisa.Text);
                cashout.fltCashDrawerOverShort = double.Parse(lblOverShortFinal.Text, NumberStyles.Currency);
                cashout.bitIsCashoutProcessed  = true;
                cashout.bitIsCashoutFinalized  = false;
                cashout.intEmployeeID          = CU.employee.intEmployeeID;

                R.CallUpdateCashout(cashout, objPageDetails);

                MessageBoxCustom.ShowMessage("Cashout has been processed", this);
                btnPrint.Enabled         = true;
                BtnProcessReport.Enabled = false;
            }
            //Exception catch
            catch (ThreadAbortException tae) { }
            catch (Exception ex)
            {
                //Log all info into error table
                ER.CallLogError(ex, CU.employee.intEmployeeID, Convert.ToString(Session["currPage"]) + "-V3.2", method, this);
                //Display message box
                MessageBoxCustom.ShowMessage("An Error has occurred and been logged. "
                                             + "If you continue to receive this message please contact "
                                             + "your system administrator.", this);
            }
        }