Beispiel #1
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;
            }
        }
Beispiel #2
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 = "东莞团贷网互联网科技服务有限公司";
            }


            this.subBasicModel  = userbll.GetUserBasicInfoModelById(submodel.SubscribeUserId.Value); //投资人信息
            this.proModel       = projectbll.GetProjectDetailInfo(submodel.ProjectId.Value);
            this.publisherModel = userbll.GetUserBasicInfoModelById(proModel.UserId.Value);          //借款人信息

            //印章小图片
            //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);  //借款人身份证号
            }
        }
Beispiel #3
0
        //向StatInfoTable表中插入一条记录
        public static void InsertIntoStatInfoTable(string name, string post, string company, string region, string source, string invoice, string telephone, string mobilephone, int number, int monthCount, int totalMoney, int averageMoney, int monthMoney, DateTime startDate, DateTime endDate, DateTime giveDate)
        {
            ContainerMapping currentContainerMapping = CMPConfigurationHandler.ContainerMaps["ImportExportDataCatalog"];

            currentContainerMapping.CurrentCommandName = "InsertIntoStatInfoTable";

            SqlPersistenceContainer spc           = new SqlPersistenceContainer(currentContainerMapping);
            SubscribeInfo           subscribeInfo = new SubscribeInfo();

            subscribeInfo.NewName      = name;
            subscribeInfo.Post         = post;
            subscribeInfo.NewCompany   = company;
            subscribeInfo.Region       = region;
            subscribeInfo.Source       = source;
            subscribeInfo.Invoice      = invoice;
            subscribeInfo.Telephone    = telephone;
            subscribeInfo.MobilePhone  = mobilephone;
            subscribeInfo.Number       = number;
            subscribeInfo.MonthCount   = monthCount;
            subscribeInfo.TotalMoney   = totalMoney;
            subscribeInfo.AverageMoney = averageMoney;
            subscribeInfo.MonthMoney   = monthMoney;
            subscribeInfo.StartDate    = startDate;
            subscribeInfo.EndDate      = endDate;
            subscribeInfo.GiveDate     = giveDate;

            spc.Execute(subscribeInfo);
        }
Beispiel #4
0
        static void Main(string[] args)
        {
            SubscribeInfo subscribeInfo = new SubscribeInfo(10);

            //subscribeInfo.Subscribe(mqmessage =>
            //{
            //    Console.WriteLine("处理日志{0}", mqmessage.Msg);
            //});

            //subscribeInfo.Subscribe(mqmessage =>
            //{
            //    Thread.Sleep(10 * 1000);
            //    Console.WriteLine("处理日志{0}", mqmessage.Msg);
            //});

            subscribeInfo.Subscribe(async mqmessage =>
            {
                await Task.Run(() =>
                {
                    Console.WriteLine("处理日志:{0}", mqmessage.Msg);
                });
            });
            //subscribeInfo.ErrorHandle(async (dyc, expc, type) =>
            //{
            //    await Task.Run(() =>
            //    {
            //        Console.WriteLine("{0},{1}, {2}", dyc, expc.InnerException.Message, type);
            //    });
            //});


            Console.ReadKey();
        }
Beispiel #5
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);

            var Params = new Dapper.DynamicParameters();

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

            itemProjectInfo = PublicConn.QuerySingle <Fq_ItemSetsProjectInfo>(selSQL, ref Params);

            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)
            {
                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 = "东莞市俊特团贷网络信息服务有限公司";
                }
            }

            //印章小图片
            if (assureModel != null)
            {
                this.assureModel.image = this.GetSmallImage(this.assureModel.image);
            }
        }
Beispiel #6
0
        //清空StatInfoTable表中的所有内容
        public static void ClearStatInfoTable()
        {
            ContainerMapping currentContainerMapping = CMPConfigurationHandler.ContainerMaps["ImportExportDataCatalog"];

            currentContainerMapping.CurrentCommandName = "ClearStatInfoTable";

            SqlPersistenceContainer spc           = new SqlPersistenceContainer(currentContainerMapping);
            SubscribeInfo           subscribeInfo = new SubscribeInfo();

            spc.Execute(subscribeInfo);
        }
Beispiel #7
0
        public void Unsubscribe(string topic)
        {
            var sInfo = new SubscribeInfo()
            {
                Name  = _name,
                Topic = topic
            };
            var data = sInfo.ToBytes();

            SendBase(QueueSocketMsgType.Unsubcribe, data);
        }
