public IHttpActionResult Delete(int id) { UsersBLL userBLL = new UsersBLL(); userBLL.DeleteUser(id); return(Ok()); }
protected void myGrid_ItemCommand(object source, DataGridCommandEventArgs e) { if (e.CommandName == "del") { bll.DeleteUser(Convert.ToInt32(e.CommandArgument)); } PageInit(); }
public void DeleteUser() { UsersBLL userBLL = new UsersBLL(); userBLL.DeleteUser(1012); var user = userBLL.Get(1012); Assert.IsNull(user); }
public void DeleteUser(string actionValue) { try { UsersBLL.DeleteUser(actionValue); } catch (Exception) { throw; } }
protected void btnDeleteUser_Click(object sender, EventArgs e) { CheckBox chkUser; string username; Literal litName; foreach (GridViewRow row in grdUsers.Rows) { chkUser = (CheckBox)row.Cells[0].FindControl("chkUser"); if (chkUser.Checked) { litName = (Literal)row.Cells[0].FindControl("LitUserName"); username = litName.Text; userBLL.DeleteUser(username); } } Response.Redirect("/SystemSettings/Users.aspx"); BindGrid(); }
public IHttpActionResult DeleteUser(int id) { if (id == 0) { return(BadRequest("Invalid User ID")); } try { bool isDeleted = _usersBLL.DeleteUser(id); if (isDeleted == true) { return(Ok("User Deleted Successfully!")); } else { return(NotFound()); } } catch (Exception exception) { return(BadRequest(exception.Message)); } }