Beispiel #1
0
        //用户详细信息
        private void GetUserDetailInfo()
        {
            // this.UserDetail = new UserBLL().GetUserDetailInfoByProjectId(this.model.Id, this.model.UserId.ToString());
            userDetailInfoInfo UserDetail = null;

            if (model.Type == 9 || model.Type == 26 || model.Type == 40)//车贷
            {
                string strSQL = @"SELECT Id,ProjectID,CarBrand,CarOrigin,CarType,ISNULL(CarPrice,0) AS CarPrice,CarKM,CarIsBigRepair,CarPlace,AddDate,CarDisplacement 
                                FROM dbo.UserCarDetailInfo WITH(NOLOCK) WHERE ProjectID=@ProjectId";
                Dapper.DynamicParameters par = new Dapper.DynamicParameters();
                par.Add("@ProjectId", projectId);

                mUserCarDetailInfoInfo = PublicConn.QuerySingle <UserCarDetailInfoInfo>(strSQL, ref par);
                if (mUserCarDetailInfoInfo == null)
                {
                    mUserCarDetailInfoInfo                = new UserCarDetailInfoInfo();
                    UserDetail                            = new UserBLL().GetUserDetailInfoByProjectId(projectId.Value, model.UserId.Value.ToString());
                    mUserCarDetailInfoInfo.CarBrand       = UserDetail.CarBrand;
                    mUserCarDetailInfoInfo.CarIsBigRepair = UserDetail.CarIsBigRepair.HasValue ? UserDetail.CarIsBigRepair.Value : false;
                    mUserCarDetailInfoInfo.CarKM          = UserDetail.CarKM.HasValue ? UserDetail.CarKM.Value : 0;
                    mUserCarDetailInfoInfo.CarOrigin      = UserDetail.CarOrigin;
                    mUserCarDetailInfoInfo.CarPlace       = UserDetail.CarOrigin;
                    mUserCarDetailInfoInfo.CarPrice       = UserDetail.CarPrice.HasValue ? UserDetail.CarPrice.Value : 0;
                    mUserCarDetailInfoInfo.CarType        = UserDetail.CarType;
                }
            }
            else
            {//房贷
                string strSQL = @"SELECT  Id,ProjectID,HouseBuyDate,ISNULL(HouseArea,0) AS HouseArea,ISNULL(HousePrice,0) AS HousePrice,ISNULL(HouseYears,0)AS HouseYears,ISNULL(IsHouseRenovation,0) AS IsHouseRenovation,ISNULL(IsHouseLoan,0) AS IsHouseLoan
                                  ,ISNULL(HouseLoanAmount,0) AS HouseLoanAmount,ISNULL(HouseLoanYears,0) AS HouseLoanYears,AddDate FROM dbo.UserHouseDetailInfo WITH(NOLOCK) WHERE ProjectID=@ProjectId";
                Dapper.DynamicParameters par = new Dapper.DynamicParameters();
                par.Add("@ProjectId", projectId);

                mUserHouseDetailInfoInfo = PublicConn.QuerySingle <UserHouseDetailInfoInfo>(strSQL, ref par);
                if (mUserHouseDetailInfoInfo == null)
                {
                    mUserHouseDetailInfoInfo = new UserHouseDetailInfoInfo();
                    UserDetail = new UserBLL().GetUserDetailInfoByProjectId(projectId.Value, model.UserId.Value.ToString());

                    mUserHouseDetailInfoInfo.HouseBuyDate      = UserDetail.HouseBuyDate.Value;
                    mUserHouseDetailInfoInfo.HouseArea         = UserDetail.HouseArea.HasValue ? UserDetail.HouseArea.Value : 0;
                    mUserHouseDetailInfoInfo.HousePrice        = UserDetail.HousePrice.HasValue ? UserDetail.HouseArea.Value : 0;
                    mUserHouseDetailInfoInfo.HouseYears        = UserDetail.HouseYears.HasValue ? UserDetail.HouseYears.Value : 0;
                    mUserHouseDetailInfoInfo.IsHouseRenovation = UserDetail.IsHouseRenovation.HasValue ? UserDetail.IsHouseRenovation.Value : false;
                    mUserHouseDetailInfoInfo.IsHouseLoan       = UserDetail.IsHouseLoan.HasValue ? UserDetail.IsHouseLoan.Value : false;
                    mUserHouseDetailInfoInfo.HouseLoanAmount   = UserDetail.HouseLoanAmount.HasValue ? UserDetail.HouseArea.Value : 0;
                    mUserHouseDetailInfoInfo.HouseLoanYears    = UserDetail.HouseLoanYears.HasValue ? UserDetail.HouseLoanYears.Value : 0;
                }
            }
        }
