Ejemplo n.º 1
0
 public ActionResult EditAuthorityOperationGroup(EditAuthorityOperationGroupViewModel authorityOperationGroup)
 {
     if (IsPost)
     {
         SaveAuthorityOperationGroupCmdDto saveInfo = new SaveAuthorityOperationGroupCmdDto()
         {
             AuthorityOperationGroup = authorityOperationGroup.MapTo <AuthorityOperationGroupCmdDto>()
         };
         var saveResult = authService.SaveAuthorityOperationGroup(saveInfo);
         var ajaxResult = AjaxResult.CopyFromResult(saveResult);
         ajaxResult.Data         = saveResult.Data?.MapTo <AuthorityOperationGroupViewModel>();
         ajaxResult.SuccessClose = true;
         return(Json(ajaxResult));
     }
     else if (!(authorityOperationGroup.SysNo <= 0))
     {
         AuthorityOperationGroupFilterDto filter = new AuthorityOperationGroupFilterDto()
         {
             SysNos = new List <long>()
             {
                 authorityOperationGroup.SysNo
             }
         };
         authorityOperationGroup = authService.GetAuthorityOperationGroup(filter).MapTo <EditAuthorityOperationGroupViewModel>();
     }
     return(View(authorityOperationGroup));
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 根据授权操作分组查询条件生成查询对象
        /// </summary>
        /// <param name="filter">查询条件</param>
        /// <returns></returns>
        IQuery CreateAuthorityOperationGroupQueryObject(AuthorityOperationGroupFilterDto filter)
        {
            if (filter == null)
            {
                return(null);
            }
            IQuery query = QueryFactory.Create <AuthorityOperationGroupQuery>(filter);

            if (!filter.SysNos.IsNullOrEmpty())
            {
                query.In <AuthorityOperationGroupQuery>(c => c.SysNo, filter.SysNos);
            }
            if (!filter.ExcludeSysNos.IsNullOrEmpty())
            {
                query.NotIn <AuthorityOperationGroupQuery>(c => c.SysNo, filter.ExcludeSysNos);
            }
            if (!filter.Name.IsNullOrEmpty())
            {
                query.Equal <AuthorityOperationGroupQuery>(c => c.Name, filter.Name);
            }
            if (filter.Sort.HasValue)
            {
                query.Equal <AuthorityOperationGroupQuery>(c => c.Sort, filter.Sort.Value);
            }
            if (filter.Parent.HasValue)
            {
                query.Equal <AuthorityOperationGroupQuery>(c => c.Parent, filter.Parent.Value);
            }
            if (filter.Root.HasValue)
            {
                query.Equal <AuthorityOperationGroupQuery>(c => c.Root, filter.Root.Value);
            }
            if (filter.Level.HasValue)
            {
                query.Equal <AuthorityOperationGroupQuery>(c => c.Level, filter.Level.Value);
            }
            if (filter.Status.HasValue)
            {
                query.Equal <AuthorityOperationGroupQuery>(c => c.Status, filter.Status.Value);
            }
            if (!filter.Remark.IsNullOrEmpty())
            {
                query.Equal <AuthorityOperationGroupQuery>(c => c.Remark, filter.Remark);
            }
            return(query);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 获取授权操作组分页
 /// </summary>
 /// <param name="filter">查询对象</param>
 /// <returns></returns>
 public IPaging <AuthorityOperationGroupDto> GetAuthorityOperationGroupPaging(AuthorityOperationGroupFilterDto filter)
 {
     return(authBusiness.GetAuthorityOperationGroupPaging(filter));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 获取授权操作组列表
 /// </summary>
 /// <param name="filter">查询对象</param>
 /// <returns></returns>
 public List <AuthorityOperationGroupDto> GetAuthorityOperationGroupList(AuthorityOperationGroupFilterDto filter)
 {
     return(authBusiness.GetAuthorityOperationGroupList(filter));
 }
Ejemplo n.º 5
0
 /// <summary>
 /// 获取授权操作组
 /// </summary>
 /// <param name="filter">查询对象</param>
 /// <returns></returns>
 public AuthorityOperationGroupDto GetAuthorityOperationGroup(AuthorityOperationGroupFilterDto filter)
 {
     return(authBusiness.GetAuthorityOperationGroup(filter));
 }
Ejemplo n.º 6
0
        /// <summary>
        /// 获取授权操作组分页
        /// </summary>
        /// <param name="filter">查询对象</param>
        /// <returns></returns>
        public IPaging <AuthorityOperationGroupDto> GetAuthorityOperationGroupPaging(AuthorityOperationGroupFilterDto filter)
        {
            var authorityOperationGroupPaging = authorityOperationGroupService.GetAuthorityOperationGroupPaging(CreateAuthorityOperationGroupQueryObject(filter));

            return(authorityOperationGroupPaging.ConvertTo <AuthorityOperationGroupDto>());
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 获取授权操作组列表
        /// </summary>
        /// <param name="filter">查询对象</param>
        /// <returns></returns>
        public List <AuthorityOperationGroupDto> GetAuthorityOperationGroupList(AuthorityOperationGroupFilterDto filter)
        {
            var authorityOperationGroupList = authorityOperationGroupService.GetAuthorityOperationGroupList(CreateAuthorityOperationGroupQueryObject(filter));

            return(authorityOperationGroupList.Select(c => c.MapTo <AuthorityOperationGroupDto>()).ToList());
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 获取授权操作组
        /// </summary>
        /// <param name="filter">查询对象</param>
        /// <returns></returns>
        public AuthorityOperationGroupDto GetAuthorityOperationGroup(AuthorityOperationGroupFilterDto filter)
        {
            var authorityOperationGroup = authorityOperationGroupService.GetAuthorityOperationGroup(CreateAuthorityOperationGroupQueryObject(filter));

            return(authorityOperationGroup.MapTo <AuthorityOperationGroupDto>());
        }
Ejemplo n.º 9
0
        public IActionResult SearchAuthorityOperationGroup(AuthorityOperationGroupFilterDto filter)
        {
            var authorityOperationGroups = authService.GetAuthorityOperationGroupList(filter).Select(c => c.MapTo <AuthorityOperationGroupViewModel>()).OrderBy(r => r.Sort).ToList();

            return(Json(authorityOperationGroups));
        }