Beispiel #1
0
        protected void InitFormData()
        {
            UserBLL bll = new UserBLL();

            userModel = bll.GetUserBasicInfoModelById(userId);
            ExtModel  = bll.GetUserBasicInfoExtInfo(userId);
            if (!string.IsNullOrWhiteSpace(userModel.HeadImage))
            {
                headImage = userModel.HeadImage;
            }
            accountModel = bll.GetWXFundAccountInfo(userId);

            //获取紧急联系人信息
            UserBasicInfo_Ext _userBasicInfo_Ext = new UserBLL().GetEmergencyContact(userId);

            if (_userBasicInfo_Ext != null)
            {
                ExtModel.ContactName         = _userBasicInfo_Ext.ContactName;
                ExtModel.ContactTelNo        = _userBasicInfo_Ext.ContactTelNo;
                ExtModel.ContactRelationShip = _userBasicInfo_Ext.ContactRelationShip;
            }
            if (string.IsNullOrEmpty(ExtModel.Graduation) || string.IsNullOrEmpty(ExtModel.University) || string.IsNullOrEmpty(ExtModel.Marriage) || string.IsNullOrEmpty(ExtModel.Address) || string.IsNullOrEmpty(ExtModel.OfficeDomain) || string.IsNullOrEmpty(ExtModel.OfficeScale) || string.IsNullOrEmpty(ExtModel.Position) || string.IsNullOrEmpty(ExtModel.Salary) || !ExtModel.IsHaveHouse.HasValue || !ExtModel.IsHaveCar.HasValue || string.IsNullOrEmpty(ExtModel.ContactName) || string.IsNullOrEmpty(ExtModel.ContactTelNo) || string.IsNullOrEmpty(ExtModel.ContactRelationShip))
            {
                IsCompleteDetailInfo = false;
            }
            UserVipModel = this.GetNewVipUserInfo();
            UserSettingInfo UserSetting = new UserSettingBLL().GetUserSettingInfo(userId);

            if (UserSetting != null)
            {
                IsTenderNeedPayPassword = UserSetting.IsTenderNeedPayPassword;
            }

            //存管通用户
            CgtUser = new QueryClient().GetUserByPlatformUserNo(userId);
            if (GlobalUtils.IsBankService)
            {
                var bankInfo = new BankFromJavaService().GetBankInfo(userId, TuanDai.WXSystem.Core.models.ServiceType.TuoMin);
                if (bankInfo != null && bankInfo.respData != null)
                {
                    userModel.OpenBankName = bankInfo.respData.openBankName;
                }
            }
        }
Beispiel #2
0
        protected void InitFormData()
        {
            UserBLL bll = new UserBLL();

            userModel = bll.GetUserBasicInfoModelById(userId);
            ExtModel  = bll.GetUserBasicInfoExtInfo(userId);
            if (!string.IsNullOrWhiteSpace(userModel.HeadImage))
            {
                headImage = userModel.HeadImage;
            }
            accountModel = bll.GetWXFundAccountInfo(userId);

            //获取紧急联系人信息
            UserBasicInfo_Ext _userBasicInfo_Ext = new UserBLL().GetEmergencyContact(userId);

            if (_userBasicInfo_Ext != null)
            {
                ExtModel.ContactName         = _userBasicInfo_Ext.ContactName;
                ExtModel.ContactTelNo        = _userBasicInfo_Ext.ContactTelNo;
                ExtModel.ContactRelationShip = _userBasicInfo_Ext.ContactRelationShip;
            }

            UserVipModel = this.GetNewVipUserInfo();
            UserSettingInfo UserSetting = new UserSettingBLL().GetUserSettingInfo(userId);

            if (UserSetting != null)
            {
                IsTenderNeedPayPassword = UserSetting.IsTenderNeedPayPassword;
            }

            //存管通用户
            CgtUser = new QueryClient().GetUserByPlatformUserNo(userId);
            if (GlobalUtils.IsBankService)
            {
                var bankInfo = new BankFromJavaService().GetBankInfo(userId, ServiceType.TuoMin);
                if (bankInfo != null && bankInfo.respData != null)
                {
                    userModel.OpenBankName = bankInfo.respData.openBankName;
                }
            }
        }
