/// <summary> /// 页面控件呈现 /// </summary> private void DrawControl(bool callEvent) { lblCurrentPage.Text = PageIndex.ToString(); lblPageCount.Text = PageCount.ToString(); lblTotalCount.Text = RecordCount.ToString(); txtPageSize.Text = PageSize.ToString(); if (callEvent) { OnPageChanged?.Invoke(this, new PageControlEvemtArgs(this.PageSize, this.pageIndex));//当前分页数字改变时,触发委托事件 } SetFormCtrEnabled(); if (PageCount == 1)//有且仅有一页 { lnkFirst.Enabled = false; lnkPrev.Enabled = false; lnkNext.Enabled = false; lnkLast.Enabled = false; } else if (PageIndex == 1) //第一页 { lnkFirst.Enabled = false; lnkPrev.Enabled = false; } else if (PageIndex == PageCount) //最后一页 { lnkNext.Enabled = false; lnkLast.Enabled = false; } }
public override FileInfo GenerateBankFile() { string[] bankFileHeader = new string[2]; bankFileHeader[0] = "H"; bankFileHeader[1] = "P"; string bankFileHeaderDetail = string.Join(FIELD_DELIMITER, bankFileHeader); //if (bankFileHeaderDetail.Length != 11) // throw new Exception("Incorrect Bank File Header Length:\r\n" + bankFileHeaderDetail); string bankFileData = bankFileHeaderDetail + RECORD_DELIMITER; foreach (GenericBankFileDetail bankFileDetail in BankFileDetails) { bankFileData += GenerateBankFileDetail(bankFileDetail) + RECORD_DELIMITER; } string[] bankFileFooter = new string[3]; bankFileFooter[0] = "T"; bankFileFooter[1] = RecordCount.ToString("0"); bankFileFooter[2] = TotalAmount.ToString("0.00"); string bankFileFooterDetail = string.Join(FIELD_DELIMITER, bankFileFooter); //if (bankFileFooterDetail.Length != 34) // throw new Exception("Incorrect Bank File Header Length:\r\n" + bankFileFooterDetail); bankFileData += bankFileFooterDetail + RECORD_DELIMITER; FileInfo result = GenerateTempFileName(); StreamWriter writer = new StreamWriter(result.OpenWrite()); writer.Write(bankFileData); writer.Close(); return(result); }
private void DrawControl(bool callEvent) { labelCurrentPageNo.Text = PageIndex.ToString(); labelTotalPageNo.Text = PageCount.ToString(); labelTotalRecordCount.Text = RecordCount.ToString(); textBoxPageSize.Text = _pageSize.ToString(); if (callEvent && OnPageChanged != null) { OnPageChanged(this, null);//当前分页数字改变时,触发委托事件 } SetFormCtrEnabled(); if (PageCount == 1)//有且仅有一页 { linkLabelFirst.Enabled = false; linkLabelPrev.Enabled = false; linkLabelNext.Enabled = false; linkLabelLast.Enabled = false; //pictureBoxGo.Enabled = false; } else if (PageIndex == 1)//第一页 { linkLabelFirst.Enabled = false; linkLabelPrev.Enabled = false; } else if (PageIndex == PageCount)//最后一页 { linkLabelNext.Enabled = false; linkLabelLast.Enabled = false; } }
public override FileInfo GenerateBankFile() { string[] bankFileHeader = new string[5]; bankFileHeader[0] = m_AccountHolderName.ToUpper().PadRight(40).Substring(0, 40); string companyAccountNo = m_AccountNo.PadRight(8).Substring(0, 8); companyAccountNo = companyAccountNo.Substring(0, 3) + "-" + companyAccountNo.Substring(3, 4) + "-" + companyAccountNo.Substring(7); bankFileHeader[1] = m_BranchCode.PadRight(3).Substring(0, 3) + "-" + companyAccountNo; bankFileHeader[2] = m_ValueDate.ToString("dd/MM/yy"); bankFileHeader[3] = RecordCount.ToString("00000000"); bankFileHeader[4] = m_TotalAmount.ToString("0.00").PadLeft(13); string bankFileHeaderDetail = string.Join(FIELD_DELIMITER, bankFileHeader); if (bankFileHeaderDetail.Length != 83) { throw new Exception("Incorrect Bank File Header Length:\r\n" + bankFileHeaderDetail); } string bankFileData = bankFileHeaderDetail + RECORD_DELIMITER; foreach (GenericBankFileDetail bankFileDetail in BankFileDetails) { bankFileData += GenerateBankFileDetail(bankFileDetail) + RECORD_DELIMITER; } bankFileData += string.Empty.PadRight(80); FileInfo result = GenerateTempFileName(); StreamWriter writer = new StreamWriter(result.OpenWrite()); writer.Write(bankFileData); writer.Close(); return(result); }
public string PagingMessage(RouteValueDictionaryWrapper routeValueDictionaryWrapper) { return(string.Format("Showing {0} - {1} of {2}" , RecordStart(routeValueDictionaryWrapper).ToString(CultureInfo.InvariantCulture) , RecordEnd(routeValueDictionaryWrapper).ToString(CultureInfo.InvariantCulture) , RecordCount.ToString(CultureInfo.InvariantCulture))); }
protected override string GenerateBankFileFooter() { string[] bankFileFooter = new string[7]; bankFileFooter[0] = "CI"; bankFileFooter[1] = BankCode.PadRight(3).Substring(0, 3) + BranchCode.PadRight(3).Substring(0, 3) + AccountNo.PadRight(8).Substring(0, 8); bankFileFooter[2] = this.AccountHolderName.ToUpper().PadRight(50).Substring(0, 50); if (FileType == FileTypeEnum.Autopay) { bankFileFooter[3] = "CR"; bankFileFooter[4] = ValueDate.ToString("yyyyMMdd"); bankFileFooter[5] = RecordCount.ToString("00000"); bankFileFooter[6] = TotalAmount.ToString("0.00").PadLeft(12); string bankFileFooterData = string.Join(FIELD_DELIMITER, bankFileFooter); if (bankFileFooterData.Length != 93) { throw (new Exception("Incorrect Detail Length of Payment for Footer")); } return(bankFileFooterData); } else { bankFileFooter[3] = ValueDate.ToString("yyyyMMdd"); bankFileFooter[4] = RecordCount.ToString("00000"); bankFileFooter[5] = TotalAmount.ToString("0.00").PadLeft(12); bankFileFooter[6] = string.Empty.PadLeft(7); string bankFileFooterData = string.Join(FIELD_DELIMITER, bankFileFooter); if (bankFileFooterData.Length != 98) { throw (new Exception("Incorrect Detail Length of Payment for Footer")); } return(bankFileFooterData); } }
public void Write(BinaryWriter writer) { if (writer == null) { throw new ArgumentNullException(nameof(writer)); } writer.Write(Convert.ToByte(3)); writer.Write(Convert.ToByte(LastUpdated.Year - 1900)); writer.Write(Convert.ToByte(LastUpdated.Month)); writer.Write(Convert.ToByte(LastUpdated.Day)); writer.Write(RecordCount.ToInt32()); var headerLength = HeaderMetaDataSize + FieldMetaDataSize * Schema.Fields.Length; writer.Write(Convert.ToInt16(headerLength)); writer.Write(Schema.Length.ToInt16()); writer.Write(new byte[17]); writer.Write(CodePage.ToByte()); writer.Write(new byte[2]); foreach (var recordField in Schema.Fields) { recordField.Write(writer); } writer.Write(Terminator); }
/// <summary> /// 页面控件呈现 /// </summary> private void DrawControl(bool callEvent) { btnGo.Text = JumpText; lblCurrentPage.Text = PageIndex.ToString(); lblPageCount.Text = PageCount.ToString(); lblTotalCount.Text = RecordCount.ToString(); txtPageSize.Text = PageSize.ToString(); if (callEvent && OnPageChanged != null) { OnPageChanged(this, null);//当前分页数字改变时,触发委托事件 } SetFormCtrEnabled(); if (PageCount == 1)//有且仅有一页 { lnkFirst.Enabled = false; lnkPrev.Enabled = false; lnkNext.Enabled = false; lnkLast.Enabled = false; btnGo.Enabled = false; } else if (PageIndex == 1)//第一页 { lnkFirst.Enabled = false; lnkPrev.Enabled = false; } else if (PageIndex == PageCount)//最后一页 { lnkNext.Enabled = false; lnkLast.Enabled = false; } }
/// <summary> /// Prints the property status in the trace log. /// </summary> /// <remarks>For debugging purposes only.</remarks> private void PrintStatus() { DebugTrace("CurrentIndex=" + CurrentIndex.ToString()); DebugTrace("PageSize=" + PageSize.ToString()); DebugTrace("RecordCount=" + RecordCount.ToString()); DebugTrace("CurrentGroup=" + CurrentGroup.ToString()); }
protected void Page_Load(object sender, EventArgs e) { if (Session["LoginName"] == null) { Response.Redirect("Login.aspx"); } else if (Session["UserType"] != null) { if (Session["UserType"].ToString() != "admin") { Response.Redirect("UserIndex.aspx"); } } if (!Page.IsPostBack) { CurrentPage = 0; ViewState["PageIndex"] = 0; RecordCount = CalculateRecord(); CountLabel.Text = RecordCount.ToString(); //计算总共有多少页 PageCountdouble = Math.Ceiling((double)RecordCount / (double)PageSize); PageCount = (int)PageCountdouble; lblPageCount.Text = PageCount.ToString(); ViewState["PageCount"] = PageCount; } ListBind(); }
/// <summary> /// 根据不同的条件,改变页面控件的呈现状态 /// </summary> private void DrawControl(bool callEvent) { currentPageLabel.Text = PageIndex.ToString(); pageCountLabel.Text = PageCount.ToString(); totalCountLabel.Text = RecordCount.ToString(); pageSizeComboBox.SelectedItem = PageSize.ToString(); if (callEvent && OnPageChanged != null) { OnPageChanged(this, null);//当前分页数字改变时,触发委托事件 } SetFormCtrEnabled(); if (PageCount == 1)//有且仅有一页时 { firstButton.Enabled = false; previousButton.Enabled = false; nextButton.Enabled = false; lastButton.Enabled = false; goButton.Enabled = false; } else if (PageIndex == 1)//当前页为第一页时 { firstButton.Enabled = false; previousButton.Enabled = false; } else if (PageIndex == PageCount)//当前页为最后一页时 { nextButton.Enabled = false; lastButton.Enabled = false; } }
// 页面控件呈现 private void DrawControl(bool callEvent) { lab_index.Text = PageIndex.ToString(); lab_pagecount.Text = PageCount.ToString(); lab_count.Text = RecordCount.ToString(); if (callEvent && OnPageChanged != null) { OnPageChanged(this, null);//当前分页数字改变时,触发委托事件 } SetFormCtrEnabled(); if (PageCount == 1)//有且仅有一页 { btn_home.Enabled = false; btn_pre.Enabled = false; btn_next.Enabled = false; btn_last.Enabled = false; } else if (PageIndex == 1)//第一页 { btn_home.Enabled = false; btn_pre.Enabled = false; } else if (PageIndex == PageCount)//最后一页 { btn_next.Enabled = false; btn_last.Enabled = false; } }
/// <summary> /// 根据不同的条件,改变页面控件的呈现状态 /// </summary> private void DrawControl(bool callEvent) { lblCurrentPage.Text = PageIndex.ToString(); lblPageCount.Text = PageCount.ToString(); lblTotalCount.Text = RecordCount.ToString(); txtPageSize.Text = PageSize.ToString(); if (callEvent && OnPageChanged != null) { // MessageBox.Show("PageChanged"); OnPageChanged(this, null);//当前分页数字改变时,触发委托事件 } SetFormCtrEnabled(); if (PageCount == 1)//有且仅有一页时 { linkFirst.Enabled = false; linkPrevious.Enabled = false; linkNext.Enabled = false; linkLast.Enabled = false; btnGo.Enabled = false; } else if (PageIndex == 1)//当前页为第一页时 { linkFirst.Enabled = false; linkPrevious.Enabled = false; } else if (PageIndex == PageCount)//当前页为最后一页时 { linkNext.Enabled = false; linkLast.Enabled = false; } }
public override int GetHashCode() { return( PagingResult.GetHashCode() ^ RecordCount.GetHashCode() ^ TotalRecordCount.GetHashCode() ); }
public override int GetHashCode() { return( PageNumber.GetHashCode() ^ PageSize.GetHashCode() ^ RecordCount.GetHashCode() ^ IsFirstPage.GetHashCode() ^ IsLastPage.GetHashCode() ); }
public override int GetHashCode() { return( PagingParams.GetHashCode() ^ RecordCount.GetHashCode() ^ TotalRecordCount.GetHashCode() ^ FirstRecordNum.GetHashCode() ^ LastRecordNum.GetHashCode() ); }
protected void Page_Load(object sender, EventArgs e) { string sms_connstr = System.Configuration.ConfigurationManager.AppSettings["sms_dbconn"]; // 建立连接 sms_conn = new SqlConnection(sms_connstr); PageSize = 8; if (!IsPostBack) { // SMS_DataBand(); //计算总共有多少记录 //CurrentPage = 0; ListBind(); ViewState["PageIndex"] = 0; RecordCount = CalculateRecord(); lblRecordCount.Text = RecordCount.ToString(); //计算总共有多少页 if ((RecordCount % PageSize) == 0) { PageCount = (RecordCount / PageSize); } else { PageCount = (RecordCount / PageSize) + 1; } lblPageCount.Text = PageCount.ToString(); ViewState["PageCount"] = PageCount; //string sms_sqlstr2 = "select specialityname,specialityid from [speciality]"; //SqlDataAdapter sms_da2 = new SqlDataAdapter(sms_sqlstr2, sms_conn); //DataSet sms_ds2 = new DataSet(); //sms_da2.Fill(sms_ds2, "T"); //for (int i = 0; i < sms_ds2.Tables["T"].Rows.Count; i++) //{ // DropDownList1.Items.Add(new ListItem(sms_ds2.Tables["T"].Rows[i]["specialityname"].ToString())); // } // sms_ds2.Clear(); sms_conn.Open(); string sms_sqlstr2 = "select specialityname from [speciality]"; SqlDataAdapter sms_da2 = new SqlDataAdapter(sms_sqlstr2, sms_conn); DataSet sms_ds2 = new DataSet(); sms_da2.Fill(sms_ds2, "T"); sms_conn.Close(); DropDownList1.DataSource = sms_ds2.Tables["T"]; DropDownList1.DataTextField = "specialityname"; DropDownList1.DataValueField = "specialityname"; DropDownList1.DataBind(); sms_ds2.Clear(); sms_ds2.Dispose(); } }
// All the private methods. #region Private Methods /// <summary> /// Builds the information panel content. /// </summary> /// <param name="cell">The table cell.</param> /// <param name="designTime">Specify if we need the design time string.</param> internal override void BuildInfo(TableCell cell, bool designTime) { string info = (this.RecordCount == 0 && !string.IsNullOrEmpty(InfoTemplateNoRecords) ? InfoTemplateNoRecords : InfoTemplate); info = info.Replace("$RECORDCOUNT$", (designTime ? "##" : RecordCount.ToString())); info = info.Replace("$CURRENTPAGE$", (designTime ? "##" : (this.RecordCount == 0 ? "0" : CurrentPage.ToString()))); info = info.Replace("$PAGECOUNT$", (designTime ? "##" : PageCount.ToString())); info = info.Replace("$CURRENTINDEX$", (designTime ? "##" : CurrentIndex.ToString())); System.Web.UI.WebControls.Label infoText = new System.Web.UI.WebControls.Label(); infoText.Text = info; cell.Controls.Add(infoText); }
protected override void WriteDataXML(XElement ele, ElderScrollsPlugin master) { XElement subEle; ele.TryPathTo("Version", true, out subEle); subEle.Value = Version.ToString("G15"); ele.TryPathTo("RecordCount", true, out subEle); subEle.Value = RecordCount.ToString(); ele.TryPathTo("NextObjectID", true, out subEle); subEle.Value = NextObjectID.ToString(); }
/// <summary> /// Replace the property placeholders in the CustomInfoHTML with the property values repectively /// </summary> /// <param name="origText">original CustomInfoHTML</param> /// <returns></returns> private string GetCustomInfoHtml(string origText) { if (!string.IsNullOrEmpty(origText) && origText.IndexOf('%') >= 0) { string[] props = new string[] { "recordcount", "pagecount", "currentpageindex", "startrecordindex", "endrecordindex", "pagesize", "pagesremain", "recordsremain" }; StringBuilder sb = new StringBuilder(origText); Regex reg = new Regex("(?<ph>%(?<pname>\\w{8,})%)", RegexOptions.Compiled | RegexOptions.IgnoreCase); MatchCollection mts = reg.Matches(origText); foreach (Match m in mts) { string p = m.Groups["pname"].Value.ToLower(); if (Array.IndexOf(props, p) >= 0) { string repValue = null; switch (p) { case "recordcount": repValue = RecordCount.ToString(); break; case "pagecount": repValue = PageCount.ToString(); break; case "currentpageindex": repValue = CurrentPageIndex.ToString(); break; case "startrecordindex": repValue = StartRecordIndex.ToString(); break; case "endrecordindex": repValue = EndRecordIndex.ToString(); break; case "pagesize": repValue = PageSize.ToString(); break; case "pagesremain": repValue = PagesRemain.ToString(); break; case "recordsremain": repValue = RecordsRemain.ToString(); break; } if (repValue != null) { sb.Replace(m.Groups["ph"].Value, repValue); } } } return(sb.ToString()); } return(origText); }
protected override string GenerateBankFileFooter() { string[] bankFileFooter = new string[9]; bankFileFooter[0] = "T"; bankFileFooter[1] = RecordCount.ToString("00000"); bankFileFooter[2] = TotalAmount.ToString(string.Empty.PadLeft(13, '0') + ".00").Replace(".", string.Empty); bankFileFooter[3] = string.Empty.PadRight(3479); string bankFileFooterData = string.Join(FIELD_DELIMITER, bankFileFooter); if (bankFileFooterData.Length != 3500) { throw (new Exception("Incorrect Header Length:" + bankFileFooterData.Length)); } return(bankFileFooterData); }
protected override string GenerateBankFileFooter() { string[] bankFileFooter = new string[3]; bankFileFooter[0] = "BULKCSVTRAILER"; bankFileFooter[1] = RecordCount.ToString(); bankFileFooter[2] = TotalAmount.ToString("0.00").Replace(".", string.Empty); //bankFileFooter[3] = string.Empty.PadRight(3479); string bankFileFooterData = "\"" + string.Join(FIELD_DELIMITER, bankFileFooter) + "\""; bankFileFooterData = bankFileFooterData.Replace("\"\"", string.Empty); //if (bankFileFooterData.Length > 41) // throw (new Exception("Incorrect footer Length:" + bankFileFooterData.Length)); return(bankFileFooterData); }
/// <summary> /// 页面变化 /// </summary> /// <param name="callEvent"></param> private void DoDrawControl(bool callEvent) { tPages.Text = PageIndex.ToString(); tPageCount.Text = PageCount.ToString(); tCounts.Text = RecordCount.ToString(); if (UserData && callEvent) { LoadData(); SetButtonEnabled(); return; } if (callEvent && OnPageChanged != null) { OnPageChanged(this, null);//当前分页数字改变时,触发委托事件 } SetButtonEnabled(); }
private void PageState() { LinkBtnNextPage.Enabled = true; LinkBtnPrevPage.Enabled = true; if (CurrentPage == (PageCount - 1)) { LinkBtnNextPage.Enabled = false; } if (CurrentPage == 0) { LinkBtnPrevPage.Enabled = false; } LableCurrentPage.Text = (CurrentPage + 1).ToString(); RecordCount = CalculateRecord(); //计算总共有多少记录 LableRecordCount.Text = RecordCount.ToString(); PageCount = Convert.ToInt32(Math.Ceiling(Convert.ToDouble(RecordCount) / PageSize)); //计算总共有多少页 LablePageCount.Text = PageCount.ToString(); ViewState["PageCount"] = PageCount; }
protected void Page_Load(object sender, EventArgs e) { //设定PageSize PageSize = 1; //连接语句 MyConn = new SqlConnection(ConfigurationManager.AppSettings["conStr"]); MyConn.Open(); DataSet mydataset = new DataSet(); SqlDataAdapter mydataadapter = new SqlDataAdapter("select * from tb_Blog where UserName='******'", MyConn); mydataadapter.Fill(mydataset, "tb_Blog"); DataRowView rowview = mydataset.Tables["tb_Blog"].DefaultView[0]; ID = rowview["BlogID"].ToString(); //第一次请求执行 if (!Page.IsPostBack) { ListBind(); CurrentPage = 0; ViewState["PageIndex"] = 0; //计算总共有多少记录 RecordCount = CalculateRecord(); this.lblRecCount.Text = RecordCount.ToString(); //计算总共有多少页 if (RecordCount % PageSize != 0) { PageCount = RecordCount / PageSize + 1; } else { PageCount = RecordCount / PageSize; } ViewState["PageCount"] = PageCount; } }
/// <summary> /// 验证 /// </summary> public void PageChecking() { lblRecordCount.Text = RecordCount.ToString(); lblCurrentPageIndex.Text = PageIndex.ToString(); lblPageCount.Text = TotaPage.ToString(); default_pgStartRecord.Text = PagestartNumber.ToString(); default_pgEndRecord.Text = PageendNumber.ToString(); if (TotaPage == 0 || TotaPage == 1) { hlkFirst.Enabled = false; hlkPrev.Enabled = false; hlkNext.Enabled = false; hlkLast.Enabled = false; ShowMsgHelper.ShowScript("Script(1)"); } else if (PageIndex == 1) { hlkFirst.Enabled = false; hlkPrev.Enabled = false; hlkNext.Enabled = true; hlkLast.Enabled = true; ShowMsgHelper.ShowScript("Script(2)"); } else if (PageIndex == TotaPage) { hlkFirst.Enabled = true; hlkPrev.Enabled = true; hlkNext.Enabled = false; hlkLast.Enabled = false; ShowMsgHelper.ShowScript("Script(3)"); } else { hlkFirst.Enabled = true; hlkPrev.Enabled = true; hlkNext.Enabled = true; hlkLast.Enabled = true; ShowMsgHelper.ShowScript("Script(4)"); } }
/// <summary> /// 页面控件呈现 /// </summary> private void DrawControl(bool callEvent) { btnGo.Text = JumpText; lblCurrentPage.Text = PageIndex.ToString(); int w = lblCurrentPage.Text.Trim().Length; if (w > 2) { this.panel1.Location = new Point(29 + (w - 2) * 5, 2); } lblPageCount.Text = PageCount.ToString(); lblTotalCount.Text = RecordCount.ToString(); txtPageSize.Text = PageSize.ToString(); if (callEvent && OnPageChanged != null) { OnPageChanged(this, null);//当前分页数字改变时,触发委托事件 } SetFormCtrEnabled(); if (PageCount == 1)//有且仅有一页 { lnkFirst.Enabled = false; lnkPrev.Enabled = false; lnkNext.Enabled = false; lnkLast.Enabled = false; btnGo.Enabled = false; } else if (PageIndex == 1)//第一页 { lnkFirst.Enabled = false; lnkPrev.Enabled = false; } else if (PageIndex == PageCount)//最后一页 { lnkNext.Enabled = false; lnkLast.Enabled = false; } }
/// <summary> /// 页面控件呈现 /// </summary> private void DrawControl(bool callEvent) { bindingNavigatorPositionPage.Text = PageIndex.ToString(); bindingNavigatorCountPages.Text = PageCount.ToString(); tslCounts.Text = RecordCount.ToString(); tstPageCounts.Text = PageSize.ToString(); if (callEvent && OnPageChanged != null) { OnPageChanged(this, null);//当前分页数字改变时,触发委托事件 } if (PageCount == 0) { SetFormCtrEnabled(false); } else { SetFormCtrEnabled(true); } if (PageCount == 1)//有且仅有一页 { bindingNavigatorMoveFirstPage.Enabled = false; bindingNavigatorMovePreviousPage.Enabled = false; bindingNavigatorMoveNextPage.Enabled = false; bindingNavigatorMoveLastPage.Enabled = false; } else if (PageIndex == 1)//第一页 { bindingNavigatorMoveFirstPage.Enabled = false; bindingNavigatorMovePreviousPage.Enabled = false; } else if (PageIndex == PageCount && PageCount != 0)//最后一页 { bindingNavigatorMoveNextPage.Enabled = false; bindingNavigatorMoveLastPage.Enabled = false; } }
protected void Page_Load(object sender, EventArgs e) { divNewBlock.Style["display"] = "none"; if (Session["userName"] == null) { pl1.Visible = true; pl2.Visible = false; } else { pl1.Visible = false; pl2.Visible = true; labMessage.Text = "欢迎" + Session["userName"] + "的光临"; } Session["searinput"] = Request.QueryString["searchinput"];; PageSize = 9; if (!IsPostBack) { ListBind(); CurrentPage = 0; ViewState["PageIndex"] = 0; //计算总共有多少记录 RecordCount = CalculateRecord(); lblRecordCount.Text = RecordCount.ToString(); // Response.Write("RecordCount = " + RecordCount); //计算总共有多少页 PageCount = RecordCount / PageSize; if ((RecordCount * 1.0 / PageSize * 1.0) > PageCount) { PageCount += 1; } lblPageCount.Text = PageCount.ToString(); // Response.Write("lblPageCount.Text = " + lblPageCount.Text); ViewState["PageCount"] = PageCount; } }
/// <summary> /// 刷卡记录条数统计 /// </summary> /// <param name="address"></param> /// <param name="token"></param> /// <returns></returns> public static ResponseData CardRecordCount(string address, string token) { //当天0时0分0秒: DateTime start = Convert.ToDateTime(DateTime.Now.ToString("D").ToString()); //当天23时59分59秒: DateTime end = Convert.ToDateTime(DateTime.Now.AddDays(1).ToString("D").ToString()).AddSeconds(-1); ResponseData response = new ResponseData(); string url_CardRecordCount = address + "/CardSolution/card/accessControl/swingCardRecord/bycondition/combinedCount"; try { var postdata = new { token = token, //pageNum = 1, //pageSize = 20, startSwingTime = start.ToString(), endSwingTime = end.ToString() }; var jsonstr = JsonConvert.SerializeObject(postdata); RecordCount countdata = JsonConvert.DeserializeObject <RecordCount>(PostGetRequest.HttpPost(url_CardRecordCount, jsonstr)); if (countdata.success == "true") { response.code = "200"; response.msg = countdata.data.ToString(); } } catch (Exception e) { response.code = "400"; response.msg = e.Message; } return(response); }