Ejemplo n.º 1
0
        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.proModel = projectbll.GetProjectDetailInfo(submodel.ProjectId.Value);

            this.subBasicModel = userbll.GetUserBasicInfoModelById(submodel.SubscribeUserId.Value);//获取承接人信息

            string strSQL   = " Select top 1 * From t_SubScribeTransfer with(nolock) Where m_Id=@m_Id ";
            var    dyParams = new Dapper.DynamicParameters();

            dyParams.Add("@m_Id", submodel.TranId);
            t_SubScribeTransferInfo mSubScribeTransfer = PublicConn.QuerySingle <t_SubScribeTransferInfo>(strSQL, ref dyParams);

            mSubscribe = new SubscribeBLL().GetSubscribeById(mSubScribeTransfer.m_FromSubscribeId);


            if (this.mSubscribe.SubscribeUserId != WebUserAuth.UserId && this.submodel.SubscribeUserId != WebUserAuth.UserId)
            {
                HttpContext.Current.Response.Write("对不起,您没有权限查看此合同。");
                HttpContext.Current.Response.End();
            }

            this.publisherModel = userbll.GetUserBasicInfoModelById(mSubscribe.SubscribeUserId.Value);//获取转让人信息

            this.borrowModel = userbll.GetUserBasicInfoModelById(proModel.UserId.Value);

            if (WebUserAuth.UserId == publisherModel.Id)
            {
                this.subBasicModel.RealName     = StringHandler.MaskStartPre(subBasicModel.RealName, 1); //出借人
                this.subBasicModel.IdentityCard = StringHandler.MaskCardNo(subBasicModel.IdentityCard);  //出借人身份证号
            }
            else
            {
                this.publisherModel.RealName     = StringHandler.MaskStartPre(publisherModel.RealName, 1); //借款 人
                this.publisherModel.IdentityCard = StringHandler.MaskCardNo(publisherModel.IdentityCard);  //借款人身份证号
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 投资
        /// </summary>
        /// <param name="SubscribeId"></param>
        /// <returns></returns>
        public WXSubscribeInfo1 WXGetSubscribeInfo(Guid SubscribeId)
        {
            WXSubscribeInfo1 model = new WXSubscribeInfo1();

            string            cmdText  = @"SELECT s.Id AS SubscribeId,s.TranDate as AddDate,s.TenderMode,s.Status,o.IsBorrow,s.Amount,s.InterestAmount,s.ReceiveAmount,s.ReceiveInterest,
									ISNULL(s.TuandaiRedPacket,0) as TuandaiRedPacket, isnull(PublisherRedPacket,0) as PublisherRedPacket, s.ContractNo
								   FROM Subscribe s with(nolock)
								   LEFT JOIN OverDueRecord o with(nolock) ON s.Id=o.SubscribeId AND o.IsBorrow=0 and  isnull(o.IsHide,0)=0
                                   WHERE s.Id=@Id";
            var               paras    = new { Id = SubscribeId };
            DynamicParameters dyParams = new DynamicParameters();

            dyParams.Add("@Id", SubscribeId);
            model = PublicConn.QuerySingle <WXSubscribeInfo1>(cmdText, ref dyParams);

            return(model);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 根据手机号判断用户是否存在
        /// </summary>
        /// <param name="telNo"></param>
        /// <returns></returns>
        private bool UserExists(string telNo, Guid?userid = null)
        {
            string            sql  = "select count(1) from UserBasicInfo with(nolock) where TelNo=@TelNo";
            DynamicParameters pars = new DynamicParameters();

            pars.Add("TelNo", telNo);
            if (userid.HasValue)
            {
                sql += " and Id=@UserId";
                pars.Add("UserId", userid);
            }
            //int? r = TuanDaiDB.QueryFirstOrDefault<int?>(TuanDai.DB.ConnectionType.PCUserRead, sql, ref pars);
            //return r.HasValue && r > 0;
            int?r = PublicConn.QuerySingle <int?>(sql, ref pars);

            return(r.HasValue && r > 0);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// We计划
        /// </summary>
        /// <returns></returns>
        private ShowModel GetWeModel()
        {
            var    para = new Dapper.DynamicParameters();
            string sql  = string.Empty;

            //We计划
            sql = @"SELECT TOP 1 wp.Id, wp.ProductName,wp.IsWeFQB,isnull(wp.IsFTB,0) as IsFTB, wp.YearRate,wp.Deadline,wp.PlanAmount AS Amount,
                        wpd.RealOrderQty AS CastedShares,LowerUnit,wpd.TotalQty AS TotalShares,wpd.OrderCount,isnull(wp.TuandaiRedRate,0) as TuandaiRedRate,
                        isnull(wp.DeadType,1) as DeadType
                    FROM dbo.We_Product wp WITH(NOLOCK) 
                    INNER JOIN dbo.We_ProductDetail wpd WITH(NOLOCK) ON wp.Id = wpd.ProductId 
                    INNER JOIN dbo.We_ProductType wpt WITH(NOLOCK) ON wp.ProductTypeId = wpt.Id 
                    WHERE wp.StartDate<=getdate() and  wp.StatusId=1 and isnull(wp.IsNewHand,0)!=1 and  wpd.TotalQty > wpd.RealOrderQty  AND wpt.TypeWord NOT IN('D','E','F','R','Q','P','X','Y7','Z7'{0}) 
                    ORDER BY case when wp.IsFTB=1 then 0 else 1 end, YearRate DESC";
            var isOpenFTB = ConfigHelper.getConfigString("IsOpenFTB", "0");

            if (isOpenFTB == "0")
            {
                sql = string.Format(sql, ",'18','24'");
            }
            else
            {
                sql = string.Format(sql, "");
            }
            ShowModel model = PublicConn.QuerySingle <ShowModel>(sql, ref para);

            if (model != null)
            {
                model.ProductName = model.ProductName.GetCharLeft("(");

                if (model.IsWeFQB)
                {
                    model.DetailUrl = "/pages/invest/WE/WeFqb_detail.aspx?id=" + model.Id;
                }
                else if (model.IsFTB)
                {
                    model.DetailUrl = "/pages/invest/WE/WeFtb_detail.aspx?id=" + model.Id;
                }
                else
                {
                    model.DetailUrl = "/pages/invest/WE/WE_detail.aspx?id=" + model.Id;
                }
            }
            return(model);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 普通标
        /// </summary>
        /// <returns></returns>
        private ShowModel GetModel()
        {
            var    para = new Dapper.DynamicParameters();
            string sql  = string.Empty;

            //普通标
            sql = @"select top 1 Id,0 AS IsWeFQB,InterestRate AS YearRate,Deadline,DeadType,Amount,CastedShares,LowerUnit,TotalShares,Type as TypeId from project with(nolock) where IsNewHand!=1 and type != 15  AND AddDate>dateadd(day,-15,getdate()) and Status =2 order by InterestRate desc";
            ShowModel model = PublicConn.QuerySingle <ShowModel>(sql, ref para);

            if (model != null)
            {
                model.ProductName = invest_list.GetTypeName(model.TypeId, 1);
                model.DetailUrl   = "/pages/invest/detail.aspx?id=" + model.Id;
                model.OrderCount  = CommUtils.GetSubscribeUserCount(model.Id);
            }

            return(model);
        }
Ejemplo n.º 6
0
        private void GetContractInfo(string key)
        {
            string contactno = key;

            this.submodel = new SubscribeBLL().GetSubscribeInfoContractNo(contactno);

            if (submodel.AddDate < Convert.ToDateTime("2016-3-11"))
            {
                companyName = "广东俊特团贷网络信息服务股份有限公司";
            }
            else
            {
                companyName = "东莞团贷网互联网科技服务有限公司";
            }
            Dapper.DynamicParameters param = new Dapper.DynamicParameters();
            param = new Dapper.DynamicParameters();
            param.Add("@ProjectId", submodel.ProjectId);
            param.Add("@curUserId", WebUserAuth.UserId);
            string strSQL  = "select count(1) from project(nolock) where Id=@ProjectId and UserId=@curUserId";
            bool   isExist = PublicConn.QuerySingle <int>(strSQL, ref param) > 0;

            if (this.submodel.SubscribeUserId != WebUserAuth.UserId && !isExist)
            {
                HttpContext.Current.Response.Write("对不起,您没有权限查看此合同。");
                HttpContext.Current.Response.End();
                return;
            }
            this.subBasicModel  = userbll.GetUserBasicInfoModelById(submodel.SubscribeUserId.Value); //投资人信息
            this.proModel       = projectbll.GetProjectDetailInfo(submodel.ProjectId.Value);
            this.publisherModel = userbll.GetUserBasicInfoModelById(proModel.UserId.Value);          //借款人信息
            this.SharesPercent  = (publisherModel.NumberOfShares * 10000m / 100000000m * 100m).ToString("0.00");

            RepaymentTypeDesc = new Common.Contract().GetRepaymentTypeDesc(proModel.RepaymentType ?? 0);
            if (WebUserAuth.UserId == publisherModel.Id)
            {
                this.subBasicModel.RealName     = StringHandler.MaskStartPre(subBasicModel.RealName, 1); //出借人
                this.subBasicModel.IdentityCard = StringHandler.MaskCardNo(subBasicModel.IdentityCard);  //出借人身份证号
            }
            else
            {
                this.publisherModel.RealName     = StringHandler.MaskStartPre(publisherModel.RealName, 1); //借款 人
                this.publisherModel.IdentityCard = StringHandler.MaskCardNo(publisherModel.IdentityCard);  //借款人身份证号
            }
        }
Ejemplo n.º 7
0
        protected void LoadData()
        {
            Guid?          userId           = WebUserAuth.UserId;
            WeProductBLL   bll              = new WeProductBLL();
            WebSettingBLL  setbll           = new WebSettingBLL();
            WebSettingInfo setInfo1         = setbll.GetWebSettingInfo("5E08DFE3-6CED-4E71-8CF9-2A2E3BAC9036");
            WebSettingInfo setInfo2         = setbll.GetWebSettingInfo("06A6344D-E1FB-4AAA-890A-E39351D5E7A3");
            decimal        rewardInterest_1 = 0;

            string strSQL = "select ProductId, OrderDate, isnull(InvestedAmount,0) as InvestedAmount, isnull(TuandaiRedRate,0) as TuandaiRedRate  from dbo.We_Order with(nolock) where Id=@weOrderId";

            Dapper.DynamicParameters dyParams = new Dapper.DynamicParameters();
            dyParams.Add("@weOrderId", weOrderId);
            MyWePlanOrderInfo weOrderInfo = PublicConn.QuerySingle <MyWePlanOrderInfo>(strSQL, ref dyParams);

            //model = bll.GetWeProductInfo(weOrderInfo.ProductId);
            if (GlobalUtils.IsRedis && GlobalUtils.IsWePlanRedis)
            {
                string err         = string.Empty;
                var    weRedisInfo = TuanDai.RedisApi.Client.WePlanRedis.GetWePlanRedisByProductIdJson(weOrderInfo.ProductId,
                                                                                                       out err, TdConfig.ApplicationName);
                if (weRedisInfo != null)
                {
                    model = JsonConvert.DeserializeObject <WeProductDetailInfo>(weRedisInfo);
                }
                if (model == null || !string.IsNullOrEmpty(err))
                {
                    model = new WeProductBLL().GetWeProductInfo(weOrderInfo.ProductId);
                }
            }
            else
            {
                model = new WeProductBLL().GetWeProductInfo(weOrderInfo.ProductId);
            }
            DueInterestAmount = 0;

            //查询订单加息
            RewardRate += GetOrderJxRate(weOrderInfo.TuandaiRedRate, weOrderId.Value, userId.Value);

            rewardInterest_1   = GetInterest(weOrderInfo.InvestedAmount, model.Deadline ?? 0, GetOrderJxRate(weOrderInfo.TuandaiRedRate, weOrderId.Value, userId.Value));
            RewardInterest     = rewardInterest_1;
            DueInterestAmount  = GetInterest(weOrderInfo.InvestedAmount, model.Deadline ?? 0, model.YearRate ?? 0);
            DueInterestAmount += RewardInterest;
        }
Ejemplo n.º 8
0
        //债权转让
        protected void GetZQZRSubscribelist(Guid projectId)
        {
            var commandText = @"select UserName,NickName,Amount, TenderMode as OrderType,TenderMode,
                                SubscribeShares,TotalShares,LowerUnit,InterestRate,AddDate as OrderDate,TelNo
								from
								(
								select ROW_NUMBER() over(order by S.AddDate desc) as num_,C.UserName,C.TelNo as NickName,isnull(S.ReceiveAmount,0)+isnull(s.ReceiveInterest,0) as Amount,S.TenderMode,S.TranDate as AddDate
								,S.SubscribeShares,S.TotalShares,(isnull(D.m_TotalAmount,0)+dbo.f_TransferPriceCal(S.Id,isnull(D.m_TotalShares,0)))/isnull(D.m_TotalShares,0) as LowerUnit,
								isnull(dbo.f_TransferProjectRate(D.m_Id),0) as  InterestRate,isnull(S.IsAuto,0) as IsAuto,C.TelNo
								from 
								dbo.Subscribe S with(nolock)
								inner join UserBasicInfo C 
								on S.SubscribeUserId=C.Id
								inner join t_SubScribeTransfer as D 
								on D.m_id=S.TranId
								where s.tranid=@ProjectId
								) T where T.num_>@PageSize*(@PageIndex-1) and T.num_<=@PageSize*@PageIndex"                                ;

            DynamicParameters dyParams = new DynamicParameters();

            dyParams.Add("@ProjectId", projectId);
            dyParams.Add("@PageIndex", 1);
            dyParams.Add("@PageSize", 15);
            dataList = PublicConn.QueryBySql <SubscribeUserInfo>(commandText, ref dyParams);
            if (dataList.Any())
            {
                dataList.ForEach(o => o.OrderType = GetProjectTenderName(o.OrderType.ToInt(1)));
            }

            var commandTotalText = @"select COUNT(0)
									from dbo.Subscribe S with(nolock)
									--inner join dbo.Project P on S.ProjectId=P.Id
									inner join UserBasicInfo C on S.SubscribeUserId=C.Id 
									inner join t_SubScribeTransfer as D 
									on D.m_id=S.TranId
									where s.tranid=@ProjectId"                                    ;

            dyParams = new DynamicParameters();
            dyParams.Add("@ProjectId", projectId);
            int count = PublicConn.QuerySingle <int>(commandTotalText, ref dyParams);


            pageCount = GetPageCount(count);
        }
Ejemplo n.º 9
0
        protected bool GetData(int NewsId)
        {
            NewsBLL  bll     = new NewsBLL();
            NewsInfo model   = new NewsInfo();
            string   sqlText = "select top 1 Id,Title,Content,ClickNumber,AddDate,CategoryId from News where Id=@Id order by AddDate desc";
            var      param   = new DynamicParameters();

            param.Add("@Id", NewsId);
            model = PublicConn.QuerySingle <NewsInfo>(sqlText, ref param);

            if (model == null)
            {
                return(false);
            }
            strTitle   = model.Title;
            strContent = model.Content;
            strAddDate = (model.AddDate ?? DateTime.Today).ToString("yyyy年MM月dd日");
            return(true);
        }
Ejemplo n.º 10
0
        /// <summary>
        /// 获取新手标限制金额
        /// </summary>
        private void GetLimitInvestMoney()
        {
            string sql  = "SELECT Param1Value FROM WebSetting with(nolock) where id='FC5BAE60-716E-4344-9C10-F1E808064FC7'";
            var    para = new Dapper.DynamicParameters();

            limitInvest = PublicConn.QuerySingle <decimal>(sql, ref para);
            if (limitInvest >= 10000)
            {
                limitInvestStr = ToolStatus.DeleteZero(Math.Floor(limitInvest / 10000)) + "万";
            }
            else if (limitInvest >= 1000 && limitInvest < 10000)
            {
                limitInvestStr = ToolStatus.DeleteZero(Math.Floor(limitInvest / 1000)) + "千";
            }
            else
            {
                limitInvestStr = Math.Floor(limitInvest).ToString();
            }
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 获取奖品详情
        /// </summary>
        /// <returns></returns>
        private bool GetPrizeDetail()
        {
            var dyParams = new DynamicParameters();

            string strSQL = string.Format(@"SELECT Id,SKU,ProductName,ActivityName,ISNULL(ActivityUrl,'') ActivityUrl,
                                                    MarketPrice,ISNULL(Remark,'') Remark,ImageUrl,Description,
                                                    CreateDate,SortOrder,
                                                    CASE Upselling WHEN 1 THEN '已上架'
                                                    ELSE '已下架' END  as Upselling
                                                    FROM Mall_Product with(nolock) WHERE 1=1 AND Id=@Id

                                                    SELECT TOP 15 ProductName,ImageUrl FROM Mall_Product WHERE Upselling=1 
                                                    AND Id NOT IN (@Id)
                                                    ORDER BY SortOrder,CreateDate DESC ");

            dyParams.Add("@Id", PrizeId);
            var _PrizeModels      = PublicConn.QuerySingle <Mall_ProductInfo>(strSQL, ref dyParams);
            var _OtherPrizeModels = PublicConn.QueryBySql <Mall_ProductImage>(strSQL, ref dyParams);

            if (_PrizeModels == null)
            {
                return(false);
            }
            else
            {
                Model.ImageUrl     = _PrizeModels.ImageUrl;
                Model.ProductName  = _PrizeModels.ProductName;
                Model.MarketPrice  = _PrizeModels.MarketPrice == null ? "0.00" : Convert.ToString(_PrizeModels.MarketPrice);
                Model.Remark       = _PrizeModels.Remark;
                Model.ActivityName = _PrizeModels.ActivityName;
                Model.ActivityUrl  = _PrizeModels.ActivityUrl;
                Model.Description  = _PrizeModels.Description;
                if (_OtherPrizeModels != null && _OtherPrizeModels.Count() > 0)
                {
                    Model.OtherPrizes = _OtherPrizeModels;
                }
                else
                {
                    Model.OtherPrizes = null;
                }
                return(true);
            }
        }
Ejemplo n.º 12
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Guid userId = WebUserAuth.UserId.Value;
         if (userId == Guid.Empty || userId == null)
         {
             Response.Redirect("/user/Login.aspx?ReturnUrl=" + Request.RawUrl, true);
         }
         else
         {
             var model = new UserBLL().GetUserBasicInfoModelById(userId);
             IsIdentity = model.IsValidateIdentity;
             if (!string.IsNullOrEmpty(model.BankAccountNo))
             {
                 IsBankCard = true;
             }
             else
             {
                 if (GlobalUtils.IsOpenCGT)
                 {
                     var bankInfo = GlobalUtils.GetBankInfo(userId);
                     if (!string.IsNullOrEmpty(bankInfo.BankNo))
                     {
                         IsBankCard = true;
                     }
                 }
                 else
                 {
                     string sql  = @"SELECT BankNo FROM UserBankInfo WITH(NOLOCK) WHERE UserId = @UserId ";
                     var    para = new Dapper.DynamicParameters();
                     para.Add("@UserId", userId);
                     var cardNo = PublicConn.QuerySingle <string>(sql, ref para);
                     if (!string.IsNullOrEmpty(cardNo))
                     {
                         IsBankCard = true;
                     }
                 }
             }
         }
     }
 }
Ejemplo n.º 13
0
        /// <summary>
        /// 获取邀请人数
        /// add by linhelin
        /// 2016-08-26
        /// </summary>
        /// <returns></returns>
        private int GetInvitationCount()
        {
            WebSettingInfo timeset             = new WebSettingBLL().GetWebSettingInfo("CF25D857-6144-4242-AA51-1227D5918024");
            DateTime       NewPartnerBeginDate = DateTime.Parse(timeset.Param1Value);
            DateTime       NewPartnerEndDate   = DateTime.Parse(timeset.Param2Value);

            int count = 0;

            string sql = @"SELECT COUNT(1)
                                FROM dbo.ExtenderRelation(nolock) r 
                                LEFT JOIN dbo.UserBasicInfo(nolock) u ON u.Id = r.UserId 
                                WHERE r.ExtenderKey =@extendkey AND r.AddDate >= @begintime --AND r.AddDate < @activityEndTime";

            Dapper.DynamicParameters whereParame = new Dapper.DynamicParameters();
            whereParame.Add("@extendkey", extendkey);
            whereParame.Add("@begintime", NewPartnerBeginDate);
            whereParame.Add("@activityEndTime", NewPartnerEndDate);
            count = PublicConn.QuerySingle <int?>(sql, ref whereParame) ?? 0;
            return(count);
        }
Ejemplo n.º 14
0
        private void GetContractInfo(string key)
        {
            string contactno = this.key;
            string strSQL    = @"SELECT a.ProductName, a.PlanAmount,a.ProjectTypes,a.Deadline,b.RepeatInvestType,
                             b.YearRate, b.MinYearRate, a.StartDate,a.UnitAmount, b.Amount as JoinAmount, b.OrderQty,
                             b.UserId, b.OrderDate, c.TypeWord, a.ProductTypeId,a.ExitLockMonth, isnull(b.DeadType,1) as DeadType
                             FROM dbo.We_Product a WITH(NOLOCK)
                             left JOIN dbo.We_Order b WITH(NOLOCK) on b.ProductId=a.Id
                             inner join We_ProductType c  WITH(NOLOCK) on c.Id=a.ProductTypeId
                             WHERE b.Id=@WeOrderId ";
            var    dyParams  = new Dapper.DynamicParameters();

            dyParams.Add("@WeOrderId", contactno);
            model = PublicConn.QuerySingle <MyWeOrderInfo>(strSQL, ref dyParams);
            if (model == null)
            {
                model = new MyWeOrderInfo();
            }

            this.subBasicModel = userbll.GetUserBasicInfoModelById(model.UserId);
        }
Ejemplo n.º 15
0
        private void BindProjectXMB()
        {
            string sqlText =
                @"SELECT ProjectId,AmountUsedDesc,ProjectDescription,InvestRange,InvestHighlight,ProjectProspect,ProfitBudget,RepaymentSecurity
                 from Project_XMB where  ProjectId=@ProjectId";
            var para = new Dapper.DynamicParameters();

            para.Add("@ProjectId", ProductId);//"5A234E16-B321-D324-AAAA-11111FF82344"
            Project_XMB xmbinfo = PublicConn.QuerySingle <Project_XMB>(sqlText, ref para);

            if (xmbinfo != null)
            {
                AmountUsedDesc     = xmbinfo.AmountUsedDesc;
                ProjectDescription = xmbinfo.ProjectDescription;
                InvestRange        = xmbinfo.InvestRange;
                ProjectProspect    = xmbinfo.ProjectProspect;
                RepaymentSecurity  = xmbinfo.RepaymentSecurity;
                ProfitBudget       = xmbinfo.ProfitBudget;
                InvestHighlight    = xmbinfo.InvestHighlight;
            }
        }
Ejemplo n.º 16
0
        /// <summary>
        /// 获取企业信息
        /// </summary>
        protected void GetBusinessRange(Guid projectId)
        {
            DynamicParameters dyParams = new DynamicParameters();

            dyParams.Add("@projectid", projectId);
            string sql = @"select A.EnterpriseName,A.OpeningDate,A.RegisteredCapital,A.RegistrationNo,A.RegistrationAuthority,a.CreateDate, A.BusinessRange from dbo.UserEnterprise  A with(nolock)  
                inner join dbo.Project D with(nolock) on A.UserId=D.UserId
                where D.Id=@projectid";

            UserEnterpriseInfo = PublicConn.QuerySingle <UserEnterprise1>(sql, ref dyParams);
            if (UserEnterpriseInfo == null)
            {
                UserEnterpriseInfo                       = new UserEnterprise1();
                UserEnterpriseInfo.OpeningDate           = DateTime.Now;
                UserEnterpriseInfo.CreateDate            = DateTime.Now;
                UserEnterpriseInfo.EnterpriseName        = "未填写";
                UserEnterpriseInfo.RegisteredCapital     = 0;
                UserEnterpriseInfo.RegistrationNo        = "未填写";
                UserEnterpriseInfo.RegistrationAuthority = "未填写";
                UserEnterpriseInfo.BusinessRange         = "未填写";
            }
        }
Ejemplo n.º 17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //Response.Redirect(GlobalUtils.WebURL + "/pages/APPCreateImage.aspx?functionType=" + functionType + "&tdfrom=" + tdfrom + "&extendkey="+extendkey);
            if (functionType != 0)
            {
                string            strSQL      = "SELECT [ShareUrl] FROM dbo.SharedSetting(nolock) WHERE IsEnabled=1 AND functionType=@functionType and ShareToolType=7 order by SEQUENCE";
                string            shareUrl    = string.Empty;
                DynamicParameters whereParams = new DynamicParameters();
                whereParams.Add("@functionType", functionType);

                shareUrl = PublicConn.QueryActivitySingle <string>(strSQL, ref whereParams);
                shareUrl = shareUrl.ToText();

                shareUrl  = shareUrl + (string.IsNullOrEmpty(tdfrom) ? "" : string.Format("?tdfrom={0}", tdfrom));
                shareUrl += string.IsNullOrEmpty(extendkey) ? "" : (string.IsNullOrEmpty(tdfrom) ? "?" : "&") + string.Format("extendkey={0}", extendkey);
                shareUrl  = shareUrl + "&type=mobileapp";
                string imageShareUrl = APPCreateImageBase64Str(shareUrl);
                Image2.ImageUrl = imageShareUrl;
                Image2.Visible  = string.IsNullOrEmpty(imageShareUrl) ? false : true;

                if (!string.IsNullOrEmpty(imageShareUrl))
                {
                    isEnable = true;
                    string            strHeadImageSQL = "SELECT HeadImage FROM UserBasicInfo(nolock)  WHERE  ExtendKey=@ExtendKey";
                    DynamicParameters HeadImageParams = new DynamicParameters();
                    HeadImageParams.Add("@ExtendKey", extendkey);
                    string headImageUrl = string.Empty;

                    headImageUrl = PublicConn.QuerySingle <string>(strHeadImageSQL, ref HeadImageParams);

                    headImage = !string.IsNullOrEmpty(headImageUrl) ? headImageUrl : headImage;
                }
            }
            else
            {
                Image2.Visible = false;
            }
        }
Ejemplo n.º 18
0
        /// <summary>
        /// 获取昨日收益及待收冠军
        /// </summary>
        private void GetData()
        {
            var value = TuanDai.PortalSystem.Redis.mRedis.GetYesterdayIncome(WebUserAuth.UserId.Value);

            if (value != null && value.HasValue)
            {
                YesterdayIncome = value.Value;
            }
            else
            {
                YesterdayIncome = new UserYesterdayIncomeBLL().GetYesterdayIncome(WebUserAuth.UserId.Value);
            }

            string isql = "select DueComeInterest,UserId from FundAccountInfo with(nolock) where userid='4B18182D-EA61-4A9C-9DCE-1CEC86C12213'";
            var    par  = new Dapper.DynamicParameters();

            sa = PublicConn.QuerySingle <SimpleAccount>(isql, ref par);

            if (sa != null)
            {
                ubi = new UserBLL().GetUserBasicInfoModelById(sa.UserId);
            }
            else
            {
                sa  = new SimpleAccount();
                ubi = new UserBasicInfoInfo();
            }

            if (model == null)
            {
                model = GetWeModel();
            }
            if (model == null)
            {
                model = GetModel();
            }
        }
Ejemplo n.º 19
0
 protected void GetUserBankInfo()
 {
     if (GlobalUtils.IsBankService)
     {
         var bankInfoFromJava = new BankFromJavaService().GetBankInfo(UserId, ServiceType.TuoMin);
         if (bankInfoFromJava != null && bankInfoFromJava.respData != null)
         {
             bankNo   = bankInfoFromJava.respData.bankNo;
             BankName = bankInfoFromJava.respData.bankName;
             PreTelNo = bankInfoFromJava.respData.mobileNo;
         }
         else
         {
             Response.Redirect("/Member/cgt/cgtBindCard.aspx");
         }
     }
     else
     {
         string strSQL   = " SELECT BankAccountNo ,BankType FROM dbo.UserBasicInfo WITH(NOLOCK) where Id=@userId ";
         var    dyParams = new Dapper.DynamicParameters();
         dyParams.Add("@userId", UserId);
         var bankModel = PublicConn.QuerySingle <BankNoInfo>(strSQL, ref dyParams);
         if (bankModel == null)
         {
             bankModel = new BankNoInfo()
             {
             };
         }
         bankNo = bankModel.BankAccountNo;
         GlobalUtils.GetBankImg(UserId, out BankName);
         cgt_user_UserExt_Info cgtUser = new QueryClient().GetUserByPlatformUserNo(UserId);
         if (cgtUser != null)
         {
             PreTelNo = cgtUser.mobile;
         }
     }
 }
Ejemplo n.º 20
0
        //所有We冻结资金
        public decimal GetWePlanWaitInvestment(Guid userId)
        {
            decimal weWaitInvestment;
            var     dyParams = new Dapper.DynamicParameters();

            dyParams.Add("@userId", userId);
            string strSQL = @"SELECT SUM(a.OrderAviAmount)
                     FROM We_Order a with(nolock) 
                     where a.UserId=@userId and a.StatusId in (0,1,2,4) and a.IsRefund=0";

            weWaitInvestment = PublicConn.QuerySingle <decimal?>(strSQL, ref dyParams) ?? 0;

            //We计划分期宝已回款待投冻结金额
            string sql = @"SELECT isnull(SUM(OrderAviAmount),0) FROM(
                    SELECT ISNULL(B.OrderAviAmount,0) AS OrderAviAmount
                    FROM dbo.We_Order a WITH(NOLOCK)
                    left JOIN We_OrderExtFQB b WITH(NOLOCK) on b.OrderId=a.Id AND b.UserId=a.UserId and b.StatusId=0
                    WHERE  a.StatusId in (0,1,2,4) and a.UserId=@userId and isnull(a.IsWeFQB,0)=1 
                    ) AS main";

            weWaitInvestment += TuanDai.DB.TuanDaiDB.QueryFirstOrDefault <decimal>(TdConfig.ApplicationName, TdConfig.DBRead, sql,
                                                                                   ref dyParams);
            return(weWaitInvestment);
        }
Ejemplo n.º 21
0
        protected bool GetData()
        {
            UserBLL userbll = new UserBLL();

            //获取项目信息
            model = bll.GetProjectDetailInfo(projectId.Value);
            if (model == null || !(model.Type == 30))
            {
                Response.Redirect(GlobalUtils.WebURL + "/Member/my_account.aspx");
                return(false);
            }


            var dyParams = new DynamicParameters();

            dyParams.Add("@userid", model.UserId);
            var strSQL = "select * from UserBasicInfo with(nolock) where Id=@userid";

            borrowUserInfo = PublicConn.QuerySingle <UserBasicInfoInfo>(strSQL, ref dyParams);

            dyParams = new DynamicParameters();
            dyParams.Add("@ProjectId", model.Id);

            string querySql = string.Format(@"SELECT  a.ID ,
                                                a.ItemID ,
                                                a.ItemName ,
                                                a.AddDate ,
                                                a.ProjectId ,
                                                a.Amount ,
                                                a.Deadline ,
                                                a.RealName ,
                                                a.IdentityCard ,
                                                a.TelNo ,
                                                a.MonthlyIncome ,
                                                a.Education ,
                                                a.Address ,
                                                a.IsHaveHouse ,
                                                a.ContractNo ,
                                                a.UserName ,
                                                a.InterestRate ,
                                                a.UserID ,
                                                a.OldProjectID ,
                                                a.Title ,
                                                a.StatusId ,
                                                a.FlowCount ,
                                                a.WithdrewStatus ,
                                                a.OrgId ,
                                                a.BorrowerInAmount ,
                                                a.OrgInAmount ,
                                                a.GuarantorInAmount ,
                                                a.TdInAmount ,
                                                a.WithdrawID ,
                                                a.WithdrawNumber ,
                                                a.IsSyncedFullScale ,
                                                a.ProjectType ,
                                                a.RepaymentType,
                                                b.MarrayStatus,
                                                b.HouseSituation,b.IsHaveChildren,b.BorrowerType
                                        FROM    dbo.fq_ItemSetsProject a WITH ( NOLOCK )
                                                INNER JOIN fq_ItemSetsProject_NiWoJinrong b WITH ( NOLOCK ) ON a.ID = b.ItemProjectId
                                        WHERE   ProjectId = @ProjectId
                                                OR CHARINDEX('{0}', OldProjectID) > 0", projectId);

            fq_ItemSetsProjectInfo = PublicConn.QuerySingle <Fq_nwjr_ItemSetsProjectInfo>(querySql, ref dyParams);

            //信用档案
            creditInfo    = CommUtils.GetBorrowerCreditData(model.UserId.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);
            InterestModel    = TuanDai.PortalSystem.Redis.ProjectRedis.GetProjectInterestMode(model.Type.Value, model.RepaymentType.Value);
            return(true);
        }
Ejemplo n.º 22
0
        protected bool GetData()
        {
            UserBLL userbll = new UserBLL();

            //获取项目信息
            model = bll.GetProjectDetailInfo(projectId.Value);
            if (model == null || (model.Type != 29))
            {
                Response.Redirect(GlobalUtils.WebURL + "/Member/my_account.aspx");
                return(false);
            }

            string strSQL = @"select b.OrgId,b.ShortName, ProjectDesc,OrgDecription,ProjectDescription,ProjectRiskDesc from dbo.fq_ItemSetsProject  a with(nolock)
                            INNER JOIN dbo.fq_Organization b ON a.OrgId=b.OrgId
                            WHERE   projectid = @projectid OR CHARINDEX(@projectid,OldProjectID)>0";

            DynamicParameters dyParams = new DynamicParameters();

            dyParams.Add("@projectid", model.Id.ToString());
            organization = PublicConn.QuerySingle <Organizations>(strSQL, ref dyParams);
            if (organization == null)
            {
                organization           = new Organizations();
                organization.ShortName = "沐金农";
            }

            dyParams = new DynamicParameters();
            dyParams.Add("@userid", model.UserId);
            strSQL         = "select * from UserBasicInfo with(nolock) where Id=@userid";
            borrowUserInfo = PublicConn.QuerySingle <UserBasicInfoInfo>(strSQL, ref dyParams);

            dyParams = new DynamicParameters();
            dyParams.Add("@ProjectId", model.Id);
            strSQL = string.Format(@"SELECT a.*,b.Profession,b.HouseSituation,b.BorrowerType,b.FarmingLand,b.LastZJBTAmount,b.LastNJGZBTAmount,b.LastLZBTAmount,b.Plant,b.BreedDes FROM dbo.fq_ItemSetsProject a with(nolock)
								   inner join fq_ItemSetsProject_mjn b with(nolock) on a.ID=b.ItemProjectId
								    WHERE ProjectId=@ProjectId OR CHARINDEX('{0}',OldProjectID)>0"                                , model.Id);
            fq_ItemSetsProjectInfo = PublicConn.QuerySingle <Fq_mjn_ItemSetsProjectInfo>(strSQL, ref dyParams);


            //信用档案
            creditInfo    = CommUtils.GetBorrowerCreditData(model.UserId.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);

            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;
            }
            return(true);
        }
Ejemplo n.º 23
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);
            }

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

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

            case 3:
                rating = "<span style=\"color:Red;\">高</span>";
                break;
            }
            GetBorrowUserInfo();

            WebSettingBLL setbll = new WebSettingBLL();
            //新手加息判断
            WebSettingInfo GylSetInfo = setbll.GetWebSettingInfo("5AC96A83-B678-4191-BADB-C39C02DFEBB5");

            if (GylSetInfo != null)
            {
                GylPlusRate   = Tool.StrObj.StrToDecimalDef(GylSetInfo.Param3Value, 0);
                Day15PlusRate = Tool.StrObj.StrToDecimalDef(GylSetInfo.Param4Value, 0);
            }
            if (this.model.DeadType.Value == 2 && (this.model.Deadline == 7 && GylPlusRate > 0) || (this.model.Deadline == 15 && Day15PlusRate > 0))
            {
                IsShowPlusRate = true;
            }

            DynamicParameters dyParams;
            string            sql = "";

            if (WebUserAuth.IsAuthenticated && IsShowPlusRate)
            {
                //判断是否投资新手
                sql      = "select count(1) from Subscribe with(Nolock) where SubscribeUserId=@userid";
                dyParams = new DynamicParameters();
                dyParams.Add("@userid", WebUserAuth.UserId.Value);

                bool IsNewHand = PublicConn.QuerySingle <int>(sql, ref dyParams) == 0;
                NewHandRate = IsNewHand ? (this.model.Deadline == 7 ? GylPlusRate : Day15PlusRate) : 0;
            }

            dyParams = new DynamicParameters();
            dyParams.Add("@projectid", projectId);
            sql            = @"select  ProjectID,ProjectDesc2,CreditStatus,EnterpriseCredit,OperatingConditions,RoyalRiskAbility from dbo.Project_GYL with(nolock) where ProjectID=@projectid";
            ProjectGylInfo = PublicConn.QuerySingle <Project_GYLInfo>(sql, ref dyParams);
            if (ProjectGylInfo != null)
            {
                OverallRanking = setbll.GetWebSettingInfo(new Guid("A874BE7E-492F-4A21-9064-B75CA16D2DF3").ToString());
            }
            if (ProjectGylInfo != null)
            {
                TotalCreditScore = ProjectGylInfo.CreditStatus + ProjectGylInfo.EnterpriseCredit + ProjectGylInfo.OperatingConditions + ProjectGylInfo.RoyalRiskAbility;
            }



            GetBusinessRange(model.Id);
            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);
            InterestModel    = TuanDai.PortalSystem.Redis.ProjectRedis.GetProjectInterestMode(model.Type.Value, model.RepaymentType.Value);
            return(true);
        }