Beispiel #8
0
        public void Import()
        {
            if (!AppConfig.IsImportable)
            {
                throw new BizException("Is Importable is false");
            }

            /*  do not  use the following code after Data Pour in */
            string  sql = " select top 1 * from subscribe ";
            DataSet ds  = SqlHelper.ExecuteDataSet(sql);

            if (Util.HasMoreRow(ds))
            {
                throw new BizException("the table subscribe is not empty");
            }

            TransactionOptions options = new TransactionOptions();

            options.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;
            options.Timeout        = TransactionManager.DefaultTimeout;

            using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, options))
            {
                string sql1 = @"select * from 
								(
								select customername as username, email, registertime as createtime from ipp3..customer where emailstatus = 1
								union all
								select username, email, createtime from ipp2003..EmailSubscribe
								) as a
								where a.username is not null
								order by createtime"                                ;

                Hashtable ht  = new Hashtable(20000);
                DataSet   ds1 = SqlHelper.ExecuteDataSet(sql1);
                foreach (DataRow dr1 in ds1.Tables[0].Rows)
                {
                    if (ht.ContainsKey(Util.TrimNull(dr1["email"])))
                    {
                        continue;
                    }

                    SubscribeInfo oInfo = new SubscribeInfo();
                    oInfo.Email      = Util.TrimNull(dr1["email"]);
                    oInfo.UserName   = Util.TrimNull(dr1["username"]);
                    oInfo.CreateTime = Util.TrimDateNull(dr1["createtime"]);

                    new SubscribeDac().Insert(oInfo);

                    ht.Add(oInfo.Email, null);
                }

                scope.Complete();
            }
        }
Beispiel #9
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 = "东莞团贷网互联网科技服务有限公司";
            }


            this.subBasicModel  = userbll.GetUserBasicInfoModelById(submodel.SubscribeUserId.Value); //投资人信息
            this.proModel       = projectbll.GetProjectDetailInfo(submodel.ProjectId.Value);
            this.publisherModel = userbll.GetUserBasicInfoModelById(proModel.UserId.Value);          //借款人信息



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

            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);  //借款人身份证号
            }
        }
Beispiel #10
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 = "东莞团贷网互联网科技服务有限公司";
            }
            if (submodel.AddDate.Value <= DateTime.Parse("2015-07-31"))
            {
                Response.Redirect(string.Format("/Contract/ContractJzdb.aspx?key={0}&type=mobileapp", key));
                return;
            }
            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");
            this.PrincipalInterest = submodel.Amount.Value + submodel.InterestAmount.Value;
            AssureModel            = new Common.Contract().GetAssureOrganizationByProjectId(proModel.Id);
            //印章小图片
            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);  //借款人身份证号
            }
        }
Beispiel #11
0
        static void Main(string[] args)
        {
            SubscribeInfo subscribeInfo = new SubscribeInfo(10);

            Parallel.For(0, 99, i =>
            {
                int re = subscribeInfo.Incr(i.ToString());
                Console.WriteLine("{0},{1},{2}", i, re, subscribeInfo.IsFulled());
            });

            subscribeInfo.RedisFlush();
            Console.ReadLine();
        }
Beispiel #12
0
        //从临时表检索数据
        public static DataSet RetriveDataFromTempInfo()
        {
            ContainerMapping currentContainerMapping = CMPConfigurationHandler.ContainerMaps["SubscribeInfoCatalog"];

            currentContainerMapping.CurrentCommandName = "RetrieveDataFromTempInfo";

            SqlPersistenceContainer spc           = new SqlPersistenceContainer(currentContainerMapping);
            SubscribeInfo           subscribeInfo = new SubscribeInfo();

            spc.Execute(subscribeInfo);

            return(subscribeInfo.ResultSet);
        }
