Exemplo n.º 1
0
 protected void gvCompany_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "EditCompany")
     {
         ApplicationID = Convert.ToInt32(e.CommandArgument);
         try
         {
             BindApplicationToUpdate();
         }
         catch (Exception exc)
         {
             ShowMessage(ref lblMessage, MessageType.Danger, exc.Message);
             lblMessage.Visible = true;
         }
     }
     if (e.CommandName == "deleteCompany")
     {
         int SApplicationID = Convert.ToInt32(e.CommandArgument);
         try
         {
             int retID = client.DeleteAgent(SApplicationID);
             ShowMessage(ref lblMessage, MessageType.Success, "Record deleted successfully.");
             lblMessage.Visible = true;
             BindAllAgentDetails();
         }
         catch (Exception exc)
         {
             ShowMessage(ref lblMessage, MessageType.Danger, exc.Message);
             lblMessage.Visible = true;
         }
     }
 }