Ejemplo n.º 1
0
        public PageList <Sys_FormRightResult> GetPageList(Sys_FormRightParam param)
        {
            this.CheckSession();
            PageList <Sys_FormRightResult> rst = new PageList <Sys_FormRightResult>();

            try
            {
                #region 获取分页列表
                WhereClip where = GetWhereClip(param);
                List <Field> lstField = new List <Field>()
                {
                    Sys_FormRight._.FormRightID, Sys_FormRight._.NameSpace, Sys_FormRight._.FormEngName,
                    Sys_FormRight._.FormChsName, Sys_FormRight._.UserControlEngName, Sys_FormRight._.UserControlChsName,
                    Sys_FormRight._.OprControlEngName, Sys_FormRight._.OprControlChsName, Sys_FormRight._.OprPropertyName,
                    Sys_FormRight._.ModuleID, Sys_FormRight._.ActionCode, Sys_FormRight._.IsDeleted
                };
                rst = this.SelectList <Sys_FormRightResult>(param.PageIndex.GetValueOrDefault(1), param.PageSize.GetValueOrDefault(20), lstField, where, Sys_FormRight._.NameSpace.Desc);
                #endregion
                #region 单据对应模块名称
                if (rst != null && rst.ResultList != null)
                {
                    Sys_ModuleBLL moduleBll   = new Sys_ModuleBLL();
                    int?[]        arrModuleID = rst.ResultList.Select(a => a.ModuleID).Distinct().ToArray();
                    moduleBll.SessionInfo = this.SessionInfo;
                    List <Sys_ModuleResult> moduleList = new List <Sys_ModuleResult>();
                    if (arrModuleID.Length > 0)
                    {
                        moduleList = moduleBll.GetPageList(new Sys_ModuleParam()
                        {
                            PageIndex = 1, PageSize = arrModuleID.Length, ModuleIDs = arrModuleID
                        }).ResultList;
                    }
                    Sys_ModuleResult findModule = new Sys_ModuleResult();
                    foreach (Sys_FormRightResult info in rst.ResultList)
                    {
                        findModule = moduleList.Find(a => a.ModuleID == info.ModuleID);
                        if (findModule != null)
                        {
                            info.ModuleName = findModule == null ? "" : findModule.ModuleName;
                        }
                    }
                }
                #endregion
            }
            catch (WarnException exp)
            {
                throw exp;
            }
            catch (System.Exception exp)
            {
                LogInfoBLL.WriteLog(this.SessionInfo, exp);
            }
            return(rst);
        }
Ejemplo n.º 2
0
        public Sys_FormRightResult GetInfo(Sys_FormRightParam param)
        {
            this.CheckSession();
            Sys_FormRightResult rst = new Sys_FormRightResult();

            try
            {
                #region 判断
                if (param.FormRightID <= 0)
                {
                    throw new WarnException("请指定关键字GUID!");
                }
                #endregion
                #region 保存实体
                WhereClip where = Sys_FormRight._.FormRightID == param.FormRightID;
                rst             = this.Select <Sys_FormRightResult>(where);
                if (rst != null)
                {
                    Sys_ModuleBLL moduleBll = new Sys_ModuleBLL();
                    moduleBll.SessionInfo = this.SessionInfo;
                    Sys_ModuleResult moduleRst = moduleBll.GetInfo(new Sys_ModuleParam()
                    {
                        ModuleID = rst.ModuleID.ToInt32()
                    });
                    rst.ModuleName = moduleRst == null ? "" : moduleRst.ModuleName;
                }

                #endregion
            }
            catch (WarnException exp)
            {
                throw exp;
            }
            catch (System.Exception exp)
            {
                LogInfoBLL.WriteLog(this.SessionInfo, exp);
            }
            return(rst);
        }