Beispiel #13
0
        public int Insert(SubscribeInfo oParam)
        {
            string sql = @"INSERT INTO subscribe
                            (
                            Email, UserName, CreateTime
                            )
                            VALUES (
                            @Email, @UserName, @CreateTime
                            );set @SysNo = SCOPE_IDENTITY();";

            SqlCommand cmd = new SqlCommand(sql);

            SqlParameter paramSysNo      = new SqlParameter("@SysNo", SqlDbType.Int, 4);
            SqlParameter paramEmail      = new SqlParameter("@Email", SqlDbType.NVarChar, 50);
            SqlParameter paramUserName   = new SqlParameter("@UserName", SqlDbType.NVarChar, 50);
            SqlParameter paramCreateTime = new SqlParameter("@CreateTime", SqlDbType.DateTime);

            paramSysNo.Direction = ParameterDirection.Output;

            if (oParam.Email != AppConst.StringNull)
            {
                paramEmail.Value = oParam.Email;
            }
            else
            {
                paramEmail.Value = System.DBNull.Value;
            }
            if (oParam.UserName != AppConst.StringNull)
            {
                paramUserName.Value = oParam.UserName;
            }
            else
            {
                paramUserName.Value = System.DBNull.Value;
            }
            if (oParam.CreateTime != AppConst.DateTimeNull)
            {
                paramCreateTime.Value = oParam.CreateTime;
            }
            else
            {
                paramCreateTime.Value = System.DBNull.Value;
            }

            cmd.Parameters.Add(paramSysNo);
            cmd.Parameters.Add(paramEmail);
            cmd.Parameters.Add(paramUserName);
            cmd.Parameters.Add(paramCreateTime);

            return(SqlHelper.ExecuteNonQuery(cmd, out oParam.SysNo));
        }
Beispiel #14
0
        //删除一条订阅信息
        public static void DeleteSubscribeInfo(string name, string company)
        {
            ContainerMapping currentContainerMapping = CMPConfigurationHandler.ContainerMaps["SubscribeInfoCatalog"];

            currentContainerMapping.CurrentCommandName = "DeleteInfo";

            SqlPersistenceContainer spc           = new SqlPersistenceContainer(currentContainerMapping);
            SubscribeInfo           subscribeInfo = new SubscribeInfo();

            subscribeInfo.OldName    = name;
            subscribeInfo.OldCompany = company;

            spc.Execute(subscribeInfo);
        }
Beispiel #15
0
        //根据日期统计本月的总收入
        public static DataTable RetrieveInfoByDateOnly(DateTime inputDate)
        {
            ContainerMapping currentContainerMapping = CMPConfigurationHandler.ContainerMaps["SubscribeInfoCatalog"];

            currentContainerMapping.CurrentCommandName = "RetrieveInfoByDateOnly";

            SqlPersistenceContainer spc           = new SqlPersistenceContainer(currentContainerMapping);
            SubscribeInfo           subscribeInfo = new SubscribeInfo();

            subscribeInfo.StartDate = inputDate;

            spc.Execute(subscribeInfo);

            return(subscribeInfo.ResultSet.Tables[0]);
        }
Beispiel #16
0
        //将OutputTemp表中的数据导出到Excel文档中
        public static void OutputDataToExcel(string path, string fileName, string tableName)
        {
            ContainerMapping currentContainerMapping = CMPConfigurationHandler.ContainerMaps["ImportExportDataCatalog"];

            currentContainerMapping.CurrentCommandName = "p_exporttb";

            SqlPersistenceContainer spc           = new SqlPersistenceContainer(currentContainerMapping);
            SubscribeInfo           subscribeInfo = new SubscribeInfo();

            subscribeInfo.Path      = path;
            subscribeInfo.FileName  = fileName;
            subscribeInfo.TableName = tableName;

            spc.Execute(subscribeInfo);
        }
Beispiel #17
0
        //从主表中检查某条记录是否存在
        public static int CheckSubscribeExist(string name, string company)
        {
            ContainerMapping currentContainerMapping = CMPConfigurationHandler.ContainerMaps["SubscribeInfoCatalog"];

            currentContainerMapping.CurrentCommandName = "CheckSubscribeExist";

            SqlPersistenceContainer spc           = new SqlPersistenceContainer(currentContainerMapping);
            SubscribeInfo           subscribeInfo = new SubscribeInfo();

            subscribeInfo.OldName    = name;
            subscribeInfo.OldCompany = company;

            spc.Execute(subscribeInfo);

            return(subscribeInfo.Id);
        }
Beispiel #18
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 = "东莞团贷网互联网科技服务有限公司";
            }


            this.subBasicModel  = userbll.GetUserBasicInfoModelById(submodel.SubscribeUserId.Value); //投资人信息
            this.proModel       = projectbll.GetProjectDetailInfo(submodel.ProjectId.Value);
            this.publisherModel = userbll.GetUserBasicInfoModelById(proModel.UserId.Value);          //借款人信息

            WebSettingInfo gylSet = new WebSettingBLL().GetWebSettingInfo("75F593E2-40FF-4777-A6F8-4ED54D39FF70");

            if (gylSet.Param2Value.IsEmpty())
            {
                gylSet.Param2Value = "2017-02-10";
            }
            if (proModel.AddDate >= DateTime.Parse(gylSet.Param2Value))
            {
                DanBaoCompany = "东莞市志诚非融资性担保有限公司";
                DanBaoImage   = "http://image.tuandai.com/User/UserUpload/201508/20150825145522_3283.png";
            }

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

            RepaymentTypeDesc = this.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);  //借款人身份证号
            }
        }
