public string FP5040202(DateTime maxDatetime, int pageFrom, int pageSize) { string consultantUserSN = session["userSN"].ToString(); //string consultantUserSN = "U00003"; using (DBMA1DataContext dbma1 = new DBMA1DataContext()) { var vp504021 = (from c in dbma1.VP504021s where c.consultantUserSN == consultantUserSN && maxDatetime >= c.sortDatetime orderby c.sortDatetime descending select c).Skip(pageSize).Take(pageSize).ToList(); return(C101.FC10107(vp504021)); } }
public string FP40202(int pageSize) { string userSN = session["userSN"].ToString(); //string userSN = "U00004"; using (DBMA1DataContext dbma1 = new DBMA1DataContext()) { var dataList = (from c in dbma1.VP402011s where c.senderUserSN == userSN orderby c.reserveDate descending select c).Take(pageSize).ToList(); return(string.Format("{{\"data\":{0},\"maxDatetime\":\"{1}\"}}", C101.FC10107(dataList), DateTime.Now)); } }
//获取服务状态列表 private string GetServerStatusList(IEnumerable <B300> dataList) { //服务状态 List <bool?> serverStatusList = new List <bool?>(); using (DBMA1DataContext dbma1 = new DBMA1DataContext()) { foreach (var b300 in dataList) { U001 u001 = dbma1.U001s.Where(c => c.userSN == b300.userSN).First(); serverStatusList.Add(u001.assetsPruchaseStatus); } } return(C101.FC10107(serverStatusList)); }
public string FP50302(DateTime maxDatetime, int pageFrom, int pageSize) { string consultantUserSN = session["userSN"].ToString(); //string consultantUserSN = "U00003"; using (DBMA1DataContext dbma1 = new DBMA1DataContext()) { var crDataList = (from c in dbma1.VP503001s where c.consultantUserSN == consultantUserSN && maxDatetime >= c.acceptReserveDate orderby c.acceptReserveDate descending select c).Skip(pageFrom).Take(pageSize).ToList(); return(C101.FC10107(crDataList)); } }
/// <summary> /// 搜索 /// </summary> public string FP10106(int pageSize, string keyword, string provinceSN, string citySN, string capitalPurposeSN, string paymentTypeSN, string guaranteeTypeSN, string financingMain, string sortStr) { using (DBMA1DataContext dbma1 = new DBMA1DataContext()) { if (guaranteeTypeSN == "担保 抵押") { guaranteeTypeSN = "担保+抵押"; } var searchCrLinq = Search(dbma1, keyword, provinceSN, citySN, capitalPurposeSN, paymentTypeSN, guaranteeTypeSN, financingMain, sortStr); var searchCrList = searchCrLinq.Take(pageSize); string dataStr = C101.FC10107(searchCrList); return(string.Format("{{\"data\":{0},\"maxDatetime\":\"{1}\"}}", dataStr, DateTime.Now)); } }
public string FM020101(string userSN) { using (DBBS1DataContext dbbs1 = new DBBS1DataContext()) { //案例情况 var caseStatus = dbbs1.P102s.Where(c => c.financierUserSN == userSN); int caseAmount = caseStatus.Count(); decimal?caseMoneyAmount = caseAmount == 0 ? 0 : caseStatus.Sum(c => c.investMoneyAmount); //债务情况 var debtStatus = dbbs1.P102s.Where(c => c.financierUserSN == userSN && c.closeCaseDate == null); int debtAmount = debtStatus.Count(); decimal?debtMoneyAmount = debtAmount == 0 ? 0 : debtStatus.Sum(c => c.investMoneyAmount); //当前逾期情况 var currentOverdueStatus = from c in dbbs1.P102s where c.financierUserSN == userSN && c.closeCaseDate == null && c.investDate.Date < DateTime.Now.Date select c; int currentOverdueAmount = currentOverdueStatus.Count(); decimal?currentOverdueMoneyAmount = currentOverdueAmount == 0 ? 0 : currentOverdueStatus.Sum(c => c.investMoneyAmount); //历史逾期数量 var historyOverdueStatus = from c in dbbs1.P102s from p in dbbs1.P103s where c.investSN == p.investSN && c.financierUserSN == userSN && c.investDate.Date < p.repayDate.Date select c; int historyOverdueAmount = historyOverdueStatus.Count(); //注册时间 DateTime regDatetime = dbbs1.VU000s.Where(c => c.userSN == userSN).First().registerDate; string regDatetimeStr = C101.FC10107(regDatetime); //基本信息 var financierBasicData = (from c in dbbs1.VP801001s where c.userSN == userSN select c).First(); string financierBasicDataStr = C101.FC10107(financierBasicData); string res = string.Format("{{\"financierBasicData\":{0},\"caseAmount\":{1},\"caseMoneyAmount\":{2},\"debtAmount\":{3},\"debtMoneyAmount\":{4},\"currentOverdueAmount\":{5},\"currentOverdueMoneyAmount\":{6},\"historyOverdueAmount\":{7},\"regDatetime\":{8}}}", financierBasicDataStr, caseAmount, caseMoneyAmount, debtAmount, debtMoneyAmount, currentOverdueAmount, currentOverdueMoneyAmount, historyOverdueAmount, regDatetimeStr); return(res); } }
public string FM020401(string userSN) { using (DBBS1DataContext dbbs1 = new DBBS1DataContext()) { //基本信息 var consultantBasicData = (from c in dbbs1.VP801001s where c.userSN == userSN 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.degreeCard, c.workEnterprise, c.industryType, c.enterpriseType, c.hiredate, c.workTel, c.post, c.enterpriseSwitchboard, c.enterpriseWebsite, c.colleageName, c.colleagePhone, colleageIdCard = c.colleageIdCard.Substring(0, 6), c.serviceProvince, c.serviceCity, c.investigate, c.assetsEvaluate, c.badLoanCollect, c.creditRightGuarantee, c.consultantDetails }).First(); return(C101.FC10107(consultantBasicData)); } }
public string FP5040201(int pageSize) { string consultantUserSN = session["userSN"].ToString(); //string consultantUserSN = "U00003"; using (DBMA1DataContext dbma1 = new DBMA1DataContext()) { var vp504021 = (from c in dbma1.VP504021s where c.consultantUserSN == consultantUserSN orderby c.sortDatetime descending select c).Take(pageSize).ToList(); string vp504021Str = C101.FC10107(vp504021); return(string.Format("{{\"crDataList\":{0},\"maxDatetime\":\"{1}\"}}", vp504021Str, DateTime.Now)); } }
public string FM1004INIT() { using (DBMA1DataContext dbma1 = new DBMA1DataContext()) { var dataList = (from c in dbma1.B004s where c.deleteDate == null select new { c.roleTypeSN, roleName = c.value, userAmount = dbma1.B003s.Where(o => o.roleTypeSN == c.roleTypeSN && o.deleteDate == null).Count(), c.note }).ToList(); return(C101.FC10107(dataList)); } }
public string FP30102(DateTime maxDatetime, int pageFrom, int pageSize) { string userSN = session["userSN"].ToString(); //string userSN = "U00003"; using (DBMA1DataContext dbma1 = new DBMA1DataContext()) { var vp401001List = (from c in dbma1.VP401001s where c.publisherUserSN == userSN && maxDatetime > c.publishDate orderby c.publishDate descending select c).Skip(pageFrom).Take(pageSize).ToList(); return(C101.FC10107(vp401001List)); } }
public string FP40203(DateTime maxDatetime, int pageFrom, int pageSize) { string userSN = session["userSN"].ToString(); //string userSN = "U00004"; using (DBMA1DataContext dbma1 = new DBMA1DataContext()) { var dataList = (from c in dbma1.VP402011s where c.senderUserSN == userSN && maxDatetime > c.reserveDate orderby c.reserveDate descending select c).Skip(pageFrom).Take(pageSize).ToList(); return(C101.FC10107(dataList)); } }
public string FM060401(string sortStr, int pageFrom, int pageSize) { using (DBBS1DataContext dbbs1 = new DBBS1DataContext()) { var linqDataList = (from c in Sort(dbbs1, sortStr) select new { userSN = c.generetorUserSN, c.revenueExpenditureSN, c.generateDate, c.type, c.revenue, c.expenditure, } ).Skip(pageFrom).Take(pageSize).ToList(); return(string.Format("{{\"data\":{0},{1}}}", C101.FC10107(linqDataList), SumRevenueAndExpenditure(dbbs1))); } }
public string FP40401(int pageSize) { string userSN = session["userSN"].ToString(); //string userSN = "U00004"; using (DBMA1DataContext dbma1 = new DBMA1DataContext()) { var dataList = (from c in dbma1.VP404001s where c.purchaserUserSN == userSN && c.purchaserDeleteDate == null orderby c.purchaseDate descending select c).ToList(); string dataListStr = C101.FC10107(dataList); return(string.Format("{{\"data\":{0},\"maxDatetime\":\"{1}\"}}", dataListStr, DateTime.Now)); } }
public string FP5040101(int pageSize) { string consultantUserSN = session["userSN"].ToString(); //string consultantUserSN = "U00003"; using (DBMA1DataContext dbma1 = new DBMA1DataContext()) { var crDataList = (from c in dbma1.VP504011s where c.consultantUserSN == consultantUserSN && c.closeCaseDate == null orderby c.serverDate descending select c).Take(pageSize).ToList(); var crDataListStr = C101.FC10107(crDataList); return(string.Format("{{\"crDataList\":{0},\"maxDatetime\":\"{1}\"}}", crDataListStr, DateTime.Now)); } }
public string FP30302(DateTime maxDatetime, int pageFrom, int pageSize) { string userSN = session["userSN"].ToString(); //string userSN = "U00003"; using (DBMA1DataContext dbma1 = new DBMA1DataContext()) { var dataList = (from c in dbma1.VP404001s where c.sellerUserSN == userSN && c.sellerDeleteDate == null && maxDatetime > c.purchaseDate orderby c.purchaseDate descending select c).Skip(pageFrom).Take(pageSize).ToList(); return(C101.FC10107(dataList)); } }
public string FM0604INIT(int pageSize) { using (DBBS1DataContext dbbs1 = new DBBS1DataContext()) { var linqDataList = (from c in dbbs1.VF003s select new { userSN = c.generetorUserSN, c.revenueExpenditureSN, c.generateDate, c.type, c.revenue, c.expenditure, } ).Take(pageSize).ToList(); var s = string.Format("{{\"data\":{0},{1}}}", C101.FC10107(linqDataList), SumRevenueAndExpenditure(dbbs1)); return(s); } }
/// <summary> /// 获取推荐投资方列表 /// </summary> public string FP20107(string sortStr) { string userSN = session["userSN"].ToString(); //string userSN = "U00001"; string orderStr = string.Empty; string[] sortStrSplit = sortStr.Split(','); for (int i = 1; i < (sortStrSplit.Length - 1); i++) { string[] sortStrSplitSplit = sortStrSplit[i].Split('#'); if ((i != 1)) { orderStr += ","; } orderStr += sortStrSplitSplit[0] == "1" ? " minInvestMoneyAmount" : " investCaseAmount"; orderStr += sortStrSplitSplit[1] == "A" ? "" : " desc"; } using (DBMA1DataContext dbma1 = new DBMA1DataContext()) { List <RecommandInvestModel> recommandInvestDataList = null; if (orderStr == string.Empty) { recommandInvestDataList = dbma1.ExecuteQuery <RecommandInvestModel>("select * from VP106011").ToList(); } else { string sqlStr = string.Format(@"select * from VP106011 order by {0}", orderStr); recommandInvestDataList = dbma1.ExecuteQuery <RecommandInvestModel>(sqlStr).ToList(); } string recommandInvestDataListStr = C101.FC10107(recommandInvestDataList); //账户余额 F000 f000 = dbma1.F000s.Where(c => c.userSN == userSN).First(); decimal balance = f000.balance; return(string.Format("{{\"recommandInvestDataList\":{0},\"balance\":\"{1}\"}}", recommandInvestDataListStr, balance)); } }
public string FP5040104(string crSN, string financierUserSN) { string financierHistoryDataStr = string.Empty; string regDatetimeStr = string.Empty; //基本信息 using (DBMA1DataContext dbma1 = new DBMA1DataContext()) { var financierHistoryData = (from c in dbma1.VP105011s where c.creditRightSN == crSN select c).First(); financierHistoryDataStr = C101.FC10107(financierHistoryData); //注册时间 DateTime regDatetime = dbma1.U000s.Where(c => c.userSN == financierUserSN).First().registerDate; regDatetimeStr = C101.FC10107(regDatetime); } return(string.Format("{{\"historyData\":{0},\"regDatetime\":{1}}}", financierHistoryDataStr, regDatetimeStr)); }
public string FP30201(int pageSize) { string userSN = session["userSN"].ToString(); //string userSN = "U00003"; using (DBMA1DataContext dbma1 = new DBMA1DataContext()) { string assetsType = C201.FC20108(dbma1); var dataList = (from c in dbma1.VP402011s where c.receiverUserSN == userSN orderby c.reserveDate descending select c).Take(pageSize).ToList(); string dataListStr = C101.FC10107(dataList); return(string.Format("{{\"SltConfigData\":{0},\"data\":{1},\"maxDatetime\":\"{2}\"}}", assetsType, dataListStr, DateTime.Now)); } }
public string FM020505(string sortStr) { using (DBBC1DataContext dbbc1 = new DBBC1DataContext()) { List <string> sortList = new List <string>(); sortList.Add("reg_date"); sortList.Add("clientTotalAmount"); sortList.Add("financierAmount"); sortList.Add("investorAmount"); sortList.Add("consultantAmount"); sortList.Add("sellerAmount"); sortList.Add("purchaserAmount"); string sqlOrderByStr = ""; string[] sortStrSplit = sortStr.Split(','); for (int i = 1; i < (sortStrSplit.Length - 1); i++) { string[] sortStrSplitSplit = sortStrSplit[i].Split('#'); if (sqlOrderByStr == "") { sqlOrderByStr += "order by"; } else { sqlOrderByStr += ","; } int orderByFieldNum = Convert.ToInt32(sortStrSplitSplit[0]) - 2; string orderByFieldName = sortList[orderByFieldNum]; string order = sortStrSplitSplit[1] == "A" ? "" : " desc"; sqlOrderByStr += string.Format(" {0} {1}", orderByFieldName, order); } string sqlStr = string.Format("select * from B500 {0}", sqlOrderByStr); var dataList = dbbc1.ExecuteQuery <B500>(sqlStr).ToList(); return(C101.FC10107(dataList)); } }
/// <summary> /// 页面初始化 /// </summary> public string FP10101(int pageSize) { //判断是否登录 if (session["userSN"] == null) { return("notLogin"); } string userSN = session["userSN"].ToString(); using (DBMA1DataContext dbma1 = new DBMA1DataContext()) { //判断是否有权限并且是否有逾期账单 var data1 = dbma1.U001s.Where(c => c.userSN == userSN).First(); bool ifBillOverdue = C201.FC20153(dbma1, userSN); if (data1.creditRightInvestStatus != true || ifBillOverdue == true) { return("{\"status\":\"false\"}"); } //获取uip string provinceData = C201.FC20121(dbma1).Replace("[", "").Replace("]", ""); string guaranteeType = C201.FC20117(dbma1).Replace("[", "").Replace("]", ""); string repaymentType = C201.FC20114(dbma1).Replace("[", "").Replace("]", ""); string capitalPurposeType = C201.FC20115(dbma1).Replace("[", "").Replace("]", ""); string repaymentSourceType = C201.FC20116(dbma1).Replace("[", "").Replace("]", ""); string investorCancelReserveReasonType = C201.FC20132(dbma1).Replace("[", "").Replace("]", ""); string investorRefuseReserveReasonType = C201.FC20133(dbma1).Replace("[", "").Replace("]", ""); //获取债权信息 var crDataList = dbma1.VP101001s.OrderByDescending(c => c.publishDate).Take(pageSize).ToList(); string crDataListStr = C101.FC10107(crDataList); string userName = dbma1.U000s.Where(c => c.userSN == userSN).First().name; string res = string.Format("{{\"status\":\"true\",\"uipData\":{{\"SltConfigData\":[{0},{1},{2},{3},{4},{5},{6}]}},\"crDate\":{7},\"maxDatetime\":\"{8}\",\"userName\":\"{9}\",\"userSN\":\"{10}\"}}", provinceData, guaranteeType, repaymentType, capitalPurposeType, repaymentSourceType, investorCancelReserveReasonType, investorRefuseReserveReasonType, crDataListStr, DateTime.Now, userName, userSN); return(res); } }
public string FP70102(int pageSize) { string userSN = session["userSN"].ToString(); //string userSN = "U00001"; using (DBMA1DataContext dbma1 = new DBMA1DataContext()) { var groupDataList = (from c in dbma1.F006s where c.userSN == userSN select new { c.acquireDate, c.businessSN, c.businessType, c.transactionMoneyAmount, c.groupUpValue }).Take(pageSize).ToList(); return(string.Format("{{\"dataList\":{0},\"maxDatetime\":\"{1}\"}}", C101.FC10107(groupDataList), DateTime.Now)); } }
public string FP50201(int pageSize) { //判断是否登录 if (session["userSN"] == null) { return("notLogin"); } string userSN = session["userSN"].ToString(); using (DBMA1DataContext dbma1 = new DBMA1DataContext()) { //判断是否有权限 var data = dbma1.U001s.Where(c => c.userSN == userSN).First(); bool ifBillOverdue = C201.FC20153(dbma1, userSN); if (data.consultantStatus != true || ifBillOverdue == true) { return("{\"status\":\"false\"}"); } //用户名 string name = dbma1.U000s.Where(c => c.userSN == userSN).First().name; //select信息 string assetsType = C201.FC20108(dbma1).Replace("[", "").Replace("]", ""); string consultantRefuseReserveReasonType = C201.FC20135(dbma1).Replace("[", "").Replace("]", ""); string consultantAuditNotPassReasonType = C201.FC20136(dbma1).Replace("[", "").Replace("]", ""); //预约中债权 var crDataList = (from c in dbma1.VP502001s where c.consultantUserSN == userSN orderby c.sendTime descending select c).Take(pageSize).ToList(); string crDataListStr = C101.FC10107(crDataList); return(string.Format("{{\"status\":\"true\",\"name\":\"{0}\",\"SltConfigData\":[{1},{2},{3}],\"crDataList\":{4},\"maxDatetime\":\"{5}\",\"userSN\":\"{6}\"}}", name, assetsType, consultantRefuseReserveReasonType, consultantAuditNotPassReasonType, crDataListStr, DateTime.Now, userSN)); } }
public string FP70103(DateTime maxDatetime, int pageFrom, int pageSize) { string userSN = session["userSN"].ToString(); //string userSN = "U00001"; using (DBMA1DataContext dbma1 = new DBMA1DataContext()) { var groupDataList = (from c in dbma1.F006s where c.userSN == userSN && maxDatetime > c.acquireDate select new { c.acquireDate, c.businessSN, c.businessType, c.transactionMoneyAmount, c.groupUpValue }).Skip(pageFrom).Take(pageSize).ToList(); return(C101.FC10107(groupDataList)); } }
public string FINIT(int pageSize) { string pawnStr = string.Empty; string dataListStr = string.Empty; using (DBBC1DataContext dbbc1 = new DBBC1DataContext()) { //数据 var dataList = dbbc1.B200s.Take(pageSize).ToList(); dataListStr = C101.FC10107(dataList); using (DBBS1DataContext dbbs1 = new DBBS1DataContext()) { //uip pawnStr = C102.FC20108(dbbs1); //服务状态 string serverStatusListStr = GetServerStatusList(dataList); return(string.Format("{{\"dataList\":{0},\"serverStatusList\":{1},\"pawn\":{2}}}", C101.FC10107(dataList), serverStatusListStr, pawnStr)); } } }
public string FP40103(string sellerSN) { using (DBMA1DataContext dbma1 = new DBMA1DataContext()) { var sellerData = (from c in dbma1.VP801001s where c.userSN == sellerSN select new { c.userSN, c.birthday, c.gender, c.registeredResidence, idCard = c.idCard.Substring(0, 6) + "*", c.maritalStatusType, c.procreateStatus, }).First(); string sellerDataStr = C101.FC10107(sellerData); int amount = SellerSuccessCaseAmount(dbma1, sellerSN); return(string.Format("{{\"data\":{0},\"amount\":\"{1}\"}}", sellerDataStr, amount)); } }
//出售方信息 private string SellerData(DBMA1DataContext dbma1, string userSN) { var sellerInfo = (from c in dbma1.VP801001s where c.userSN == userSN select new { c.userSN, c.name, c.birthday, c.gender, c.registeredResidence, idCard = c.idCard.Substring(0, 6) + "*", phone = c.phone.Substring(0, 3) + "****" + c.phone.Substring(7, 4), c.email, c.maritalStatusType, c.procreateStatus, c.currentAddressProvince, c.currentAddressCity, c.currentAddressDetails }).First(); return(C101.FC10107(sellerInfo)); }
/// <summary> /// 初始化 /// </summary> public string FP30101(int pageSize) { //判断是否登录 if (session["userSN"] == null) { return("notLogin"); } string userSN = session["userSN"].ToString(); using (DBMA1DataContext dbma1 = new DBMA1DataContext()) { //判断是否有权限 var data = dbma1.U001s.Where(c => c.userSN == userSN).First(); bool ifBillOverdue = C201.FC20153(dbma1, userSN); if (data.assetsSellingStatus != true || ifBillOverdue == true) { return("{\"status\":\"false\"}"); } string userName = dbma1.U000s.Where(c => c.userSN == userSN).First().name; string provinceData = C201.FC20121(dbma1).Replace("[", "").Replace("]", ""); string assetsType = C201.FC20108(dbma1).Replace("[", "").Replace("]", ""); string assetsSourceType = C201.FC20109(dbma1).Replace("[", "").Replace("]", ""); string useStatusType = C201.FC20110(dbma1).Replace("[", "").Replace("]", ""); string RejectReason = C201.FC20138(dbma1); var vp401001List = (from c in dbma1.VP401001s where c.publisherUserSN == userSN orderby c.publishDate descending select c).Take(pageSize).ToList(); string vp401001ListStr = C101.FC10107(vp401001List); return(string.Format("{{\"status\":\"true\",\"userName\":\"{0}\",\"SltConfigData\":[{1},{2},{3},{4}],\"assetsDataList\":{5},\"maxDatetime\":\"{6}\",\"RejectReason\":{7},\"userSN\":\"{8}\"}}", userName, provinceData, assetsType, assetsSourceType, useStatusType, vp401001ListStr, DateTime.Now, RejectReason, userSN)); } }
public string FP90302(DateTime maxDatetime, int pageFrom, int pageSize) { string userSN = session["userSN"].ToString(); //string userSN = "U00001"; using (DBMA1DataContext dbma1 = new DBMA1DataContext()) { var linqDataList = (from c in dbma1.F003s where c.generetorUserSN == userSN && maxDatetime >= c.generateDate select new { c.revenueExpenditureSN, c.generateDate, c.type, c.revenue, c.expenditure, c.balance } ).Skip(pageFrom).Take(pageSize).ToList(); return(C101.FC10107(linqDataList)); } }
/// <summary> /// 滚动获取债权信息 /// </summary> public string FP10102(DateTime maxDatetime, int pageFrom, int pageSize, string keyword, string provinceSN, string citySN, string capitalPurposeSN, string paymentTypeSN, string guaranteeTypeSN, string financingMain, string sortStr) { using (DBMA1DataContext dbma1 = new DBMA1DataContext()) { var searchLinq = Search(dbma1, keyword, provinceSN, citySN, capitalPurposeSN, paymentTypeSN, guaranteeTypeSN, financingMain, sortStr); List <VP101001> crList = new List <VP101001>(); if (sortStr == ",") { crList = (from c in searchLinq where maxDatetime >= c.publishDate orderby c.publishDate descending select c).Skip(pageFrom).Take(pageSize).ToList(); } else { crList = (from c in searchLinq where maxDatetime >= c.publishDate select c).Skip(pageFrom).Take(pageSize).ToList(); } return(C101.FC10107(crList)); } }