protected bool GetData() { if (!InfoType.ToText().IsIn("1;2")) { return(false); } if (InfoType == 1) { NewsBLL bll = new NewsBLL(); NewsInfo model = bll.GetNewsInfo(NewsId.ToInt(0)); if (model == null) { return(false); } strTitle = model.Title; Content = model.Content; AddDate = (model.AddDate ?? DateTime.Today).ToString("yyyy-MM-dd"); } else if (InfoType == 2) { VideoBLL bll = new VideoBLL(); VideoInfo model = bll.GetVideoInfo(SafeConvert.ToGuid(NewsId).Value); if (model == null) { return(false); } strTitle = model.Title; AddDate = (model.AddDate ?? DateTime.Today).ToString("yyyy-MM-dd"); VideoPath = model.videopath; } return(true); }
protected void Page_Load(object sender, EventArgs e) { weOrderId = SafeConvert.ToGuid(WEBRequest.GetQueryString("OrderId")); Guid userid = WebUserAuth.UserId.Value; if (userid == null || userid == Guid.Empty) { Response.Redirect("/user/login.aspx?ReturnUrl=" + Request.Url.AbsolutePath); return; } WeOrderBLL webll = new WeOrderBLL(); model = webll.GetWeOrderInfoById(weOrderId.Value); }
//private JunTeEntities dbread = JunTeEntities.Read(); public void GetSMBJingZhiPageList() { int pagesize = SafeConvert.ToInt32(Context.Request.Form["pagesize"], 6); int pageindex = SafeConvert.ToInt32(Context.Request.Form["pageindex"], 1); if (pageindex < 1) { pageindex = 1; } Guid projectid = SafeConvert.ToGuid(Context.Request.Form["projectid"]) ?? Guid.Empty; if (projectid == Guid.Empty) { PrintJson("-1", "项目编号有误"); } string sql = @"SELECT @Total=COUNT(1) FROM ProjectFundDetail_SM(NOLOCK) WHERE projectId=@projectId; SELECT * FROM ( SELECT ROW_NUMBER() OVER(ORDER BY PriceDate DESC) AS RowNumber,* FROM ProjectFundDetail_SM(NOLOCK) WHERE projectId=@projectId )T WHERE T.RowNumber BETWEEN (@pageIndex-1)*@pageSize+1 AND @pageIndex*@pageSize"; //var whereParams = new[] //{ // new SqlParameter("@Total", 0), new SqlParameter("@projectId", projectid), // new SqlParameter("@pageIndex", pageindex), // new SqlParameter("@pageSize", pagesize) //}; //whereParams[0].Direction = ParameterDirection.Output; var paras = new Dapper.DynamicParameters(); paras.Add("@Total", 0, DbType.Int32, ParameterDirection.Output); paras.Add("@pageIndex", pageindex); paras.Add("@pageSize", pagesize); paras.Add("@projectId", projectid); var list = new List <SMBProjectFundDetailInfo>(); //list = dbread.ExecuteStoreQuery<SMBProjectFundDetailInfo>(sql, whereParams).ToList(); list = TuanDai.DB.TuanDaiDB.Query <SMBProjectFundDetailInfo>(TdConfig.DBRead, sql, ref paras); int totalItemCount = paras.Get <int>("@Total"); //int.TryParse(whereParams[0].Value.ToString(), out totalItemCount); var sb = new StringBuilder(); int index = 1; double divide = totalItemCount / pagesize; double floor = Math.Floor(divide); if (totalItemCount % pagesize != 0) { floor++; } int pageCount = Convert.ToInt32(floor); //总页数 sb.Append("{\"result\":\"1\",\"pageCount\":\"" + pageCount + "\",\"list\":["); foreach (SMBProjectFundDetailInfo item in list) { sb.Append("{"); sb.AppendFormat("\"PriceDate\":\"{0}\",", item.PriceDate.ToString("yyyy-MM-dd")); sb.AppendFormat("\"Price\":\"{0}\",", item.Price); sb.AppendFormat("\"TotalPrice\":\"{0}\"", item.TotalPrice); sb.Append("},"); if (list.Count == index) { sb.Length = sb.Length - 1; } index++; } sb.Append("]}"); Context.Response.Write(sb.ToString()); Context.Response.End(); }
public void GetMyFtbInvestList() { Guid?weOrderId = SafeConvert.ToGuid(WEBRequest.GetFormString("weOrderId")); int pageIndex; int.TryParse(Context.Request["pageIndex"], out pageIndex); int totalCount = 0; List <WeFTBWxInvestInfo> dataList = null; if (GlobalUtils.IsOpenSubscribeApi)//走CDC查询服务 { string err = ""; string resp = HttpClient.HttpUtil.HttpGet(TdConfig.ApplicationName, GlobalUtils.SubApiUrl + "/app/appGetMyFTBClaimDetail?weOrderId=" + weOrderId + "&userId=" + WebUserAuth.UserId.Value + "&pagesize=15&pageindex=" + pageIndex, "", out err); if (!string.IsNullOrEmpty(resp)) { var pub = JsonConvert.DeserializeObject < ResponsePublicModel <ResponseGeWeFTBWxInvestInfo> >(resp); if (pub != null) { dataList = pub.data.dataList; totalCount = pub.data.totalCount; } } //dataList = service.GetDataPager<WeFTBWxInvestInfo>("/app/APPGetMyFTBClaimDetail", param, // out totalCount); } else { string strSQL = @"SELECT * FROM ( select SUM(1) OVER() as TotalCount, s.Id as SubscribeId,s.ContractNo,p.[Type], case when isnull(s.TotalShares,0)=0 and isnull(s.TransferedShares,0)=0 then s.Amount when isnull(s.TransferedShares,0)>0 and (s.TotalShares=0 or s.TotalShares=s.TransferedShares) then ISNULL(s.TranedAmount,0) else s.Amount+isnull(s.TranedAmount,0) end Amount,p.Title,u.RealName as UserName,isnull(s.TranDate,s.AddDate) as AddDate, isnull(s.IsFromTran,0) as IsFromTran, s.TranId, ROW_NUMBER() OVER(order by s.AddDate desc) rownumber from Subscribe s with(nolock) left join Project p with(nolock) on s.ProjectId=p.Id left join UserBasicInfo u with(nolock) on p.UserId=u.Id where s.SubscribeUserId=@userId AND s.WeOrderId=@weOrderId and s.ContractNo not like '%[_]%' )M WHERE M.rownumber> @pagesize*(@pageindex-1) and M.rownumber<=@pagesize*@pageindex "; Dapper.DynamicParameters dyParams = new Dapper.DynamicParameters(); dyParams.Add("@weOrderId", weOrderId); dyParams.Add("@userId", WebUserAuth.UserId.Value); dyParams.Add("@pagesize", 15); dyParams.Add("@pageindex", pageIndex); dataList = TuanDai.DB.TuanDaiDB.Query <WeFTBWxInvestInfo>(TdConfig.ApplicationName, TdConfig.DBRead, strSQL, ref dyParams); if (dataList != null && dataList.Count > 0) { totalCount = dataList[0].TotalCount; foreach (var item in dataList) { if (item.UserName != null) { if (item.UserName.Length > 1) { item.UserName = item.UserName.Substring(0, 1) + "**"; } } } } } if (dataList != null && dataList.Count > 0) { WebSettingInfo ftzqSet = new WebSettingBLL().GetWebSettingInfo("BA8B8D06-A510-436C-B996-3D66D43FDF40"); foreach (var item in dataList) { item.IsFromTran = item.IsFromTran && item.AddDate > DateTime.Parse(ftzqSet.Param2Value); if (GlobalUtils.IsOpenSubscribeApi) { item.ContractUrl = GetContractViewUrl(item.TypeId, item.IsFromTran, item.ContractUrl, item.SubscribeId); item.Title = item.ProjectTitle; var borrowerModel = new UserBLL().GetUserBasicInfoModelById(item.BorrowerId); if (borrowerModel == null) { borrowerModel = new UserBasicInfoInfo(); } var relName = borrowerModel.RealName; if (!string.IsNullOrEmpty(relName)) { item.UserName = relName.Substring(0, 1) + "**"; } } else { item.ContractUrl = GetContractViewUrl(item.Type, item.IsFromTran, item.ContractNo, item.SubscribeId); } } if (ftzqSet.Param1Value == "1") { DateTime checkDate = DateTime.Parse(ftzqSet.Param2Value.Trim()); //查询是否有承接记录 List <string> subIdList = dataList.Select(p => p.SubscribeId.ToString()).ToList(); if (subIdList != null && subIdList.Any()) { //加开关控制 dataList.ForEach(p => p.IsFromTran = p.AddDate > checkDate && p.IsFromTran); //string strSQL = "select UsedShares,SubscribeId, AddDate from dbo.ProjectFQBExTransfer where SubscribeId in(" + StrObj.StrToInSQL(subIdList) + ")"; //var dyParams = new Dapper.DynamicParameters(); //List<ProjectFQBExTransferInfo> fqbTranList = TuanDai.DB.TuanDaiDB.Query<ProjectFQBExTransferInfo>(TdConfig.ApplicationName, TdConfig.DBRead, strSQL, ref dyParams); //if (fqbTranList == null || fqbTranList.Count == 0 || fqbTranList.Count < dataList.Count) //{ // //查询历史库 // List<ProjectFQBExTransferInfo> fqbTranList2 = TuanDai.DB.TuanDaiDB.Query<ProjectFQBExTransferInfo>(TdConfig.ApplicationName, TdConfig.DBWePlanRead, strSQL, ref dyParams); // if (fqbTranList2 != null) // { // if (fqbTranList == null) // fqbTranList = new List<ProjectFQBExTransferInfo>(); // fqbTranList.AddRange(fqbTranList2); // } //} string subids = ""; if (subIdList != null && subIdList.Count > 0) { foreach (var subid in subIdList) { if (string.IsNullOrEmpty(subids)) { subids = subid.ToUpper(); } else { subids += "," + subid.ToUpper(); } } } List <ProjectFQBExTransferInfo> fqbTranList = GetTranList(subids); if (fqbTranList != null && fqbTranList.Any()) { foreach (var item in dataList) { ProjectFQBExTransferInfo findObj = fqbTranList.Where(p => p.SubscribeId == item.SubscribeId).FirstOrDefault(); if (findObj != null) { //加开关控制 item.IsHaveTranList = findObj.AddDate > checkDate && findObj.UsedShares > 0; } } } } } } this.Context.Response.Write(JsonConvert.SerializeObject( new { result = totalCount > 0 ? 1 : 0, totalcount = totalCount, msg = dataList })); this.Context.Response.End(); }
/// <summary> /// 获取复投宝债仅信息 /// </summary> public void GetWeFtbObligatoryList() { Guid?productId = SafeConvert.ToGuid(WEBRequest.GetFormString("projectid")); int pageSize, pageIndex, totalCount; pageSize = 15; int.TryParse(Context.Request["pageIndex"], out pageIndex); WeFTBBLL weFtBll = new WeFTBBLL(); List <FTBInvestProjectInfo> ftbInvestProjectInfoList = weFtBll.GetFTBObligatoryList(productId.Value, pageSize, pageIndex, out totalCount); List <FTBInvestProjectInfo> newList = new List <FTBInvestProjectInfo>(); for (int i = 0; i < ftbInvestProjectInfoList.Count; i++) { var borrowerName = ftbInvestProjectInfoList[i].BorrowerName; var phone = ftbInvestProjectInfoList[i].TelNo; var IdentityCard = ftbInvestProjectInfoList[i].IdentityCard; var address = ftbInvestProjectInfoList[i].Address.ToText(); if (borrowerName.Length > 0) { borrowerName = borrowerName.Substring(0, 1) + "**"; } if (!phone.IsEmpty()) { if (phone.Length > 11) { phone = phone.Left(11); } phone = StringHandler.MaskTelNo(phone); } if (!string.IsNullOrWhiteSpace(IdentityCard)) { if (IdentityCard.Length > 18) { IdentityCard = IdentityCard.Left(18); } IdentityCard = StringHandler.MaskCardNo(IdentityCard); } if (address.Length > 5) { address = address.Substring(0, 6) + "..."; } FTBInvestProjectInfo tempModel = new FTBInvestProjectInfo(); tempModel.Address = address; tempModel.Amount = ftbInvestProjectInfoList[i].Amount; tempModel.BorrowerName = borrowerName; tempModel.Id = ftbInvestProjectInfoList[i].Id; tempModel.InvestDate = ftbInvestProjectInfoList[i].InvestDate; tempModel.ProductName = ftbInvestProjectInfoList[i].ProductName; tempModel.ProjectTitle = ftbInvestProjectInfoList[i].ProjectTitle; tempModel.ProjectId = ftbInvestProjectInfoList[i].ProjectId; tempModel.TelNo = phone; tempModel.IdentityCard = IdentityCard; newList.Add(tempModel); } this.Context.Response.Write(JsonConvert.SerializeObject( new { result = totalCount > 0 ? 1 : 0, totalcount = totalCount, msg = newList })); this.Context.Response.End(); }