Beispiel #3
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);
            }
            borrowerUserInfo    = userbll.GetUserBasicInfoModelById(model.UserId.Value);
            borrowerUserInfoExt = userbll.GetUserBasicInfoExtInfo(model.UserId.Value);

            this.GetBorrowerData();

            InterestRateNum1 = ToolStatus.DeleteZero(model.InterestRate.Value).Split('.')[0];
            InterestRateNum2 = ToolStatus.DeleteZero(model.InterestRate.Value).Contains(".") ? ToolStatus.DeleteZero(model.InterestRate.Value).Split('.')[1] : string.Empty;
            if (model.Status != 3 && model.Status != 6)
            {
                RemainMoney = (int.Parse(ToolStatus.diff(model.TotalShares ?? 0, model.CastedShares ?? 0)) * decimal.Parse(ToolStatus.DeleteZero(model.LowerUnit.Value))).ToString("N2");
            }
            else
            {
                RemainMoney = "0";
            }
            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);

            List <SubscribeTotalInfo> repaylist = new SubscribeBLL().GetRepaymentInfo(this.projectId.Value);

            if (repaylist != null && repaylist.Count > 0)
            {
                foreach (SubscribeTotalInfo item in repaylist)
                {
                    switch (item.status)
                    {
                    case 1:
                        repayedAmount = SafeConvert.ToDecimal(item.Amount) + SafeConvert.ToDecimal(item.InterestAmount);
                        break;

                    case 2:
                        overdueAmount = SafeConvert.ToDecimal(item.Amount) + SafeConvert.ToDecimal(item.InterestAmount);
                        break;

                    case 3:
                        duerepayAmount = SafeConvert.ToDecimal(item.Amount) + SafeConvert.ToDecimal(item.InterestAmount);
                        break;
                    }
                }
            }

            string jzsql     = "select isnull(AvgNetAssets,0) from VipMonthlyNetAssets with(nolock) where UserId=@UserId and ReportDate=@ReportDate";
            var    dyParamJZ = new Dapper.DynamicParameters();

            dyParamJZ.Add("@UserId", model.UserId.Value);
            dyParamJZ.Add("@ReportDate", DateTime.Now.AddMonths(-1).ToString("yyyy-MM-01"));
            this.monthJZ = TuanDai.DB.TuanDaiDB.QueryFirstOrDefault <decimal>(TdConfig.ApplicationName, TdConfig.DBReportWrite, jzsql, ref dyParamJZ);

            regulaSet     = new WebSettingBLL().GetWebSettingInfo("293A1C07-1D90-4D22-ADD4-39E6735DAC06");
            InterestModel = TuanDai.PortalSystem.Redis.ProjectRedis.GetProjectInterestMode(model.Type.Value, model.RepaymentType.Value);


            //  截标时间为NULL时候取审核时间  +4 天
            if (model.TenderDate == null)
            {
                WebSettingInfo set = new WebSettingBLL().GetWebSettingInfo("3F902315-6986-44FF-9F00-9D420C07FCDA");
                if (model.AddDate >= Convert.ToDateTime(set.Param4Value))
                {
                    model.TenderDate = Convert.ToDateTime(model.AuditDate == null ? model.AddDate : model.AuditDate).AddDays(2);
                }
                else
                {
                    model.TenderDate = Convert.ToDateTime(model.AuditDate == null ? model.AddDate : model.AuditDate).AddDays(4);
                }
            }


            if (model.AuditDate == null)
            {
                model.TenderStartDate = model.AddDate;
            }
            else
            {
                model.TenderStartDate = model.AuditDate;
            }

            return(true);
        }