Beispiel #19
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);  //借款人身份证号
            }
        }
Beispiel #20
0
        public void Insert(SubscribeInfo oParam)
        {
            TransactionOptions options = new TransactionOptions();

            options.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;
            options.Timeout        = TransactionManager.DefaultTimeout;

            using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, options))
            {
                if (IsSubscribed(oParam.Email))
                {
                    throw new BizException("ÒѾ­¶©ÔÄ");
                }

                new SubscribeDac().Insert(oParam);

                scope.Complete();
            }
        }
Beispiel #21
0
        //更新一条订阅信息
        public static int UpdateSubscribeInfo(string oldName, string newName, string post, string oldCompany, string newCompany, string address, string region, string postCode, string telephone, string mobilephone, DateTime startDate, DateTime endDate, DateTime giveDate, int number, int monthCount, int totalMoney, string inscribe, string source, string payment, string invoice, string client, string operator1, string bonus, string localAddress, string subscription)
        {
            ContainerMapping currentContainerMapping = CMPConfigurationHandler.ContainerMaps["SubscribeInfoCatalog"];

            currentContainerMapping.CurrentCommandName = "UpdateInfo";

            SqlPersistenceContainer spc           = new SqlPersistenceContainer(currentContainerMapping);
            SubscribeInfo           subscribeInfo = new SubscribeInfo();

            subscribeInfo.Post         = post;
            subscribeInfo.Address      = address;
            subscribeInfo.PostCode     = postCode;
            subscribeInfo.Telephone    = telephone;
            subscribeInfo.MobilePhone  = mobilephone;
            subscribeInfo.Inscribe     = inscribe;
            subscribeInfo.Source       = source;
            subscribeInfo.Payment      = payment;
            subscribeInfo.Invoice      = invoice;
            subscribeInfo.Client       = client;
            subscribeInfo.Operator     = operator1;
            subscribeInfo.Bonus        = bonus;
            subscribeInfo.Region       = region;
            subscribeInfo.OldName      = oldName;
            subscribeInfo.NewName      = newName;
            subscribeInfo.Number       = number;
            subscribeInfo.MonthCount   = monthCount;
            subscribeInfo.TotalMoney   = totalMoney;
            subscribeInfo.OldCompany   = oldCompany;
            subscribeInfo.NewCompany   = newCompany;
            subscribeInfo.StartDate    = startDate;
            subscribeInfo.EndDate      = endDate;
            subscribeInfo.GiveDate     = giveDate;
            subscribeInfo.LocalAddress = localAddress;
            subscribeInfo.Subscription = subscription;

            spc.Execute(subscribeInfo);

            return(subscribeInfo.Id);
        }
Beispiel #22
0
        private string GetMessage(SubscribeInfo subscribeInfo)
        {
            var receivedMsg = _serviceProvider.GetRequiredService <IMessageDecoder>().Decode(Context);

            return(receivedMsg.Content);
        }
Beispiel #23
0
 private object GetHandler(SubscribeInfo subscribeInfo)
 {
     return(_serviceProvider.GetService(subscribeInfo.CallbackType));
 }
Beispiel #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();
        }
Beispiel #25
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);  //借款人身份证号
            }
        }
Beispiel #26
0
        private void GetContractInfo(string key)
        {
            bool   isUndertake = false; //是否承接人
            string contactno   = key;

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

            Dapper.DynamicParameters param = null;
            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);          //借款人信息


            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
            {
                if (proModel.Guarantors.ToText() == "")
                {
                    assureModel = new AssureOrganizationInfo();
                }
                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);  //借款人身份证号
            }

            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);  //借款人身份证号
            }
        }
