public BaseResultDto <List <SystemDictionary> > GetAllHelpType()
        {
            BaseResultDto <List <SystemDictionary> > result = new BaseResultDto <List <SystemDictionary> >();

            try
            {
                string sqlWhere             = string.Format(" DicKey='{0}' ", EnumDictionary.HelpType);
                List <SystemDictionary> dic = helper.GetList <SystemDictionary>(sqlWhere);
                result.Tag       = dic;
                result.ErrorMsg  = "成功";
                result.ErrorCode = 1;
            }
            catch (Exception ex)
            {
                result.ErrorMsg  = ex.Message;
                result.ErrorCode = -1;
            }
            return(result);
        }
示例#2
0
        public ApplayClaimsDto GetApplayClaims(int ApplyId)
        {
            SystemBorrowerApply systemBorrowerApply = helper.GetModelById <SystemBorrowerApply>(ApplyId);
            //借款人账号和申请的债权 唯一对应一条债权
            string       sqlwhere     = string.Format(" BorrowerID={0} and ClaimsApplayID={1}", systemBorrowerApply.BorrowerID, systemBorrowerApply.Id);
            SystemClaims systemClaims = helper.GetList <SystemClaims>(sqlwhere).FirstOrDefault();

            if (systemClaims == null)
            {
                systemClaims = new SystemClaims();
                systemClaims.EarningsStartTime = System.DateTime.Now.AddMonths(1).ToString("yyyy-MM-dd");
                systemClaims.InvestmentEndTime = System.DateTime.Now.AddMonths(1).ToString("yyyy-MM-dd");
            }
            systemClaims.BorrowerID     = systemBorrowerApply.BorrowerID;
            systemClaims.ClaimsApplayID = systemBorrowerApply.Id;
            systemClaims.Borrower       = systemBorrowerApply.BorrowerName;
            systemClaims.LoanAmount     = systemBorrowerApply.LoanAmount;
            //从字典表获取所有设置的小图标
            sqlwhere = string.Format(" DicKey ='{0}' ", EnumDictionary.SmallIcon);
            List <SystemDictionary> dics              = helper.GetList <SystemDictionary>(sqlwhere);
            List <IconProperty>     ShowIcons         = new List <IconProperty>();
            List <IconProperty>     ShowIconsAttrCode = new List <IconProperty>();
            List <IconModel>        icoList           = new List <IconModel>();

            if (systemClaims.Icons != "")
            {
                icoList = systemClaims.Icons.ToModel <List <IconModel> >();
            }
            bool IsOpen = false;

            dics.ForEach(p =>
            {
                //类型^标题^弹出提示^背景样式字符串^日息
                string[] strArr = p.DicValue.Split('^');
                if (strArr.Length >= 4)
                {
                    string AtrrCode = strArr.Length >= 5 ? strArr[4] : "";
                    if (AtrrCode != "")
                    {
                        IsOpen = icoList.Exists(p1 => p1.IconType.Trim() == strArr[0].Trim() && p1.AtrrCode == AtrrCode);
                        ShowIconsAttrCode.Add(new IconProperty()
                        {
                            IsOpen          = IsOpen,
                            AddShow         = p.DicType, //显示
                            IconType        = strArr[0], //类型
                            Title           = strArr[1], //标题
                            TipMessage      = strArr[2], //弹出提示
                            BackgroundClass = strArr[3], //背景样式字符串
                            AtrrCode        = AtrrCode   //还款方式
                        });
                    }
                    else
                    {
                        IsOpen = icoList.Exists(p1 => p1.IconType.Trim() == strArr[0].Trim());
                        ShowIcons.Add(new IconProperty()
                        {
                            IsOpen          = IsOpen,
                            AddShow         = p.DicType, //显示
                            IconType        = strArr[0], //类型
                            Title           = strArr[1], //标题
                            TipMessage      = strArr[2], //弹出提示
                            BackgroundClass = strArr[3], //背景样式字符串
                            AtrrCode        = AtrrCode   //还款方式
                        });
                    }
                }
            });
            var model = new ApplayClaimsDto()
            {
                Applay       = systemBorrowerApply,
                Claims       = systemClaims,
                ShowIcons    = ShowIcons,
                ShowAttrCode = ShowIconsAttrCode
            };

            return(model);
        }