public static UserEnterpriseInfo GetBorrowerGuaranteeEnterprise(Guid borrowerUserId, DateTime AddDate) { string sql = "select * from UserInEnterprise with(nolock) where BorrowerUserId=@BorrowerUserId"; var dyParams = new Dapper.DynamicParameters(); dyParams.Add("@BorrowerUserId", borrowerUserId); List <UserInEnterpriseInfo> UserInEnterpriseList = PublicConn.QueryBySql <UserInEnterpriseInfo>(sql, ref dyParams); UserInEnterpriseInfo userInEnterprise; if (UserInEnterpriseList.Count() > 1) { userInEnterprise = UserInEnterpriseList.Where(p => p.CreateDate < AddDate).OrderByDescending(p => p.CreateDate).FirstOrDefault(); } else { userInEnterprise = UserInEnterpriseList.FirstOrDefault(); } if (userInEnterprise != null) { Guid EnterpriseUserId = userInEnterprise.EnterpriseUserId; // UserEnterprise userenter = db.UserEnterprise.FirstOrDefault(p => p.UserId == EnterpriseUserId); sql = "select * from UserEnterprise with(nolock) where UserId=@UserId"; dyParams = new Dapper.DynamicParameters(); dyParams.Add("@UserId", EnterpriseUserId); UserEnterpriseInfo userenter = PublicConn.QuerySingle <UserEnterpriseInfo>(sql, ref dyParams); return(userenter); } else { return(null); } }
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); } this.SubscribeUserCount = TuanDai.WXApiWeb.Common.WXInvest.WXGetSubscribeUserCount(this.projectId.Value); #region 获取担保公司 UserEnterpriseInfo userEnterprise = GetBorrowerGuaranteeEnterprise(this.model.UserId.Value, model.AddDate.Value); if (userEnterprise != null) { string sql = "select NickName from UserBasicInfo with(nolock) where id=@enterpriseuserid"; DynamicParameters args = new DynamicParameters(); args.Add("@enterpriseuserid", userEnterprise.UserId); this.EnterpriseName = PublicConn.QuerySingle <string>(sql, ref args); } else { if (model.Guarantors != null && model.Guarantors != "") { this.EnterpriseName = BusinessDll.business.GetAssureNameById(int.Parse(model.Guarantors.ToString())); } } #endregion return(true); }
private void GetContractInfo(string key) { string contactno = this.key; this.submodel = new SubscribeBLL().GetSubscribeInfoContractNo(contactno); if (submodel.AddDate < Convert.ToDateTime("2016-3-11")) { companyName = "广东俊特团贷网络信息服务股份有限公司"; } else { companyName = "东莞团贷网互联网科技服务有限公司"; } this.subBasicModel = userbll.GetUserBasicInfoModelById(submodel.SubscribeUserId.Value); this.proModel = projectbll.GetProjectDetailInfo(submodel.ProjectId.Value); //标信息 this.publisherModel = userbll.GetUserBasicInfoModelById(proModel.UserId.Value); //获取发布人信息 //普惠借款人基本信息 string sql = "select * from fq_ItemSetsProject with(nolock) where ProjectId=@ProjectId"; var dyParams = new Dapper.DynamicParameters(); dyParams.Add("@ProjectId", proModel.Id); itemProjectInfo = PublicConn.QuerySingle <Fq_ItemSetsProjectInfo>(sql, ref dyParams); RepaymentTypeDesc = ToolStatus.ConvertRepaymentType(proModel.RepaymentType.Value); if (WebUserAuth.UserId == publisherModel.Id) { this.subBasicModel.RealName = StringHandler.MaskStartPre(subBasicModel.RealName, 1); //出借人 this.subBasicModel.IdentityCard = StringHandler.MaskCardNo(subBasicModel.IdentityCard); //出借人身份证号 } else { this.itemProjectInfo.RealName = StringHandler.MaskStartPre(itemProjectInfo.RealName, 1); //借款人 this.itemProjectInfo.IdentityCard = StringHandler.MaskCardNo(itemProjectInfo.IdentityCard); //出借人身份证号 } UserEnterpriseInfo userEnterprise = GetBorrowerGuaranteeEnterprise(proModel.UserId.Value, proModel.AddDate.Value); if (userEnterprise != null) { // this.assureModel = this.db.AssureOrganization.FirstOrDefault(p => p.UserId == userEnterprise.UserId); string sql1 = "select * from AssureOrganization with(nolock) where UserId=@UserId"; var dyParams1 = new Dapper.DynamicParameters(); dyParams1.Add("@UserId", userEnterprise.UserId); PublicConn.QuerySingle <AssureOrganizationInfo>(sql1, ref dyParams1); } else { if (!string.IsNullOrEmpty(proModel.Guarantors)) { int gid = 0; int.TryParse(proModel.Guarantors, out gid); string sql2 = "select * from AssureOrganization with(nolock) where Id=@Id"; var dyParams2 = new Dapper.DynamicParameters(); dyParams2.Add("@Id", gid); assureModel = PublicConn.QuerySingle <AssureOrganizationInfo>(sql2, ref dyParams2); } } //印章小图片 if (assureModel != null) { this.assureModel.image = this.GetSmallImage(this.assureModel.image); } // string orgsql = " select c.RealName from dbo.fq_ItemSetsProject as a with(nolock) inner join dbo.Fq_OrgItemSets as b with(nolock) on a.itemid = b.id inner join UserBasicInfo as c with(nolock) on b.orgid = c.id where projectid = @projectid"; //args = new SqlParameter[] { new SqlParameter("projectid", proModel.Id) }; //org = db.ExecuteStoreQuery<Org>(orgsql, args).FirstOrDefault(); }
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); } ProjectXMBBLL xbmbll = new ProjectXMBBLL(); if (this.model.Type == 23) { rateRangeList = xbmbll.GetXMBRateContrastInfo(projectId.Value); } this.SubscribeUserCount = TuanDai.WXApiWeb.Common.WXInvest.WXGetSubscribeUserCount(this.projectId.Value); borrowerUserInfo = userbll.GetUserBasicInfoModelById(model.UserId.Value); #region 获取担保公司 UserEnterpriseInfo userEnterprise = GetBorrowerGuaranteeEnterprise(this.model.UserId.Value, model.AddDate.Value); if (userEnterprise != null) { string sql = "select NickName from UserBasicInfo with(nolock) where id=@enterpriseuserid"; DynamicParameters args = new DynamicParameters(); args.Add("@enterpriseuserid", userEnterprise.UserId); this.EnterpriseName = PublicConn.QuerySingle <string>(sql, ref args); } else { if (model.Guarantors != null && model.Guarantors != "") { this.EnterpriseName = BusinessDll.business.GetAssureNameById(int.Parse(model.Guarantors.ToString())); } } #endregion ProjectBLL projbll = new ProjectBLL(); xmbModel = projbll.GetProjectXMBInfo(projectId.Value); if (xmbModel == null) { xmbModel = new Project_XMB_Info(); } allMonthBadrate = calcrate(model.TotalSumShares ?? 0, model.badShares ?? 0); IsSMBGuQuan = xmbModel.Type == 1; //modify by shellben 2015-12-29 处理元旦活动加息,以下是规则 //2015-12-29 00:00至2016-1-25 24:00期间加息标的仅含“小微企业”“微团贷”“项目宝B” //加息幅度根据期限适配: //1-5个月:+1% //6-11个月:+1.5% //12个月及以上:+2% if (DateTime.Now >= DateTime.Parse("2015/12/29 00:00:00") && DateTime.Now < DateTime.Parse("2016/1/26 00:00:00")) { if (new int[] { 1, 3, 9, 10, 11, 22 }.Contains(model.Type ?? 0) && (model.TuandaiRate ?? 0) <= 0) { if (model.Deadline <= 5) { model.TuandaiRate = 1; } else if (model.Deadline >= 12) { model.TuandaiRate = 2; } else { model.TuandaiRate = 1.5; } } } return(true); }