protected void lbBMPPlanning_ImplementationYears_Delete_Click(object sender, EventArgs e) { bool b = WACGlobal_Methods.Security_UserObjectCustom(Session["userID"], WACGlobal_Methods.Enum_Security_UserObjectCustom.A_PLAN); if (b) { LinkButton lb = (LinkButton)sender; int iCode = 0; using (WACDataClassesDataContext wDataContext = new WACDataClassesDataContext()) { try { iCode = wDataContext.bmp_ag_implementation_delete(Convert.ToInt32(lb.CommandArgument), Session["userName"].ToString()); if (iCode == 0) { BindData_BMPPlanning_FormView(Convert.ToInt32(fvBMPPlanning.DataKey.Value)); } else { WACAlert.Show("Error Returned from Database.", iCode); } } catch (Exception ex) { WACAlert.Show(ex.Message, 0); } } } else { WACAlert.Show("You do not have permission to insert into the BMP Planning Implementation Year table.", 0); } }