Ejemplo n.º 24
0
        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();
        }
Ejemplo n.º 25
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);
            }

            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);
        }
Ejemplo n.º 26
0
        private void GetContractInfo(string key)
        {
            string contactno = key;

            this.submodel = new SubscribeBLL().GetSubscribeInfoContractNo(contactno);
            if (submodel.AddDate < Convert.ToDateTime("2016-3-11"))
            {
                companyName = "广东俊特团贷网络信息服务股份有限公司";
            }
            else
            {
                companyName = "东莞团贷网互联网科技服务有限公司";
            }

            Dapper.DynamicParameters param = new Dapper.DynamicParameters();
            param = new Dapper.DynamicParameters();
            param.Add("@projectId", submodel.ProjectId);
            param.Add("@curUserId", WebUserAuth.UserId);
            string strSQL  = "select Count(1) from project where Id=@projectId and UserId=@curUserId";
            bool   isExist = PublicConn.QuerySingle <int>(strSQL, ref param) > 0;

            if (this.submodel.SubscribeUserId != WebUserAuth.UserId && !isExist)
            {
                HttpContext.Current.Response.Write("对不起,您没有权限查看此合同。");
                HttpContext.Current.Response.End();
                return;
            }
            this.subBasicModel  = userbll.GetUserBasicInfoModelById(submodel.SubscribeUserId.Value); //投资人信息
            this.proModel       = projectbll.GetProjectDetailInfo(submodel.ProjectId.Value);
            this.publisherModel = userbll.GetUserBasicInfoModelById(proModel.UserId.Value);          //借款人信息

            ProjectsmEntity = new Common.Contract().GetProjectSM(proModel.Id);                       //获取私募宝信息

            UserEnterpriseInfo userEnterprise = new Common.Contract().GetBorrowerGuaranteeEnterprise(proModel.UserId.Value, proModel.AddDate.Value, proModel.Type.Value);

            if (userEnterprise != null)
            {
                AssureModel = new Common.Contract().GetAssureOrganizationByUserId(userEnterprise.UserId);
            }
            else
            {
                int gid = 0;
                int.TryParse(proModel.Guarantors, out gid);
                AssureModel = new Common.Contract().GetAssureOrganizationById(gid);
                if (gid == 1 && DateTime.Now < DateTime.Parse("2013-11-27"))
                {
                    AssureModel.FullName = "东莞市俊特团贷网络信息服务有限公司";
                }
            }

            //印章小图片
            this.AssureModel.image = new Common.Contract().GetSmallImage(this.AssureModel.image);

            RepaymentTypeDesc = new Common.Contract().GetRepaymentTypeDesc(proModel.RepaymentType ?? 0);

            if (WebUserAuth.UserId == publisherModel.Id)
            {
                this.subBasicModel.RealName     = StringHandler.MaskStartPre(subBasicModel.RealName, 1); //出借人
                this.subBasicModel.IdentityCard = StringHandler.MaskCardNo(subBasicModel.IdentityCard);  //出借人身份证号
            }
            else
            {
                this.publisherModel.RealName     = StringHandler.MaskStartPre(publisherModel.RealName, 1); //借款 人
                this.publisherModel.IdentityCard = StringHandler.MaskCardNo(publisherModel.IdentityCard);  //借款人身份证号
            }
        }
