private void dataBound(int currentPageNum) { tBMulChannelPosting.Rows.Clear(); DataView dPosting = new DataView(); if ("New".Equals(ucDisType)) { Pager_Control1.Visible = false; dPosting = FundDataMem.GetData(FundDataSetType.FundDataType.基金资讯, "STANDBYFILEDONE:" + ucFundID + ";DISPLAYNUM:" + ConfigReader.GetConfigStr("FundItem.xml", "CONFIG", "MCMSDISNUM")); } else { Pager_Control1.Visible = true; FundDataObj fundObj = new FundDataObj(); fundObj = FundDataMem.GetData(FundDataSetType.FundDataType.基金资讯, "STANDBYFILEDONE:" + ucFundID, currentPageNum, 20); if (fundObj == null) { tBMulChannelPosting.Visible = false; lbTip.Visible = true; return; } dPosting = fundObj.FundView; Pager_Control1.TotalPage = Convert.ToString(fundObj.PageCount); Pager_Control1.TotalNum = Convert.ToString(fundObj.RecordCount); } if (dPosting.Count != 0) { tBMulChannelPosting.Visible = true; lbTip.Visible = false; DataTable dt = dPosting.Table; HtmlTableRow r; HtmlTableCell c; HtmlAnchor Link; string DeclareTitle; int i = 0; while (i <= dt.Rows.Count - 1) { r = new HtmlTableRow(); c = new HtmlTableCell(); Link = new HtmlAnchor(); DeclareTitle = Convert.ToString(dt.Rows[i]["DISPLAYNAME"]); Link.InnerText = "·" + ((ucTitleLength == 0) ? DeclareTitle : ((ucTitleLength >= DeclareTitle.Length) ? DeclareTitle : DeclareTitle.Substring(0, ucTitleLength) + "…")); Link.HRef = HttpUtility.UrlPathEncode(Convert.ToString(dt.Rows[i]["PATH"])); Link.Target = "_blank"; c.Align = Convert.ToString(HorizontalAlign.Left); c.VAlign = Convert.ToString(VerticalAlign.Middle); c.Controls.Add(Link); if ("New".Equals(ucDisType)) { c.NoWrap = false; } r.Cells.Add(c); if (! "New".Equals(ucDisType)) { c = new HtmlTableCell(); c.Align = Convert.ToString(HorizontalAlign.Left); c.VAlign = Convert.ToString(VerticalAlign.Middle); Label lb = new Label(); lb.Text = Convert.ToString(dt.Rows[i]["PUBLISHEDDATE"]); c.Controls.Add(lb); r.Cells.Add(c); } tBMulChannelPosting.Rows.Add(r); i++; } } else { tBMulChannelPosting.Visible = false; lbTip.Visible = true; } }
private void dataBound(int currentPageNum) { DataView dDeclare = new DataView(); if ("New".Equals(ucDisType)) { Pager_Control1.Visible = false; dDeclare = FundDataMem.GetData(FundDataSetType.FundDataType.基金最新公告, "FUNDID:" + ucFundID + ";DISPLAYNUM:3"); } else { Pager_Control1.Visible = true; FundDataObj fundObj = new FundDataObj(); switch (ucDeclareType) { case "Law": fundObj = FundDataMem.GetData(FundDataSetType.FundDataType.基金法律文件, "FUNDID:" + ucFundID, currentPageNum, 20); break; case "Time": fundObj = FundDataMem.GetData(FundDataSetType.FundDataType.基金定时公告, "FUNDID:" + ucFundID, currentPageNum, 20); break; case "Declare": fundObj = FundDataMem.GetData(FundDataSetType.FundDataType.基金公告, "FUNDID:" + ucFundID, currentPageNum, 20); break; default: ucDeclareType = "ucDeclareType"; fundObj = FundDataMem.GetData(FundDataSetType.FundDataType.基金公告, "FUNDID:" + ucFundID, currentPageNum, 20); break; } if (fundObj != null) { dDeclare = fundObj.FundView; Pager_Control1.TotalPage = Convert.ToString(fundObj.PageCount); Pager_Control1.TotalNum = Convert.ToString(fundObj.RecordCount); } } if (dDeclare!=null && dDeclare.Count != 0) { StringBuilder tDeclare = new StringBuilder(); tDeclare.Append ( "<table width=\"100%\" border=\"0\" cellpadding=\"5\" cellspacing=\"1\" bgcolor=\"#DDDDDD\">"); string DeclareTiele; int i = 0; while (i <= dDeclare.Table.Rows.Count - 1) { DeclareTiele = Convert.ToString(dDeclare.Table.Rows[i]["HEADLINES"]); DeclareTiele= (40 >= DeclareTiele.Length) ? DeclareTiele : DeclareTiele.Substring(0, 40) + "..."; tDeclare.Append ("<tr bgcolor=\""); tDeclare.Append ((((i%2)==1) ? "#F7F7F7" : "#FFFFFF") + "\">"); tDeclare.Append ( "<td height=\"20\" bgcolor=\""); tDeclare.Append (( ((i%2)==1) ? "#F7F7F7" : "#FFFFFF") + "\" class=\"text\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td align=\"left\">"); tDeclare.Append ( "<a href=\"#\" class=\"text_underlinefund\" ><span class=\"more\"><strong class=\"more\">·</strong></span></a><a href=\"#\" class=\"text\" "); tDeclare.Append ( " onclick=\"FundDeclareClick('"); tDeclare.Append ( HttpUtility.UrlEncode(Convert.ToString(dDeclare.Table.Rows[i]["HEADLINES"])) + "','"); tDeclare.Append ( HttpUtility.UrlEncode(Convert.ToString(dDeclare.Table.Rows[i]["TEXT"])) + "','" + ucDeclareType + "','" + Convert.ToString(dDeclare.Table.Rows[i]["DIS_DATE"]) + "')\" >"); tDeclare.Append ( DeclareTiele); tDeclare.Append ("</a></td><td width=\"13%\" align=\"center\" class=\"text\">"); tDeclare.Append (Convert.ToString(dDeclare.Table.Rows[i]["DIS_DATE"])); tDeclare.Append(")</td></tr></table></td></tr>"); i++; } tDeclare.Append ( "</table>"); lbTip.Text = tDeclare.ToString(); } else { lbTip.Text = "对不起,没有可显示的数据"; Pager_Control1.Visible = false; } }
public void dataBound(int currentPageNum) { GridFund.Dispose(); string ErrUrl = ""; string FundType = ""; FundInfoCheck.CheckFundId(HidNAVFundID.Value, ref FundType, ref ErrUrl); HidNAVFundType.Value = FundType; if (!"".Equals(ErrUrl)) { Response.Redirect(ErrUrl); } FundDataObj fundObj = new FundDataObj(); if (DropDownListDate.Items.Count > 0) { string StartTime = DropDownListDate.SelectedItem.Text; //if (HidNAVFundType.Value.Contains("货币")) //{ // fundObj = FundDataMem.GetData(FundDataSetType.FundDataType.货币基金净值历史, "FUNDID:" + HidNAVFundID.Value + ";TIMEBETWEEN:ISWEBCHART.否" + (("".Equals(StartTime)) ? "" : (",ISTIMESTAMP.YES,STARTTIME." + StartTime)), FundDataSetType.FundSortType.净值日期降序, currentPageNum, 30); //} //else //{ // fundObj = FundDataMem.GetData(FundDataSetType.FundDataType.非货币基金净值历史, "FUNDID:" + HidNAVFundID.Value + ";TIMEBETWEEN:ISWEBCHART.否" + (("".Equals(StartTime)) ? "" : (",ISTIMESTAMP.YES,STARTTIME." + StartTime)), FundDataSetType.FundSortType.净值日期降序, currentPageNum, 30); //} if (ChangeBtn.Text.Contains("历史")) // 近期 { StartTime = "全部日期".Equals(DropDownListDate.SelectedItem.Text) ? "" : DropDownListDate.SelectedItem.Text; fundObj = FundDataMem.GetData(FundDataSetType.FundDataType.CHART_NAV, "FUNDID:" + HidNAVFundID.Value + ";CHARTFUNDTYPE:FUND;TIMEBETWEEN:ISWEBCHART.否" + (("".Equals(StartTime)) ? "" : (",ISTIMESTAMP.YES,STARTTIME." + StartTime)), FundDataSetType.FundSortType.净值日期降序, currentPageNum, 30); if (fundObj.RecordCount != 0) { DataDis(); Pager_Control1.TotalPage = Convert.ToString(fundObj.PageCount); Pager_Control1.TotalNum = Convert.ToString(fundObj.RecordCount); GridFund.Visible = true; GridFund.DataSource = fundObj.FundView; GridFund.DataBind(); } else { DataException(); } } else { SqlParameter[] sp = new SqlParameter[6]; sp[0] = new SqlParameter("@fundId", HidNAVFundID.Value); sp[1] = new SqlParameter("@disdate", StartTime.Replace("-","")); sp[2] = new SqlParameter("@pagesize", 30); sp[3] = new SqlParameter("@pageindex", currentPageNum); sp[4] = new SqlParameter("@totalpage", SqlDbType.Int); sp[4].Direction = ParameterDirection.Output; sp[5] = new SqlParameter("@totalrecord", SqlDbType.Int); sp[5].Direction = ParameterDirection.Output; System.Data.DataSet ds = new System.Data.DataSet(); if (HidNAVFundType.Value.Contains("货币")) { FundDataServ.GetAllData(ref ds, "PROC_FUNDSHISMONNAV_HISTORY", ref sp); } else { FundDataServ.GetAllData(ref ds, "PROC_FUNDSHISNAV_HISTORY", ref sp); } if (ds != null && ds.Tables.Count > 0) { DataTable dt = new DataTable(); foreach (DataTable a in ds.Tables) { if (a.Rows.Count != 0) { dt = a; } } if (dt.Rows.Count != 0) { DataDis(); Pager_Control1.TotalPage = sp[4].Value.ToString(); Pager_Control1.TotalNum = sp[5].Value.ToString(); GridFund.Visible = true; GridFund.DataSource = dt; GridFund.DataBind(); } else { DataException(); } } else { DataException(); } } } else { DataException(); } }