protected void BtnCustomerSearch_Click(object sender, EventArgs e) { //Collects current method and page for error tracking string method = "BtnCustomerSearch_Click"; object[] objPageDetails = { Session["currPage"].ToString(), method }; try { //Looks through database and returns a list of customers //based on the search criteria entered //Binds the results to the gridview GrdCustomersSearched.Visible = true; GrdCustomersSearched.DataSource = CM.CallReturnCustomerBasedOnText(txtSearch.Text, objPageDetails); GrdCustomersSearched.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); } }
protected void BtnCustomerSelect_Click(object sender, EventArgs e) { //Collects current method for error tracking string method = "BtnCustomerSelect_Click"; object[] objPageDetails = { Session["currPage"].ToString(), method }; try { if (BtnCustomerSelect.Text == "Cancel") { BtnCustomerSelect.Text = "Change Customer"; GrdCustomersSearched.Visible = false; Customer C = CM.CallReturnCustomer(Convert.ToInt32(Request.QueryString["customer"].ToString()), objPageDetails)[0]; //Set name in text box txtCustomer.Text = C.varFirstName + " " + C.varLastName; } else { GrdCustomersSearched.Visible = true; GrdCustomersSearched.DataSource = CM.CallReturnCustomerBasedOnText(txtCustomer.Text, objPageDetails); GrdCustomersSearched.DataBind(); if (GrdCustomersSearched.Rows.Count > 0) { BtnCustomerSelect.Text = "Cancel"; } } } //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); } }
protected void GrdCustomersSearched_PageIndexChanging(object sender, GridViewPageEventArgs e) { string method = "GrdCustomersSearched_PageIndexChanging"; object[] objPageDetails = { Session["currPage"].ToString(), method }; try { GrdCustomersSearched.PageIndex = e.NewPageIndex; GrdCustomersSearched.Visible = true; GrdCustomersSearched.DataSource = CM.CallReturnCustomerBasedOnText(txtCustomer.Text, objPageDetails); GrdCustomersSearched.DataBind(); } //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); } }