Ejemplo n.º 27
0
        protected SortedDictionary <string, string> getBaseParamDict()
        {
            if (WebUserAuth.UserId != Guid.Empty)
            {
                userid = WebUserAuth.UserId.Value;
            }
            else
            {
                Response.Redirect("~/user/login.aspx");
                return(null);
            }

            /**订单信息**/
            // 商户唯一订单号
            string no_order = "" + Request.QueryString["orderno"];
            // 商户订单时间
            string dt_order = PaymentUtil.GetCurrentDateTimeStr();

            AccountRechareInfo rechargemodel = getAccountRechare(no_order);

            if (rechargemodel == null)
            {
                return(null);
            }
            // 交易金额 单位为RMB-元
            string money_order = rechargemodel.Amount.ToString("f2");

            // 商品名称
            string name_goods = "Online Recharge";

            // 订单描述
            string info_order = "Online Recharge";


            //var userInfo = db.UserBasicInfo.FirstOrDefault(x => x.AuditRecordId == userid);
            //if (null == userInfo)
            //{

            //}
            SortedDictionary <string, string> sParaTemp = new SortedDictionary <string, string>();

            try
            {
                UserBLL bll = new UserBLL();
                userInfo = bll.GetUserBasicInfoModelById(userid);
                //从UserBasicInfo表获取银行卡号
                if (string.IsNullOrEmpty(userInfo.BankAccountNo))
                {
                    string            sql  = @"SELECT BankAccountNo as BankNo FROM UserBasicInfo WITH(NOLOCK) WHERE Id = @UserId ";
                    DynamicParameters para = new DynamicParameters();
                    para.Add("@UserId", userid);
                    userInfo.BankAccountNo = PublicConn.QuerySingle <string>(sql, ref para);
                }
                /** 商户提交参数**/
                string version     = partnerConfig.Version;             //接口版本号
                string oid_partner = partnerConfig.OidPartner;          //商户编号
                user_id = userid.ToString();                            //用户ID
                string sign_type    = partnerConfig.SignType;           //签名类型:RSA/MD5
                string busi_partner = partnerConfig.BusiPartner;        //业务类型 虚拟商品销售
                // string notify_url = ConfigurationManager.AppSettings["WebUrl"] + "/PaymentPlatform/lianlian/notify_url.aspx";//接收异步通知地
                string notify_url = "https://www.tuandai.com/PaymentPlatform/lianlian/notify_url.aspx";

                string url_return = ConfigurationManager.AppSettings["WebUrl"] + "/PaymentPlatform/lianlian/urlReturn.aspx"; //支付结束后返回地址

                string userreq_ip = PaymentUtil.LocalIPAddress();                                                            //IP *
                //string url_order = "";
                string valid_order = "10080";                                                                                // 订单有效期 单位分钟,可以为空,默认7天
                string timestamp   = PaymentUtil.GetCurrentDateTimeStr();                                                    //时间戳
                //string idType = "0"; //证件类型
                string idNo = userInfo.IdentityCard;                                                                         //"623026199206016992";
                acctName = userInfo.RealName;                                                                                //"彭思微";
                telno    = userInfo.TelNo;



                sParaTemp.Add("app_request", "3");
                sParaTemp.Add("bg_color", "d93f3f");
                sParaTemp.Add("busi_partner", busi_partner);
                sParaTemp.Add("card_no", userInfo.BankAccountNo);
                sParaTemp.Add("dt_order", dt_order);
                sParaTemp.Add("id_no", idNo);
                sParaTemp.Add("info_order", info_order);
                sParaTemp.Add("money_order", money_order);
                sParaTemp.Add("name_goods", name_goods);
                //sParaTemp.Add("no_agree", "");
                sParaTemp.Add("no_order", no_order);
                sParaTemp.Add("notify_url", notify_url);
                sParaTemp.Add("oid_partner", oid_partner);
                sParaTemp.Add("acct_name", acctName);
                sParaTemp.Add("risk_item", createRiskItem(userid, acctName, idNo, userInfo.TelNo, userInfo.AddDate.Value.ToString("yyyyMMddHHmmss")));
                //    sParaTemp.Add("risk_item", createRiskItemOld(user_id, acctName));
                sParaTemp.Add("sign_type", sign_type);
                sParaTemp.Add("url_return", url_return);
                sParaTemp.Add("user_id", telno);
                sParaTemp.Add("valid_order", valid_order);

                NetLog.WriteBatchwithdrawHandler("连连充值请求", string.Concat("签名方式", sign_type, "订单号:", no_order, ",用户编号:", user_id, "充值金额", money_order, "IP地址", userreq_ip), "触屏版");
                //LogHelper.WriteLog("连连充值请求", "", string.Concat("签名方式", sign_type, "订单号:", no_order, ",用户编号:", user_id, "充值金额", money_order, "IP地址", userreq_ip));
            }
            catch (Exception ex)
            {
                string errormessage = "内部错误:" + ex.InnerException + "\r\n堆栈:" + ex.StackTrace + "\r\n信息:" + ex.Message + "\r\n来源:" + ex.Source;
                //LogTextHelper.Instance.AddLog(errormessage);
                TuanDai.LogSystem.LogClient.LogClients.ErrorLog("WXTouch", "连连充值请求", "", errormessage);
            }
            return(sParaTemp);
        }
