Exemplo n.º 1
0
 protected void gvVendores_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "EditVendor")
     {
         VendorID = Convert.ToInt32(e.CommandArgument);
         try
         {
             BindVendorToUpdate();
         }
         catch (Exception exc)
         {
             ShowMessage(ref lblMessage, MessageType.Danger, exc.Message);
             lblMessage.Visible = true;
         }
     }
     if (e.CommandName == "deleteVendor")
     {
         int SBranchId = Convert.ToInt32(e.CommandArgument);
         try
         {
             int retID = client.DeleteVendor(SBranchId);
             ShowMessage(ref lblMessage, MessageType.Success, "Record deleted successfully.");
             lblMessage.Visible = true;
             BindVendorList();
         }
         catch (Exception exc)
         {
             ShowMessage(ref lblMessage, MessageType.Danger, exc.Message);
             lblMessage.Visible = true;
         }
     }
 }