Beispiel #4
0
        public void WXUpdateUserBasicInfo()
        {
            Guid                 userid         = WebUserAuth.UserId.Value;
            UserBLL              bll            = new UserBLL();
            UserBasicInfoInfo    BasciInfo      = bll.GetUserBasicInfoModelById(userid);
            UserBasicInfoExtInfo ExtInfo        = bll.GetUserBasicInfoExtInfo(userid);
            bool?                completeStatus = false;

            if (ExtInfo != null)
            {
                completeStatus = ExtInfo.IsCompletePersonalInfo;
            }
            else
            {
                ExtInfo = new UserBasicInfoExtInfo();
            }
            //string nickName = WEBRequest.GetFilterHTMLString("NickName");//昵称
            //string oldnickName = BasciInfo.NickName;
            ExtInfo.Graduation             = HttpContext.Current.Request["Graduation"];                              //最高学历
            ExtInfo.University             = StripHTML(HttpContext.Current.Request["University"]);                   //毕业院校
            ExtInfo.Marriage               = HttpContext.Current.Request["Marriage"];                                //婚姻状况
            ExtInfo.Address                = StripHTML(HttpContext.Current.Request["Address"]);                      //居住地址
            ExtInfo.OfficeDomain           = HttpContext.Current.Request["OfficeDomain"];                            //公司行业
            ExtInfo.OfficeScale            = HttpContext.Current.Request["OfficeScale"];                             //公司规模
            ExtInfo.Position               = StripHTML(HttpContext.Current.Request["Position"]);                     //职位
            ExtInfo.Salary                 = HttpContext.Current.Request["Salary"];                                  //月收入
            ExtInfo.IsHaveHouse            = Tool.SafeConvert.ToBoolean(HttpContext.Current.Request["IsHaveHouse"]); //是否购房
            ExtInfo.IsHaveCar              = Tool.SafeConvert.ToBoolean(HttpContext.Current.Request["IsHaveCar"]);   //是否购车
            ExtInfo.IsCompletePersonalInfo = true;
            ExtInfo.ContactName            = StripHTML(HttpContext.Current.Request["ContactName"]);                  //紧急联系人姓名
            ExtInfo.ContactTelNo           = StripHTML(HttpContext.Current.Request["ContactTelNo"]);
            ExtInfo.ContactRelationShip    = HttpContext.Current.Request["ContactRelationShip"];

            //if (string.IsNullOrEmpty(nickName))
            //{
            //    PrintJson("0", "请输入昵称");
            //    return;
            //}
            //if (bll.IsKeywordContainsInTitle(nickName))
            //{
            //    PrintJson("0", "昵称中存在敏感字符");
            //    return;
            //}
            //string nickNameRegex = "^[a-zA-Z0-9_\u4e00-\u9fa5]{2,12}$";
            //if (!System.Text.RegularExpressions.Regex.IsMatch(nickName, nickNameRegex))
            //{
            //    PrintJson("-7", "昵称必须为:2-12个中文、字母、数字、下划线!");
            //}
            //string commonRegex = "^[a-zA-Z0-9_\u4e00-\u9fa5]{2,30}";
            //if (!System.Text.RegularExpressions.Regex.IsMatch(ExtInfo.University, commonRegex))
            //{
            //    PrintJson("-10", "毕业院校必须为:2-30个中文、字母、数字、下划线!");
            //}
            //if (!System.Text.RegularExpressions.Regex.IsMatch(ExtInfo.Address, commonRegex))
            //{
            //    PrintJson("-11", "住址必须为:2-30个中文、字母、数字、下划线!");
            //}
            //if (!System.Text.RegularExpressions.Regex.IsMatch(ExtInfo.Position, commonRegex))
            //{
            //    PrintJson("-12", "职位必须为:2-30个中文、字母、数字、下划线!");
            //}
            //string contractNameRegex = "^[a-zA-Z_\u4e00-\u9fa5]{2,12}";
            //if (!System.Text.RegularExpressions.Regex.IsMatch(ExtInfo.ContactName, contractNameRegex))
            //{
            //    PrintJson("-8", "紧急联系人必须为:2-12个中文、字母、下划线!");
            //}
            //string contractTelNoRegex = "^[0-9-]{7,13}";
            //if (!System.Text.RegularExpressions.Regex.IsMatch(ExtInfo.ContactTelNo, contractTelNoRegex))
            //{
            //    PrintJson("-9", "联系人电话必须为:7-13位电话号码!");
            //}

            //SqlParameter[] paramDatas = new SqlParameter[] { new SqlParameter("@NickName", nickName), new SqlParameter("@Id", BasciInfo.Id) };
            //UserBasicInfoInfo model = bll.WXGetUserBasicInfo("NickName=@NickName and Id!=@Id", paramDatas);
            //if (model != null)
            //if (IsNickNameExists(nickName,BasciInfo.Id))
            //{
            //    PrintJson("0", "昵称已经被使用");
            //    return;
            //}
            if (string.IsNullOrEmpty(ExtInfo.Graduation))
            {
                PrintJson("0", "请选择最高学历");
                return;
            }
            if (string.IsNullOrEmpty(ExtInfo.University))
            {
                PrintJson("0", "请输入毕业学校");
                return;
            }
            if (string.IsNullOrEmpty(ExtInfo.Marriage))
            {
                PrintJson("0", "请选择婚姻状况");
                return;
            }
            if (string.IsNullOrEmpty(ExtInfo.Address))
            {
                PrintJson("0", "请输入居住地址");
                return;
            }
            if (string.IsNullOrEmpty(ExtInfo.OfficeDomain))
            {
                PrintJson("0", "请选择公司行业");
                return;
            }
            if (string.IsNullOrEmpty(ExtInfo.OfficeScale))
            {
                PrintJson("0", "请选择公司规模");
                return;
            }
            if (string.IsNullOrEmpty(ExtInfo.Position))
            {
                PrintJson("0", "请输入您的职位信息");
                return;
            }
            if (string.IsNullOrEmpty(ExtInfo.Salary))
            {
                PrintJson("0", "请选择月收入");
                return;
            }
            if (string.IsNullOrEmpty(ExtInfo.IsHaveHouse.ToString()))
            {
                PrintJson("0", "请选择是否购房");
                return;
            }
            if (string.IsNullOrEmpty(ExtInfo.IsHaveCar.ToString()))
            {
                PrintJson("0", "请选择是否购车");
                return;
            }
            //BasciInfo.NickName = nickName;

            int result = bll.WXUpdateUserBasicInfo(ExtInfo, BasciInfo);

            if (result > 0)
            {
                if (completeStatus != true)
                {
                    TuanDai.PortalSystem.BLL.VipGetWorthBLL.AddGetWorth(userid, (int)ConstString.UserGrowthType.CompleteInfomation, null, 0);
                }
                //if (nickName != oldnickName)
                //{
                //    WebLog log = new WebLog();
                //    log.AddDate = DateTime.Now;
                //    log.BusinessId = userid.ToString();
                //    log.BusinessTypeId = (int)ConstString.LogBusinessType.Edit;
                //    log.UserId = userid.ToString();
                //    log.UserTypeId = (int)ConstString.LogUserType.WebUser;
                //    log.HandlerTypeId = (int)ConstString.LogType.EditNickName;
                //    log.Content1 = "修改会员昵称:修改之前为 " + oldnickName + ",修改之后" + nickName;
                //    log.Id = Guid.NewGuid().ToString();
                //    WebLogInfo.WriteLoginHandler(log);
                //    //首次修改昵称加团币
                //    VipGetTuanBiTaskBLL.FirstMobifyNickName(userid);
                //}
                PrintJson("1", "修改成功");
            }
            else
            {
                PrintJson("-1", "修改失败");
            }
            //UpdateUserBasicInfo(BasciInfo, ExtInfo, strNickName);
        }