Ejemplo n.º 28
0
        private void GetContractInfo(string key)
        {
            string contactno = this.key;

            this.submodel = new SubscribeBLL().GetSubscribeByContractNo(WebUserAuth.UserId.Value, contactno);
            //db.Subscribe.First(p => p.ContractNo == contactno);  //申购
            if (submodel.AddDate < Convert.ToDateTime("2016-3-11"))
            {
                companyName = "广东俊特团贷网络信息服务股份有限公司";
            }
            else
            {
                companyName = "东莞团贷网互联网科技服务有限公司";
            }
            this.subBasicModel  = userbll.GetUserBasicInfoModelById(submodel.SubscribeUserId.Value);
            this.proModel       = probll.GetProjectDetailInfo(submodel.ProjectId.Value);
            this.publisherModel = userbll.GetUserBasicInfoModelById(proModel.UserId.Value);

            var dyParams = new Dapper.DynamicParameters();

            dyParams.Add("@ProjectId", proModel.Id);
            string selSQL = @"select * from fq_ItemSetsProject with(nolock) where ProjectId=@ProjectId";

            itemProjectInfo = PublicConn.QuerySingle <Fq_ItemSetsProjectInfo>(selSQL, 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 = new Common.Contract().GetBorrowerGuaranteeEnterprise(proModel.UserId.Value, proModel.AddDate.Value, proModel.Type.Value);

            if (userEnterprise != null)
            {
                this.assureModel = new AssureOrganizationBLL().GetModelByUserId(userEnterprise.UserId);
            }
            else
            {
                if (!string.IsNullOrEmpty(proModel.Guarantors))
                {
                    int gid = int.Parse(proModel.Guarantors);
                    this.assureModel = new AssureOrganizationBLL().GetModelById(gid);
                }
            }

            //印章小图片
            if (assureModel != null)
            {
                this.assureModel.image = this.GetSmallImage(this.assureModel.image);
            }
        }
Ejemplo n.º 29
0
        //加载转让信息
        public void InitApplicationTransfer()
        {
            //TuanDB.JunTeEntities dbRead = TuanDB.JunTeEntities.Read();
            Guid subscribeId = Guid.Empty;

            Guid.TryParse(Context.Request["id"], out subscribeId);
            Guid userId = WebUserAuth.UserId.Value;

            //TuanDB.Subscribe subscribeEntity = dbRead.Subscribe.FirstOrDefault(p => p.Id == subscribeId && p.SubscribeUserId == userId);

            var subscribeEntity = new SubscribeBLL().GetSubscribeById(subscribeId);

            if (subscribeEntity == null)
            {
                PrintJson("0", "数据异常");
                return;
            }
            ProjectBLL        bll           = new ProjectBLL();
            ProjectDetailInfo projectEntity = bll.GetProjectDetailInfo(subscribeEntity.ProjectId.Value);

            //Project projectEntity = dbRead.Project.FirstOrDefault(p => p.Id == subscribeEntity.ProjectId);
            if (projectEntity == null)
            {
                PrintJson("0", "数据异常");
                return;
            }

            InitApplicationtransferInfo initApplicationtransferEntity = new InitApplicationtransferInfo();

            initApplicationtransferEntity.Title             = projectEntity.Title;
            initApplicationtransferEntity.TypeName          = ToolStatus.ConvertProjectType(projectEntity.Type ?? 0);
            initApplicationtransferEntity.InterestRate      = projectEntity.InterestRate ?? 0;
            initApplicationtransferEntity.RepaymentTypeName = ToolStatus.ConvertRepaymentType(projectEntity.RepaymentType ?? 0);
            initApplicationtransferEntity.Deadline          = projectEntity.Deadline ?? 0;
            initApplicationtransferEntity.LowerUnit         = projectEntity.LowerUnit ?? 0;
            initApplicationtransferEntity.SubscribeShares   = subscribeEntity.SubscribeShares ?? 0;
            initApplicationtransferEntity.Amount            = "0";
            initApplicationtransferEntity.InterestAmount    = "0";
            //var subscribeDetailList = dbRead.SubscribeDetail.Where(p => p.SubscribeId == subscribeId);
            var subscribeDetailList = new SubscribeDetailBLL().GetSubscribeDetailListBySubscribeId(subscribeId);

            if (subscribeDetailList.Count() > 0)
            {
                initApplicationtransferEntity.Amount         = ToolStatus.ConvertLowerMoney(subscribeDetailList.Sum(p => p.Amount));
                initApplicationtransferEntity.InterestAmount = ToolStatus.ConvertLowerMoney(subscribeDetailList.Sum(p => p.InterestAmout.Value));
            }
            initApplicationtransferEntity.RefundedMonths    = subscribeEntity.RefundedMonths ?? 0;
            initApplicationtransferEntity.TotalRefundMonths = subscribeEntity.TotalRefundMonths ?? 0;
            initApplicationtransferEntity.PreCycDate        = subscribeEntity.PreCycDate.HasValue ? subscribeEntity.PreCycDate.Value.ToString("yyyy-MM-dd") : "";

            string sql = string.Empty;

            if (projectEntity.RepaymentType == 1)//到期还本息
            {
                sql = "SELECT dateDiff(day,@BeginDate,getdate())-1";
            }
            else
            {
                sql = "SELECT dateDiff(day,dbo.f_GetRepaymentAdvance_Date(@BeginDate,@Month),getdate())";
            }
            var para = new Dapper.DynamicParameters();

            para.Add("@BeginDate", subscribeEntity.AddDate);
            para.Add("@Month", subscribeEntity.RefundedMonths);
            initApplicationtransferEntity.Days = PublicConn.QuerySingle <int>(sql, ref para);
            //using (SqlConnection connection = new SqlConnection(TuanDai.Config.BaseConfig.ConnectionString))
            //{
            //    connection.Open();
            //     int day = connection.Query<int>(sql, new { BeginDate = subscribeEntity.AddDate, Month = subscribeEntity.RefundedMonths }).First();
            //    connection.Close();
            //    connection.Dispose();
            //    initApplicationtransferEntity.Days = day;
            //}

            initApplicationtransferEntity.result = 1;
            PrintJson(initApplicationtransferEntity);
        }
Ejemplo n.º 30
0
        private void GetContractInfo(string key)
        {
            bool   isUndertake = false; //是否承接人
            string contactno   = key;

            this.submodel = new SubscribeBLL().GetSubscribeInfoContractNo(contactno);
            companyName   = "东莞团贷网互联网科技服务有限公司";

            Dapper.DynamicParameters param = new Dapper.DynamicParameters();
            param = new Dapper.DynamicParameters();
            param.Add("@BorrowerUserId", submodel.BorrowerUserId);
            param.Add("@curUserId", WebUserAuth.UserId);
            string strSQL  = "select Count(1) from project where UserId=@BorrowerUserId and UserId=@curUserId";
            bool   isExist = PublicConn.QuerySingle <int>(strSQL, ref param) > 0;

            if (this.submodel.SubscribeUserId != WebUserAuth.UserId && !isExist)
            {
                string sql = @"SELECT c.* FROM (
                           SELECT b.* FROM dbo.Subscribe a
                           RIGHT JOIN dbo.t_SubScribeTransfer  b ON a.id=b.m_FromSubscribeId
                           WHERE a.ContractNo=@ContractNo) M 
                           INNER JOIN dbo.Subscribe c ON c.TranId=M.M_id
                           WHERE c.SubscribeUserId=@SubscribeUserId";
                param = new Dapper.DynamicParameters();
                param.Add("@ContractNo", contactno);
                param.Add("@SubscribeUserId", WebUserAuth.UserId);
                var mSubscribe = PublicConn.QuerySingle <SubscribeInfo>(sql, ref param);

                if (mSubscribe == null)//判断是否是承接人查看借款人与转让人的合同
                {
                    HttpContext.Current.Response.Write("对不起,您没有权限查看此合同。");
                    HttpContext.Current.Response.End();
                    return;
                }
                isUndertake = true;
            }
            this.subBasicModel  = userbll.GetUserBasicInfoModelById(submodel.SubscribeUserId.Value); //投资人信息
            this.proModel       = projectbll.GetProjectDetailInfo(submodel.ProjectId.Value);
            this.publisherModel = userbll.GetUserBasicInfoModelById(proModel.UserId.Value);          //借款人信息

            AssureModel = new AssureOrganizationInfo();
            this.AssureModel.FullName = "东莞市志诚非融资性担保有限公司";
            this.AssureModel.image    = "http://image.tuandai.com/User/UserUpload/201508/20150825145522_3283.png";

            //印章小图片
            this.AssureModel.image = new Common.Contract().GetSmallImage(this.AssureModel.image);

            RepaymentTypeDesc = new Common.Contract().GetRepaymentTypeDesc(proModel.RepaymentType ?? 0);

            if (WebUserAuth.UserId == publisherModel.Id)
            {
                this.subBasicModel.RealName     = StringHandler.MaskStartPre(subBasicModel.RealName, 1); //出借人
                this.subBasicModel.IdentityCard = StringHandler.MaskCardNo(subBasicModel.IdentityCard);  //出借人身份证号
            }
            else
            {
                this.publisherModel.RealName     = StringHandler.MaskStartPre(publisherModel.RealName, 1); //借款 人
                this.publisherModel.IdentityCard = StringHandler.MaskCardNo(publisherModel.IdentityCard);  //借款人身份证号
            }

            if (isUndertake)
            {
                this.subBasicModel.RealName      = StringHandler.MaskStartPre(subBasicModel.RealName, 1);  //出借人
                this.subBasicModel.IdentityCard  = StringHandler.MaskCardNo(subBasicModel.IdentityCard);   //出借人身份证号
                this.publisherModel.RealName     = StringHandler.MaskStartPre(publisherModel.RealName, 1); //借款 人
                this.publisherModel.IdentityCard = StringHandler.MaskCardNo(publisherModel.IdentityCard);  //借款人身份证号
            }
        }