Exemple #1
0
        /// <summary>
        /// 验证交易密码是否正确
        /// </summary>
        public static bool FC20146(DBMA1DataContext dbma1, string userSN, string pwd)
        {
            string transPwd = dbma1.U003s.Where(c => c.userSN == userSN).First().transactPwd;

            return(C101.FC10104(pwd, transPwd));
        }
Exemple #2
0
        /// <summary>
        /// 投资方信息
        /// </summary>
        public static string FC20144(string investorUserSN)
        {
            using (DBMA1DataContext dbma1 = new DBMA1DataContext())
            {
                var investorData = (from c in dbma1.VP801001s
                                    where c.userSN == investorUserSN
                                    select c).First();


                var investStatus = dbma1.VP104011s.Where(c => c.investorUserSN == investorUserSN).First();

                string res = string.Format("{{\"investorData\":{0},\"investCaseAmount\":{1},\"investMoneyAmount\":{2}}}", C101.FC10107(investorData), investStatus.investCaseAmount, investStatus.InvestMoneyAmount);

                return(res);
            }
        }
Exemple #3
0
        //顾问信息
        public static string FC20145(string consultantUserSN, string crSN)
        {
            using (DBMA1DataContext dbma1 = new DBMA1DataContext())
            {
                //基本信息
                var consultantBasicData = (from c in dbma1.VP801001s
                                           where c.userSN == consultantUserSN
                                           select new
                {
                    c.userSN,
                    c.name,
                    c.birthday,
                    c.gender,
                    c.registeredResidence,
                    idCard = c.idCard.Substring(0, 6),
                    c.phone,
                    c.email,
                    c.maritalStatusType,
                    c.procreateStatus,
                    c.currentAddressProvince,
                    c.currentAddressCity,
                    c.currentAddressDetails,
                    c.graduateSchool,
                    c.degreeType,
                    c.industryType,
                    c.enterpriseType,
                    c.serviceProvince,
                    c.serviceCity,
                    c.investigate,
                    c.assetsEvaluate,
                    c.badLoanCollect,
                    c.creditRightGuarantee,
                    c.consultantDetails
                }).First();
                string consultantBasicDataStr = C101.FC10107(consultantBasicData);

                //注册时间
                DateTime regDatetime    = dbma1.U000s.Where(c => c.userSN == consultantUserSN).First().registerDate;
                string   regDatetimeStr = C101.FC10107(regDatetime);

                //案例数量
                int caseAmount = (from c in dbma1.P500s
                                  where c.consultantUserSN == consultantUserSN
                                  select c).Count();

                //成功案例
                int successCaseAmount = (from c in dbma1.P102s
                                         join o in dbma1.P103s.Where(oo => oo.ifOverdue == false) on c.investSN equals o.investSN
                                         join p in dbma1.P500s.Where(pp => pp.consultantUserSN == consultantUserSN && pp.auditStatus == true) on c.reserveSN equals p.reserveSN
                                         select c).Count();

                //当前坏账
                int currentBadLoanCaseAmount = (from c in dbma1.P500s.Where(cc => cc.consultantUserSN == consultantUserSN && cc.auditStatus != false)
                                                join o in dbma1.P102s.Where(oo => oo.closeCaseDate == null && oo.deadlineDate.Date < DateTime.Now.Date)
                                                on c.reserveSN equals o.reserveSN
                                                select c).Count();

                //历史坏账
                int historyBadLoanCaseAmount = (from c in dbma1.P102s
                                                join o in dbma1.P103s.Where(oo => oo.ifOverdue == true) on c.investSN equals o.investSN
                                                join p in dbma1.P500s.Where(pp => pp.consultantUserSN == consultantUserSN && pp.auditStatus != false) on c.reserveSN equals p.reserveSN
                                                select c).Count();

                //坏账数量
                int badLoanCaseAmount = currentBadLoanCaseAmount + historyBadLoanCaseAmount;

                //报价
                decimal quotePricePercent = (from c in dbma1.P101s
                                             where c.receiverUserSN == consultantUserSN && c.creditRightSN == crSN
                                             orderby c.sendTime descending
                                             select c).First().costPercent;

                decimal financingMoneyAmount = (from c in dbma1.P200s
                                                where c.creditRightSN == crSN
                                                select c).First().financingAmount;

                decimal quotePrice = financingMoneyAmount * quotePricePercent;

                return(string.Format("{{\"consultantBasicData\":{0},\"regDatetime\":{1},\"caseAmount\":\"{2}\",\"successCaseAmount\":\"{3}\",\"badLoanCaseAmount\":\"{4}\",\"currentBadLoanCaseAmount\":\"{5}\",\"quotePrice\":\"{6}\"}}", consultantBasicDataStr, regDatetimeStr, caseAmount, successCaseAmount, badLoanCaseAmount, currentBadLoanCaseAmount, quotePrice));
            }
        }
Exemple #4
0
        public static string SendSM(string phone, string content, int seqid, int priority)
        {
            string url = "http://sdk4report.eucp.b2m.cn:8080/sdkproxy/sendsms.action";

            // 创建 WebRequest 对象,WebRequest 是抽象类,定义了请求的规定,
            // 可以用于各种请求,例如:Http, Ftp 等等。
            // HttpWebRequest 是 WebRequest 的派生类,专门用于 Http
            System.Net.HttpWebRequest request
                = System.Net.HttpWebRequest.Create(url) as System.Net.HttpWebRequest;

            // 请求的方式通过 Method 属性设置 ,默认为 GET
            // 可以将 Method 属性设置为任何 HTTP 1.1 协议谓词:GET、HEAD、POST、PUT、DELETE、TRACE 或 OPTIONS。
            request.Method = "POST";

            // 输入 POST 的数据.
            string cdkey    = "6SDK-EMY-6688-KEUMQ";
            string password = "******";

            content = C101.CF10110(content);
            string postData = string.Format("cdkey={0}&password={1}&phone={2}&message={3}&addserial=&seqid={4}&smspriority={5}", cdkey, password, phone, content, seqid.ToString(), priority);

            // 拼接成请求参数串,并进行编码,成为字节
            ASCIIEncoding encoding = new ASCIIEncoding();

            byte[] byte1 = encoding.GetBytes(postData);

            // 设置请求的参数形式
            request.ContentType = "application/x-www-form-urlencoded";

            // 设置请求参数的长度.
            request.ContentLength = byte1.Length;

            // 取得发向服务器的流
            System.IO.Stream newStream = request.GetRequestStream();

            // 使用 POST 方法请求的时候,实际的参数通过请求的 Body 部分以流的形式传送
            newStream.Write(byte1, 0, byte1.Length);

            // 完成后,关闭请求流.
            newStream.Close();

            // GetResponse 方法才真的发送请求,等待服务器返回
            System.Net.HttpWebResponse response
                = (System.Net.HttpWebResponse)request.GetResponse();

            // 然后可以得到以流的形式表示的回应内容
            System.IO.Stream receiveStream
                = response.GetResponseStream();

            // 还可以将字节流包装为高级的字符流,以便于读取文本内容
            // 需要注意编码
            System.IO.StreamReader readStream
                = new System.IO.StreamReader(receiveStream, Encoding.UTF8);

            string res = GetSendRes(XDocument.Parse(readStream.ReadToEnd().Trim()));

            // 完成后要关闭字符流,字符流底层的字节流将会自动关闭
            response.Close();
            readStream.Close();

            return(res);
        }