Beispiel #2
0
        protected bool GetData()
        {
            UserBLL userbll = new UserBLL();

            //获取项目信息
            model = bll.GetProjectDetailInfo(projectId.Value);
            if (model == null)
            {
                Response.Redirect(GlobalUtils.WebURL + "/Member/my_account.aspx");
                return(false);
            }
            userApply = bll.WXGetFQUserApplyInfo(projectId.Value.ToText());
            if (userApply != null)
            {
                Organization = bll.WXGetOrganizationInfo(userApply.OrgId.HasValue ? userApply.OrgId.Value.ToText() : "");
            }
            else
            {
                userApply = new WXFQUserApplyInfo();
            }

            string strFile = string.Format(" oa.OrgTypeId ={0} and (f.UserId IS NULL OR f.UserId = '{1}') ", Organization.OrgTypeId, userApply.ApplyUserId);

            Dapper.DynamicParameters dyParams = new Dapper.DynamicParameters();
            string strSQL   = string.Format(@" SELECT DISTINCT AuthName = a.Name, oa.AuthId, a.UploadedStyle,oa.SortOrder
                                             FROM fq_OrgAuthSetting oa with(nolock)
                                             INNER JOIN fq_AuthSetting a with(nolock) ON oa.AuthId = a.Id 
                                             INNER JOIN (SELECT AuthId,UserId from  dbo.fq_UserAuthFile with(nolock) WHERE (IsDelete IS NULL OR IsDelete = 0) AND IsHiddenInfo =0) f ON a.Id = f.AuthId 
                                             Where {0} Order by oa.SortOrder asc", strFile);
            var    AuthList = PublicConn.QueryBySql <AuthSet>(strSQL, ref dyParams);

            for (int i = 0; i < AuthList.Count; i++)
            {
                if (i == 0)
                {
                    AuthHtml = AuthList[i].AuthName;
                }
                else
                {
                    AuthHtml += "、" + AuthList[i].AuthName;
                }
            }

            //是否学生分期
            dyParams = new Dapper.DynamicParameters();
            dyParams.Add("@ProjectId", model.Id);
            strSQL         = "select isnull(IdentityTypeId,0) as IdentityTypeId from fq_UserApply with(nolock) where ProjectId=@ProjectId";
            IdentityTypeId = PublicConn.QuerySingle <int>(strSQL, ref dyParams);

            if (IdentityTypeId == 1)
            {
                //获取学生基本信息
                dyParams = new Dapper.DynamicParameters();
                dyParams.Add("@UserId", model.UserId);
                strSQL         = "select * from fq_ApplyEducation with(nolock) where UserId=@UserId";
                applyEducation = PublicConn.QuerySingle <ApplyEducation>(strSQL, ref dyParams);
            }
            else
            {
                borrowUserInfo = userbll.GetUserBasicInfoModelById(model.UserId.Value);
                strSQL         = "select * from userDetailInfo with(nolock) where UserId=@UserId";
                dyParams       = new Dapper.DynamicParameters();
                dyParams.Add("@UserId", borrowUserInfo.Id);
                userDetai = PublicConn.QuerySingle <userDetailInfoInfo>(strSQL, ref dyParams);
            }
            //信用档案
            creditInfo = CommUtils.GetBorrowerCreditData(model.UserId.Value);

            //项目展示图
            imageList     = CommUtils.GetProjectImages(this.projectId.Value);
            finishProcess = CommUtils.GetProjectProcess(model);

            SubscribeUserCount = CommUtils.GetSubscribeUserCount(this.projectId.Value);
            //计算预期收益
            PreInterestRate  = CommUtils.CalcInvestInterest(model, 10000);
            EbaoMultiple     = int.Parse(Math.Ceiling(model.InterestRate.Value / decimal.Parse("2.5")).ToString());
            EbaoInterest     = CommUtils.GetEbaoMultipleInterest(model, 10000);
            preSubscribeList = CommUtils.GetPreSubscribeDetail(model, 10000);
            return(true);
        }