Exemple #1
0
 //
 // POST: /SysAdmin/State/Delete/5
 //[HttpPost]
 public ActionResult Delete(int id)
 {
     try
     {
         // TODO: Add delete logic here
         StateBAL balObject = new StateBAL();
         balObject.Delete(id);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
Exemple #2
0
 protected void gvState_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "DeleteRecord")
     {
         if (e.CommandArgument != null)
         {
             StateBAL balState = new StateBAL();
             if (balState.Delete(Convert.ToInt32(e.CommandArgument.ToString().Trim())))
             {
                 FillStateGridView();
             }
             else
             {
                 lblMessage.Text    = balState.Message;
                 divMessage.Visible = true;
             }
         }
     }
 }