Esempio n. 1
0
        public ActionResult Delete(string ids)
        {
            ServiceResult result = new ServiceResult();
            var           IdArr  = ids.Split(',').Select(x => Convert.ToInt32(x)).ToList();

            try
            {
                for (var i = 0; i < IdArr.Count; i++)
                {
                    var model = PermissionsService.Find(IdArr[i]);
                    PermissionsService.Delete(model);
                }
                LogHelper.WriteLog("删除权限成功");
                result.Message = "删除权限成功!";
            }
            catch (DbEntityValidationException ex)
            {
                result.Message = "删除权限错误!";
                result.AddServiceError("删除权限错误!");
                LogHelper.WriteLog("删除权限错误", ex);
            }
            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Esempio n. 2
0
        public IActionResult Delete(int id, [FromQuery] int permissionId)
        {
            var result = _permissionService.Delete(id, permissionId);

            return(Ok(result));
        }
Esempio n. 3
0
        public bool Delete(string Ids)
        {
            var result = iPermissionsService.Delete(Ids);

            return(result);
        }