Beispiel #27
0
        /// <summary>
        /// 获取合同信息
        /// add by huangbinglai
        /// 20160326
        /// </summary>
        /// <param name="key">合同编号</param>
        private void GetContractInfo(string key)
        {
            string contactno = this.key;

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


            string sql = @"select * from project  where UserId=@UserId  and Id=@Id";

            Dapper.DynamicParameters dyParams = new Dapper.DynamicParameters();
            dyParams.Add("@UserId", WebUserAuth.UserId);
            dyParams.Add("@Id", submodel.ProjectId);
            ProjectDetailInfo projectModel = PublicConn.QuerySingle <ProjectDetailInfo>(sql, ref dyParams);

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

            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);          //获取发布人信息



            sql      = @"select u.OrgTypeId,u.OrgId,ISNULL(o.SubTypeId,0) AS SubTypeId from fq_UserApply u
                INNER JOIN fq_Organization o ON u.OrgId=o.OrgId
                where u.ProjectId=@ProjectId";
            dyParams = new Dapper.DynamicParameters();
            dyParams.Add("@ProjectId", submodel.ProjectId);
            mOrgInfo = PublicConn.QuerySingle <OrgInfo>(sql, ref dyParams);

            if (mOrgInfo.OrgTypeId == 5)//分期乐
            {
                if (mOrgInfo.SubTypeId == 3)
                {
                    #region 小树时代
                    xssdmodel = new xssdcontract();
                    xssdmodel.ProContactNo = contactno;                                                   //合同
                    if (proModel.UserId == WebUserAuth.UserId)                                            //借款人查看
                    {
                        xssdmodel.InvestUserName = StringHandler.MaskStartPre(subBasicModel.RealName, 1); //出借人
                        xssdmodel.InvestCardNo   = StringHandler.MaskCardNo(subBasicModel.IdentityCard);  //出借人身份证号
                        xssdmodel.OrgName        = publisherModel.RealName;                               //机构名称
                        xssdmodel.OrgCode        = publisherModel.IdentityCard;                           //机构编码
                    }
                    else
                    {
                        xssdmodel.InvestUserName = subBasicModel.RealName;      //出借人
                        xssdmodel.InvestCardNo   = subBasicModel.IdentityCard;  //出借人身份证号
                        xssdmodel.OrgName        = publisherModel.RealName;     // StringHandler.MaskStartPre(publisherModel.RealName, 1); //机构名称
                        xssdmodel.OrgCode        = publisherModel.IdentityCard; // StringHandler.MaskCardNo(publisherModel.IdentityCard); //机构编码
                    }
                    Dapper.DynamicParameters para1 = new Dapper.DynamicParameters();
                    para1.Add("@OrgId", publisherModel.Id);
                    sql = "select  OrgLegalPerson from fq_Organization where OrgId=@OrgId";
                    string OrgLegalPerson = PublicConn.QuerySingle <string>(sql, ref para1);
                    xssdmodel.OrgLegalPerson = string.IsNullOrEmpty(OrgLegalPerson) ? "" : proModel.UserId == WebUserAuth.UserId ? OrgLegalPerson : StringHandler.MaskStartPre(OrgLegalPerson, 1); //机构法定代表人

                    xssdmodel.Grade          = proModel.Grade;
                    xssdmodel.SubContractNo  = submodel.ContractNo;
                    xssdmodel.Amount         = submodel.Amount.Value.ToString("N");         //借款金额小写
                    xssdmodel.InterestAmount = submodel.InterestAmount.Value.ToString("N"); //借款利息小写
                    xssdmodel.DeadLine       = proModel.Deadline.Value.ToString();          //借款期限
                    decimal PerAmount = Math.Round((submodel.Amount.Value + submodel.InterestAmount.Value) / proModel.Deadline.Value, 2);
                    xssdmodel.PerAmount = PerAmount.ToString("N");                          //每月回款金额
                    xssdmodel.Rate      = proModel.InterestRate.Value.ToString();           //利率
                    //最后回款时间
                    sql = "select  MAX(CycDate) CycDate  from SubscribeDetail where SubscribeId=@SubscribeId";
                    Dapper.DynamicParameters para2 = new Dapper.DynamicParameters();
                    para2.Add("@SubscribeId", submodel.Id);
                    DateTime?MAXDate  = PublicConn.QuerySingle <DateTime?>(sql, ref para2);
                    DateTime LastDate = MAXDate ?? DateTime.Now.AddMonths(proModel.Deadline ?? 0);
                    xssdmodel.ExpireYear      = LastDate.Year.ToString();
                    xssdmodel.ExpireMonth     = LastDate.Month.ToString();
                    xssdmodel.ExpireDay       = LastDate.Day.ToString();
                    xssdmodel.BorrowSignYear  = submodel.AddDate.Value.Year.ToString();//签字日期
                    xssdmodel.BorrowSignMonth = submodel.AddDate.Value.Month.ToString();
                    xssdmodel.BorrowSignDay   = submodel.AddDate.Value.Day.ToString();
                    #endregion
                }
                else if (mOrgInfo.SubTypeId == 5)
                {
                    #region 你我金融
                    kldmodel = new Kldcontract();
                    kldmodel.ProContactNo = contactno;
                    if (proModel.UserId == WebUserAuth.UserId)                                           //借款人查看
                    {
                        kldmodel.InvestUserName = StringHandler.MaskStartPre(subBasicModel.RealName, 1); //出借人
                        kldmodel.InvestCardNo   = StringHandler.MaskCardNo(subBasicModel.IdentityCard);  //出借人身份证号
                        kldmodel.OrgName        = publisherModel.RealName;                               //机构名称
                        kldmodel.OrgCode        = publisherModel.IdentityCard;                           //机构编码
                    }
                    else
                    {
                        kldmodel.InvestUserName = subBasicModel.RealName;      //出借人
                        kldmodel.InvestCardNo   = subBasicModel.IdentityCard;  //出借人身份证号
                        kldmodel.OrgName        = publisherModel.RealName;     // StringHandler.MaskStartPre(publisherModel.RealName, 1); //机构名称
                        kldmodel.OrgCode        = publisherModel.IdentityCard; // StringHandler.MaskCardNo(publisherModel.IdentityCard); //机构编码
                    }
                    Dapper.DynamicParameters para2 = new Dapper.DynamicParameters();
                    para2.Add("@OrgId", publisherModel.Id);
                    sql = "select  OrgLegalPerson from fq_Organization where OrgId=@OrgId";
                    string OrgLegalPerson = PublicConn.QuerySingle <string>(sql, ref para2);
                    kldmodel.OrgLegalPerson = string.IsNullOrEmpty(OrgLegalPerson) ? "" : proModel.UserId == WebUserAuth.UserId ? OrgLegalPerson : StringHandler.MaskStartPre(OrgLegalPerson, 1); //机构法定代表人
                    kldmodel.Grade          = proModel.Grade;
                    kldmodel.SubContractNo  = submodel.ContractNo;
                    kldmodel.Amount         = submodel.Amount.Value.ToString("N");         //借款金额小写
                    kldmodel.InterestAmount = submodel.InterestAmount.Value.ToString("N"); //借款利息小写
                    kldmodel.DeadLine       = proModel.Deadline.Value.ToString();          //借款期限
                    decimal PerAmount = Math.Round((submodel.Amount.Value + submodel.InterestAmount.Value) / proModel.Deadline.Value, 2);
                    kldmodel.PerAmount  = PerAmount.ToString("N");                         //每月回款金额
                    kldmodel.Rate       = proModel.InterestRate.Value.ToString();          //利率
                    kldmodel.ReturnType = convertType(submodel.RepaymentType);
                    var para = new SqlParameter[] { new SqlParameter("projectid", submodel.ProjectId) };

                    sql   = "select max(CycDate) from SubscribeDetail where SubscribeId=@subscribeId";
                    para2 = new Dapper.DynamicParameters();
                    para2.Add("@subscribeId", submodel.Id);
                    DateTime?maxCycDate = PublicConn.QuerySingle <DateTime?>(sql, ref para2);
                    //最后回款时间
                    DateTime LastDate = maxCycDate.HasValue ? maxCycDate.Value : DateTime.Now.AddMonths(proModel.Deadline ?? 0);
                    kldmodel.ExpireYear      = LastDate.Year.ToString();
                    kldmodel.ExpireMonth     = LastDate.Month.ToString();
                    kldmodel.ExpireDay       = LastDate.Day.ToString();
                    kldmodel.BorrowSignYear  = submodel.AddDate.Value.Year.ToString();//签字日期
                    kldmodel.BorrowSignMonth = submodel.AddDate.Value.Month.ToString();
                    kldmodel.BorrowSignDay   = submodel.AddDate.Value.Day.ToString();
                    #endregion
                }
                else if (mOrgInfo.SubTypeId == 4)
                {
                    #region 快来贷
                    kldmodel = new Kldcontract();
                    kldmodel.ProContactNo = contactno;
                    if (proModel.UserId == WebUserAuth.UserId)                                           //借款人查看
                    {
                        kldmodel.InvestUserName = StringHandler.MaskStartPre(subBasicModel.RealName, 1); //出借人
                        kldmodel.InvestCardNo   = StringHandler.MaskCardNo(subBasicModel.IdentityCard);  //出借人身份证号
                        kldmodel.OrgName        = publisherModel.RealName;                               //机构名称
                        kldmodel.OrgCode        = publisherModel.IdentityCard;                           //机构编码
                    }
                    else
                    {
                        kldmodel.InvestUserName = subBasicModel.RealName;      //出借人
                        kldmodel.InvestCardNo   = subBasicModel.IdentityCard;  //出借人身份证号
                        kldmodel.OrgName        = publisherModel.RealName;     // StringHandler.MaskStartPre(publisherModel.RealName, 1); //机构名称
                        kldmodel.OrgCode        = publisherModel.IdentityCard; // StringHandler.MaskCardNo(publisherModel.IdentityCard); //机构编码
                    }
                    Dapper.DynamicParameters para2 = new Dapper.DynamicParameters();
                    para2.Add("@OrgId", publisherModel.Id);
                    sql = "select  OrgLegalPerson from fq_Organization where OrgId=@OrgId";
                    string OrgLegalPerson = PublicConn.QuerySingle <string>(sql, ref para2);
                    kldmodel.OrgLegalPerson = string.IsNullOrEmpty(OrgLegalPerson) ? "" : proModel.UserId == WebUserAuth.UserId ? OrgLegalPerson : StringHandler.MaskStartPre(OrgLegalPerson, 1); //机构法定代表人

                    kldmodel.Grade          = proModel.Grade;
                    kldmodel.SubContractNo  = submodel.ContractNo;
                    kldmodel.Amount         = submodel.Amount.Value.ToString("N");         //借款金额小写
                    kldmodel.InterestAmount = submodel.InterestAmount.Value.ToString("N"); //借款利息小写
                    kldmodel.DeadLine       = proModel.Deadline.Value.ToString();          //借款期限
                    decimal PerAmount = Math.Round((submodel.Amount.Value + submodel.InterestAmount.Value) / proModel.Deadline.Value, 2);
                    kldmodel.PerAmount  = PerAmount.ToString("N");                         //每月回款金额
                    kldmodel.Rate       = proModel.InterestRate.Value.ToString();          //利率
                    kldmodel.ReturnType = convertType(submodel.RepaymentType);

                    sql   = "select max(CycDate) from SubscribeDetail where SubscribeId=@subscribeId";
                    para2 = new Dapper.DynamicParameters();
                    para2.Add("@subscribeId", submodel.Id);
                    DateTime?maxCycDate = PublicConn.QuerySingle <DateTime?>(sql, ref para2);

                    //最后回款时间
                    DateTime LastDate = maxCycDate.HasValue ? maxCycDate.Value : DateTime.Now.AddMonths(proModel.Deadline ?? 0);
                    kldmodel.ExpireYear      = LastDate.Year.ToString();
                    kldmodel.ExpireMonth     = LastDate.Month.ToString();
                    kldmodel.ExpireDay       = LastDate.Day.ToString();
                    kldmodel.BorrowSignYear  = submodel.AddDate.Value.Year.ToString();//签字日期
                    kldmodel.BorrowSignMonth = submodel.AddDate.Value.Month.ToString();
                    kldmodel.BorrowSignDay   = submodel.AddDate.Value.Day.ToString();
                    if (string.IsNullOrEmpty(proModel.Guarantors) || proModel.Guarantors.ToInt(0) <= 0)
                    {
                        HttpContext.Current.Response.Write("对不起,该项目未指定担保机构,不能查看合同!");
                        HttpContext.Current.Response.End();
                        return;
                    }
                    #endregion
                }

                if (mOrgInfo.SubTypeId.ToString().IsIn("4", "5"))
                {
                    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
                    {
                        //当未指定担保机构时则退出  allen  2015-05-07
                        if (string.IsNullOrEmpty(proModel.Guarantors) || proModel.Guarantors.ToInt(0) <= 0)
                        {
                            HttpContext.Current.Response.Write("对不起,该项目未指定担保机构,不能查看合同!");
                            HttpContext.Current.Response.End();
                            return;
                        }
                        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 = "东莞市俊特团贷网络信息服务有限公司";
                        }
                    }
                    //印章小图片
                    assureModel.image = new Common.Contract().GetSmallImage(assureModel.image);
                    kldmodel.Assure   = assureModel != null ? assureModel.FullName : "东莞市志诚非融资性担保有限公司";
                }
            }
            else//分期宝
            {
                #region 分期宝
                fqbmodel = new fqbcontract();
                fqbmodel.ProContactNo = contactno;                                                   //合同
                if (proModel.UserId == WebUserAuth.UserId)                                           //借款人查看
                {
                    fqbmodel.CreditorName   = StringHandler.MaskStartPre(subBasicModel.RealName, 1); //出借人
                    fqbmodel.CreditorCardNo = StringHandler.MaskCardNo(subBasicModel.IdentityCard);  //出借人身份证号
                    fqbmodel.DebtorName     = publisherModel.RealName;                               //借款人
                    fqbmodel.DebtorCardNo   = publisherModel.IdentityCard;                           //借款人身份证号
                }
                else
                {
                    fqbmodel.CreditorName   = subBasicModel.RealName;                                 //出借人
                    fqbmodel.CreditorCardNo = subBasicModel.IdentityCard;                             //出借人身份证号
                    fqbmodel.DebtorName     = StringHandler.MaskStartPre(publisherModel.RealName, 1); //借款 人
                    fqbmodel.DebtorCardNo   = StringHandler.MaskCardNo(publisherModel.IdentityCard);  //借款人身份证号
                }
                Dapper.DynamicParameters para = new Dapper.DynamicParameters();
                para.Add("@projectid", submodel.ProjectId);
                sql = @"DECLARE @IsPrivateAccounts BIT=0 --是否私账,默认公账
                                SELECT @IsPrivateAccounts=ISNULL(b.IsPrivateAccounts,0) FROM dbo.fq_UserApply(nolock) a
                                INNER JOIN  dbo.fq_Organization(nolock) b ON a.OrgId=b.OrgId
                                WHERE a.ProjectId=@projectid
                                IF	@IsPrivateAccounts=0
                                BEGIN
	                                SELECT u.RealName as OrgName,o.ProductName FROM fq_UserApply a with(nolock) 
	                                INNER JOIN  fq_OrgProduct(nolock) o ON a.ProductId = o.Id  
	                                INNER JOIN  dbo.UserBasicInfo(nolock) u ON a.OrgId = u.Id
	                                where a.ProjectId=@projectid
                                END
                                ELSE
                                BEGIN
	                                SELECT u.ShortName as OrgName,o.ProductName FROM fq_UserApply a with(nolock) 
	                                INNER JOIN  fq_OrgProduct(nolock) o ON a.ProductId = o.Id  
	                                INNER JOIN  dbo.fq_Organization(nolock) u ON a.OrgId = u.OrgId
	                                where a.ProjectId=@projectid
                                END";
                var OrgInfo = PublicConn.QuerySingle <FqbOrg>(sql, ref para);
                fqbmodel.Assure        = OrgInfo.OrgName;//担保人
                fqbmodel.OrgName       = OrgInfo.OrgName;
                fqbmodel.ProductName   = OrgInfo.ProductName;
                fqbmodel.Amount        = proModel.Amount.Value.ToString("N");
                fqbmodel.BorrowMoney   = submodel.Amount.Value.ToString("N");                                      //借款金额小写
                fqbmodel.BorrowMoneyCn = ChineseNum.GetUpperMoney(double.Parse(submodel.Amount.Value.ToString())); //借款金额大写
                fqbmodel.DeadLine      = proModel.Deadline.Value.ToString();                                       //借款期限
                fqbmodel.Rate          = proModel.InterestRate.Value.ToString();                                   //利率
                // dic["OverRate1"] = debtorModel.OverRate.Value.ToString();//逾期利率
                fqbmodel.OverRate          = fqbmodel.Rate;
                fqbmodel.Address           = "广东省东莞市南城区";                            //签署地
                fqbmodel.RepaymentTypeName = ToolStatus.ConvertRepaymentType(proModel.RepaymentType ?? 0);
                fqbmodel.BorrowSignYear    = submodel.AddDate.Value.Year.ToString(); //签字日期
                fqbmodel.BorrowSignMonth   = submodel.AddDate.Value.Month.ToString();
                fqbmodel.BorrowSignDay     = submodel.AddDate.Value.Day.ToString();

                #endregion
            }
        }
Beispiel #28
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);  //借款人身份证号
            }
        }