public async Task <IActionResult> Delete(String id)
        {
            var deleteRole = await _role.Delete(id);

            if (deleteRole)
            {
                return(RedirectToAction("Index"));
            }
            return(View());
        }
Beispiel #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();
        }
Beispiel #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" }));
            }
        }
Beispiel #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"));
        }
Beispiel #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
                }));
            }
        }
 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}"));
     }
 }
Beispiel #7
0
 public async Task <IActionResult> DeleteConfirmed(int id)
 {
     _db.Delete(id);
     _db.Save();
     return(RedirectToAction(nameof(Index)));
 }
Beispiel #8
0
 public IActionResult Delete(Guid id)
 {
     _roleService.Delete(id);
     return(Ok());
 }
Beispiel #9
0
 public virtual void Delete()
 {
     _role.Delete();
 }
Beispiel #10
0
 /// <summary>
 /// 删除一条数据
 /// </summary>
 public bool Delete(int F_ID)
 {
     return(dal.Delete(F_ID));
 }
 public ResultModel Delete([FromBody] RoleModel obj)
 {
     return(_svr.Delete(obj.ID));
 }
Beispiel #12
0
 public void Delete(string id)
 {
     dao.Delete(id);
 }
Beispiel #13
0
 public void Delete(Role objRole)
 {
     Roleobj.Delete(objRole);
 }
Beispiel #14
0
 /// <summary>
 /// 删除一条数据
 /// </summary>
 public bool Delete(string ID)
 {
     return(dal.Delete(ID));
 }