protected void OnRowDeleting(object sender, GridViewDeleteEventArgs e) { //Collects current method for error tracking string method = "OnRowDeleting"; object[] objPageDetails = { Session["currPage"].ToString(), method }; try { //Retrieves index of selected row int receiptPaymentID = Convert.ToInt32(((Label)gvCurrentMOPs.Rows[e.RowIndex].Cells[3].FindControl("lblTableID")).Text); InvoiceMOPsManager IMM = new InvoiceMOPsManager(); IMM.CallRemoveMopFromPurchaseList(receiptPaymentID, Convert.ToInt32(Request.QueryString["receipt"]), objPageDetails); gvCurrentMOPs.EditIndex = -1; UpdatePageTotals(); } //Exception catch catch (ThreadAbortException) { } catch (Exception ex) { //Log all info into error table ER.CallLogError(ex, CU.employee.intEmployeeID, Convert.ToString(Session["currPage"]), 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); } }
//Populating gridview with MOPs private void PopulateGridviewMOP(double amountPaid, int methodOfPayment, object[] amounts) { //Collects current method for error tracking string method = "populateGridviewMOP"; object[] objPageDetails = { Session["currPage"].ToString(), method }; try { InvoiceMOPsManager IMM = new InvoiceMOPsManager(); InvoiceMOPs invoicePayment = new InvoiceMOPs { intInvoiceID = Convert.ToInt32(Request.QueryString["invoice"].ToString()), intPaymentID = methodOfPayment, fltAmountPaid = amountPaid, fltTenderedAmount = Convert.ToDouble(amounts[0]), fltCustomerChange = Convert.ToDouble(amounts[1]) }; IMM.CallAddNewMopToList(invoicePayment, objPageDetails); UpdatePageTotals(); } //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); } }
protected void OnRowDeleting(object sender, GridViewDeleteEventArgs e) { //Collects current method for error tracking string method = "OnRowDeleting"; object[] objPageDetails = { Session["currPage"].ToString(), method }; try { //Gathers the mop info based on the index int mopRemovingID = Convert.ToInt32(((Label)gvCurrentMOPs.Rows[e.RowIndex].Cells[3].FindControl("mopID")).Text); //Retrieves Mop list from Session InvoiceMOPsManager IMM = new InvoiceMOPsManager(); IMM.CallRemoveMopFromList(mopRemovingID, objPageDetails); ////Clear the selected index gvCurrentMOPs.EditIndex = -1; UpdatePageTotals(); } //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); } }
//Populating gridview with MOPs protected void PopulateGridviewMOP(double amountPaid, int paymentID, int chequeNumber) { //Collects current method for error tracking string method = "PopulateGridviewMOP"; object[] objPageDetails = { Session["currPage"].ToString(), method }; try { if (amountPaid > 0) { amountPaid *= -1; } InvoiceMOPsManager IMM = new InvoiceMOPsManager(); InvoiceMOPs payment = new InvoiceMOPs { intInvoiceID = Convert.ToInt32(Request.QueryString["receipt"]), fltAmountPaid = amountPaid, intPaymentID = paymentID, intChequeNumber = chequeNumber }; IMM.CallAddNewMopToReceiptList(payment, objPageDetails); //Center the mop grid view UpdatePageTotals(); } //Exception catch catch (ThreadAbortException) { } catch (Exception ex) { //Log all info into error table ER.CallLogError(ex, CU.employee.intEmployeeID, Convert.ToString(Session["currPage"]), 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); } }