예제 #1
0
        public async Task <IActionResult> Delete(String id)
        {
            var deleteRole = await _role.Delete(id);

            if (deleteRole)
            {
                return(RedirectToAction("Index"));
            }
            return(View());
        }
예제 #2
0
        public IActionResult DeleteRole(Role role)
        {
            var checkPerson = _roleRepo.Read(role.Id);

            if (checkPerson != null || checkPerson.Name != "Member")
            {
                _roleRepo.Delete(role.Id);
                return RedirectToAction("Index", "Roles");
            }
            return View();
        }
예제 #3
0
        public async Task <IActionResult> Delete(String id)
        {
            var deleteRole = await _role.Delete(id);

            if (deleteRole)
            {
                return(Ok("Role Deleted"));
            }
            else
            {
                return(BadRequest(new { message = "Unable to delete Role details" }));
            }
        }
예제 #4
0
        public ActionResult Delete(string id)
        {
            var iVal = 0;

            Utility.Operate(this, Operations.Delete, () =>
            {
                iVal = _role.Delete(id);
                return(iVal);
            });
            if (iVal > 0)
            {
                _cache.Remove(Constants.CACHE_KEY_ROLES);
            }

            return(Redirect("~/Admin/Roles/Index"));
        }
예제 #5
0
        public ActionResult RemoveRole(long id)
        {
            try
            {
                dalRole.Delete(id);

                return(this.JsonFormat(new ExtResult {
                    success = true
                }));
            }
            catch (Exception ex)
            {
                return(this.JsonFormat(new ExtResult {
                    success = false, msg = ex.Message
                }));
            }
        }
예제 #6
0
 public IActionResult Delete(Guid id)
 {
     try
     {
         if (id == null)
         {
             return(StatusCode(400, $"ID is not valid."));
         }
         else
         {
             var res = _role.Delete(id);
             return(Json(res));
         }
     }
     catch (Exception ex)
     {
         _logger.LogCritical($"Exception while get list of items.", ex);
         return(StatusCode(500, $"Exception while get list of items. {ex.Message}"));
     }
 }
예제 #7
0
 public async Task <IActionResult> DeleteConfirmed(int id)
 {
     _db.Delete(id);
     _db.Save();
     return(RedirectToAction(nameof(Index)));
 }
예제 #8
0
 public IActionResult Delete(Guid id)
 {
     _roleService.Delete(id);
     return(Ok());
 }
예제 #9
0
 public virtual void Delete()
 {
     _role.Delete();
 }
예제 #10
0
파일: RoleService.cs 프로젝트: Dekai/zdk
 /// <summary>
 /// 删除一条数据
 /// </summary>
 public bool Delete(int F_ID)
 {
     return(dal.Delete(F_ID));
 }
예제 #11
0
 public ResultModel Delete([FromBody] RoleModel obj)
 {
     return(_svr.Delete(obj.ID));
 }
예제 #12
0
 public void Delete(string id)
 {
     dao.Delete(id);
 }
예제 #13
0
 public void Delete(Role objRole)
 {
     Roleobj.Delete(objRole);
 }
예제 #14
0
파일: Role.cs 프로젝트: kencentre/X-Wcf
 /// <summary>
 /// 删除一条数据
 /// </summary>
 public bool Delete(string ID)
 {
     return(dal.Delete(ID));
 }