Beispiel #1
0
        /// <summary>
        /// 删除权限
        /// </summary>
        /// <param name="deleteInfo">删除信息</param>
        /// <returns>执行结果</returns>
        public Result DeleteAuthority(DeleteAuthorityCmdDto deleteInfo)
        {
            using (var businessWork = UnitOfWork.Create())
            {
                #region 参数判断

                if (deleteInfo == null || deleteInfo.AuthorityCodes.IsNullOrEmpty())
                {
                    return(Result.FailedResult("没有指定要删除的权限"));
                }

                #endregion

                AuthorityService.DeleteAuthority(deleteInfo.AuthorityCodes);
                var exectVal = businessWork.Commit();
                return(exectVal.ExecutedSuccess ? Result.SuccessResult("删除成功") : Result.FailedResult("删除失败"));
            }
        }
Beispiel #2
0
        private void DelAuth()
        {
            int       f    = lbl_father.Tag == null ? 0 : (int)lbl_father.Tag;
            Authority auth = GetEditAuth(f, CAuth.id);
            bool      id   = authorityService.DeleteAuthority(auth);

            if (id)
            {
                Authority a = (Authority)txb_name.Tag;
                authorities.Remove(a);
                ShowTreeView();
                ShowTipsMessageBox("删除成功");
            }
            else
            {
                ShowTipsMessageBox("删除失败");
            }
        }