Exemple #1
0
 protected void gvPlan_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "EditPlan")
     {
         PlanID = Convert.ToInt32(e.CommandArgument);
         try
         {
             BindPlanToUpdate();
         }
         catch (Exception exc)
         {
             ShowMessage(ref lblMessage, MessageType.Danger, exc.Message);
             lblMessage.Visible = true;
         }
     }
     if (e.CommandName == "deletePlan")
     {
         int SPlanId = Convert.ToInt32(e.CommandArgument);
         try
         {
             int retID = client.DeletePlan(SPlanId);
             ShowMessage(ref lblMessage, MessageType.Success, "Record deleted successfully.");
             lblMessage.Visible = true;
             BindPlanList();
         }
         catch (Exception exc)
         {
             ShowMessage(ref lblMessage, MessageType.Danger, exc.Message);
             lblMessage.Visible = true;
         }
     }
 }