public HttpResponseMessage Delete(int id) { try { var result = _role.DeleteRole(id); if (result) { var response = new HttpResponseMessage() { StatusCode = HttpStatusCode.OK }; return(response); } else { var response = new HttpResponseMessage() { StatusCode = HttpStatusCode.BadRequest }; return(response); } } catch (Exception) { throw; } }
public bool DeleteRole(int roleID) { bool result = false; result = _IRole.DeleteRole(roleID); return(result); }
public IActionResult Delete(int id) { try { bool result = _role.DeleteRole(id); return(Ok(result)); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public ActionResult <bool> DeleteRole([FromBody] Role value) { Task <bool> data = role.DeleteRole(value); if (data.IsCanceled) { return(BadRequest(data.Exception)); } else { return(Ok(data.Result)); } }
public IHttpActionResult DeleteRole(int roleid) { var result = obj.DeleteRole(roleid); if (result == 1) { return(this.Ok("Role deleted successfully")); } else { return(this.BadRequest("Role Could not be deleted")); } }
public async Task <IActionResult> Delete(String id) { var deleteRole = await _role.DeleteRole(id); if (deleteRole) { return(Ok("Role Deleted")); } else { return(BadRequest(new { message = "Unable to delete Role details" })); } }
public ActionResult <Role> DeleteRole(int id) { var role = _roleData.GetRoleById(id); if (role != null) { _roleData.DeleteRole(role); _roleData.SaveChanges(); return(Accepted()); } return(NotFound($"Un role avec l'id : {id} n'existe pas")); // return Ok(categorireadDto); }
public async Task <IActionResult> DeleteRole(int roleMasterId) { #region Authorization code var identity = HttpContext.User.Identity as ClaimsIdentity; string id = ""; string role = ""; if (identity != null) { IEnumerable <Claim> claims = identity.Claims; // or id = identity.Claims.Where(m => m.Type == ClaimTypes.Sid).Select(m => m.Value).FirstOrDefault(); role = identity.Claims.Where(m => m.Type == ClaimTypes.Role).Select(m => m.Value).FirstOrDefault(); } long userId = Convert.ToInt32(id); #endregion //calling RoleDAL busines layer CommonResponse response = new CommonResponse(); response = roleMaster.DeleteRole(roleMasterId, userId); return(Ok(response)); }
public void DeleteRole(string name) { RoleInterface.DeleteRole(name); }
public ActionResult DeleteRole(int id) { var role = _role.DeleteRole(id); return(Ok(role)); }
public bool DeleteRole(int id) { return(roleRep.DeleteRole(new Role { Id = id })); }
public ActionResult DeleteRole(tbl_MCE_Role mce_Role) { _role.DeleteRole(mce_Role); TempData["Success"] = "Data Deleted Successfully"; return(RedirectToAction("RoleDataTable", "Role")); }