Beispiel #5
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);
            }
            borrowUserInfo      = userbll.GetUserBasicInfoModelById(model.UserId.Value);
            borrowerUserInfoExt = userbll.GetUserBasicInfoExtInfo(model.UserId.Value);

            //信用档案
            creditInfo    = CommUtils.GetBorrowerCreditData(model.UserId.Value);
            imageList     = CommUtils.GetProjectImages(this.projectId.Value);
            finishProcess = CommUtils.GetProjectProcess(model);

            this.GetUserDetailInfo();
            //风险等级
            switch (model.Rating)
            {
            case 1:
                this.rating = "<span style=\"color:Green;\">低</span>";
                break;

            case 2:
                this.rating = "<span style=\"color:Orange;\">中</span>";
                break;

            case 3:
                this.rating = "<span style=\"color:Red;\">高</span>";
                break;
            }

            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);
            allMonthBadrate  = calcrate(model.TotalSumShares ?? 0, model.badShares ?? 0);

            regulaSet     = new WebSettingBLL().GetWebSettingInfo("293A1C07-1D90-4D22-ADD4-39E6735DAC06");
            InterestModel = TuanDai.PortalSystem.Redis.ProjectRedis.GetProjectInterestMode(model.Type.Value, model.RepaymentType.Value);
            //截标时间为NULL时候取审核时间  +5 天
            if (model.TenderDate == null)
            {
                model.TenderDate = Convert.ToDateTime(model.AuditDate == null ? model.AddDate : model.AuditDate).AddDays(5);
            }
            else
            {
                model.TenderDate = model.TenderDate;
            }

            if (model.AuditDate == null)
            {
                model.TenderStartDate = model.AddDate;
            }
            else
            {
                model.TenderStartDate = model.AuditDate;
            }
            string sql = "select RiskAssessment,FundUse,RepaymentAssure from project_xd with(nolock) where ProjectId=@ProjectId";

            Dapper.DynamicParameters Parprojectxd = new Dapper.DynamicParameters();
            Parprojectxd.Add("@ProjectId", projectId);
            projectXDInfo = PublicConn.QuerySingle <Project_xdInfo>(sql, ref Parprojectxd);
            if (projectXDInfo == null)
            {
                projectXDInfo = new Project_xdInfo();
            }
            return(true);
        }