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;
            }
        }
예제 #2
0
        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));
     }
 }
예제 #4
0
        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));
            }
        }
예제 #5
0
        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"));
            }
        }
예제 #6
0
        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" }));
            }
        }
예제 #7
0
        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);
        }
예제 #8
0
        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));
        }
예제 #9
0
 public void DeleteRole(string name)
 {
     RoleInterface.DeleteRole(name);
 }
예제 #10
0
        public ActionResult DeleteRole(int id)
        {
            var role = _role.DeleteRole(id);

            return(Ok(role));
        }
예제 #11
0
 public bool DeleteRole(int id)
 {
     return(roleRep.DeleteRole(new Role {
         Id = id
     }));
 }
예제 #12
0
 public ActionResult DeleteRole(tbl_MCE_Role mce_Role)
 {
     _role.DeleteRole(mce_Role);
     TempData["Success"] = "Data Deleted Successfully";
     return(RedirectToAction("RoleDataTable", "Role"));
 }