コード例 #1
0
        protected void GrdCashoutByDate_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            //Collects current method and page for error tracking
            string method = "GrdCashoutByDate_RowCommand";

            object[] objPageDetails = { Session["currPage"].ToString(), method };
            try
            {
                if (e.CommandName == "EditCashout")
                {
                    string arg        = e.CommandArgument.ToString();
                    var    nameValues = HttpUtility.ParseQueryString(Request.QueryString.ToString());
                    nameValues.Set("selectedDate", arg.Split(' ')[0]);
                    nameValues.Set("location", arg.Split(' ')[1]);
                    //Changes to the Reports Cash Out page
                    Response.Redirect("SalesCashOut.aspx?" + nameValues, false);
                }
                else if (e.CommandName == "FinalizeCashout")
                {
                    R.CallFinalizeCashout(e.CommandArgument.ToString(), objPageDetails);
                    object[]   passing     = (object[])Session["reportInfo"];
                    DateTime[] reportDates = (DateTime[])passing[0];
                    DateTime   startDate   = reportDates[0];
                    DateTime   endDate     = reportDates[1];
                    int        locationID  = Convert.ToInt32(passing[1]);
                    dt = R.CallReturnCashoutsForSelectedDates(passing, objPageDetails);
                    GrdCashoutByDate.DataSource = dt;
                    GrdCashoutByDate.DataBind();
                }
            }
            //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);
            }
        }