Exemplo n.º 1
0
 protected void gvSocietyes_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "EditSociety")
     {
         SocietyID = Convert.ToInt32(e.CommandArgument);
         try
         {
             BindSocietyToUpdate();
         }
         catch (Exception exc)
         {
             ShowMessage(ref lblMessage, MessageType.Danger, exc.Message);
             lblMessage.Visible = true;
         }
     }
     if (e.CommandName == "deleteSociety")
     {
         int SBranchId = Convert.ToInt32(e.CommandArgument);
         try
         {
             int retID = client.DeleteSociety(SBranchId);
             ShowMessage(ref lblMessage, MessageType.Success, "Record deleted successfully.");
             lblMessage.Visible = true;
             BindSocietyList();
         }
         catch (Exception exc)
         {
             ShowMessage(ref lblMessage, MessageType.Danger, exc.Message);
             lblMessage.Visible = true;
         }
     }
 }