Exemplo n.º 1
0
 protected void gvUsers_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     ClearControl();
     if (e.CommandName == "EditUser")
     {
         SecureUserId = Convert.ToInt32(e.CommandArgument);
         try
         {
             BindUserToUpdate();
         }
         catch (Exception exc)
         {
             ShowMessage(ref lblMessage, MessageType.Danger, exc.Message);
             lblMessage.Visible = true;
         }
     }
     if (e.CommandName == "deleteUser")
     {
         int suserId = Convert.ToInt32(e.CommandArgument);
         try
         {
             _client.DeleteUser(suserId);
             ShowMessage(ref lblMessage, MessageType.Success, "Record deleted successfully.");
             lblMessage.Visible = true;
             BindUserList();
         }
         catch (Exception exc)
         {
             ShowMessage(ref lblMessage, MessageType.Danger, exc.Message);
             lblMessage.Visible = true;
         }
     }
 }