protected void PendingAdjustmentVoucherGridView_Delete(object sender, GridViewDeleteEventArgs e) { try { int aVNo = Int32.Parse(PendingAdjustmentVoucherGridView.Rows[e.RowIndex].Cells[0].Text); AVController.DeleteAV(aVNo); BindGrid(); Session["AVProcessed"] = aVNo; } catch (Exception exception) { Session["Error"] = " " + exception.Message; } }
protected void Button_Click(object sender, EventArgs e) { try { Button buttonPressed = (Button)sender; if (buttonPressed.CommandArgument == "Delete") { // Delete AV AVController.DeleteAV(aVNo); Session["AVProcessed"] = (int)Session["AVNo"]; } } catch (Exception exception) { // Alert user of error Session["Error"] = "An Error Has Occured: " + exception.Message; } if (Session["Error"] == null) { GoToAdjustmentVoucherListPage(); } }