/// <summary>
        /// 加载表单 数据
        /// </summary>
        /// <returns></returns>
        public async Task <Dictionary <string, object> > LoadFormAsync()
        {
            var res = new Dictionary <string, object>();

            var _Sys_RoleList = await dbRole.Query()
                                .OrderBy(w => w.Role_Num)
                                .Select(w => new
            {
                w.Role_ID,
                w.Role_Num,
                w.Role_Name,
                w.Role_Remark,
                w.Role_IsDelete,
                w.Role_CreateTime,
                State = 0
            })
                                .ToListAsync <dynamic>();

            foreach (var item in _Sys_RoleList)
            {
                if (_Sys_RoleList.IndexOf(item) == 0)
                {
                    item.State = 1;
                }
                else
                {
                    break;
                }
            }

            res[nameof(_Sys_RoleList)] = _Sys_RoleList;

            return(res);
        }
        public async Task <(List <Guid>, List <object>)> GetRoleMenuFunctionTreeAsync(Guid RoleId)
        {
            var _Sys_MenuList = await dbMenu.Query().OrderBy(w => w.Menu_Num).ToListAsync();

            var _Sys_FunctionList = await dbFunction.Query().OrderBy(w => w.Function_Num).ToListAsync();

            var _Sys_MenuFunctionList = await dbMenuFunction.Query().OrderBy(w => w.MenuFunction_CreateTime).ToListAsync();

            var _Sys_RoleMenuFunctionList = await this.ToListAsync(w => w.RoleMenuFunction_RoleID == RoleId);

            return(Ids, this.CreateRoleMenuFuntionTree(Guid.Empty, _Sys_MenuList, _Sys_FunctionList, _Sys_MenuFunctionList, _Sys_RoleMenuFunctionList));
        }
Example #3
0
        /// <summary>
        /// 加载表单 数据
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public async Task <Dictionary <string, object> > LoadFormAsync(Guid Id)
        {
            var res = new Dictionary <string, object>();

            var Model = await this.FindByIdAsync(Id);

            var AllFunctionList = await dbFunction.Query()
                                  .OrderBy(w => w.Function_Num)
                                  .Select(w => new { w.Function_ID, w.Function_Name, w.Function_ByName })
                                  .ToListAsync();

            var FunctionIds = await dbMenuFunction.Query()
                              .Where(w => w.MenuFunction_MenuID == Id)
                              .Select(w => w.MenuFunction_FunctionID)
                              .ToListAsync();

            res[nameof(Id)]              = Id;
            res[nameof(Model)]           = Model.NullSafe();
            res[nameof(AllFunctionList)] = AllFunctionList;
            res[nameof(FunctionIds)]     = FunctionIds;

            return(res);
        }
        public List <LH_MergeBill> GetMergeBills(List <string> LHOBODNOS)
        {
            var repository = new DefaultRepository <LH_MergeBill>(DBTypeEnums.ORACLE);
            var sql        = "SELECT DISTINCT MB.* FROM MergeBill MB INNER JOIN LH_OUTBOUNDORDER OB ON OB.FMEGREBILLNO=MB.FBILLNO WHERE OB.LHODONO IN :LHODONOS";

            try
            {
                return(repository.Query(sql, new { LHODONOS = LHOBODNOS }, null));
            }
            catch (Exception e)
            {
                LogHelper.Error(e);
                throw;
            }
        }