private void RptBind(string strWhere, string orderby) { if (!int.TryParse(Request.Params["page"] as string, out this.page)) { this.page = 0; } Spread.BLL.ReportAccounts bll = new Spread.BLL.ReportAccounts(); //获得总条数 this.pcount = bll.GetRecordCount(strWhere); this.rptList.DataSource = bll.GetPageList(this.pagesize, this.page, strWhere, orderby); this.rptList.DataBind(); }
private void RptBind() { Spread.BLL.ReportAccounts bll = new Spread.BLL.ReportAccounts(); StringBuilder strWhere = new StringBuilder(); strWhere.Append(" and UserID='" + hduserid.Value + "' and Status='已审核' "); if (this.startdate.Value != "") strWhere.Append(" and CONVERT(varchar(100),ApplyTime,23) >='" + this.startdate.Value + "'"); if (this.enddate.Value != "") strWhere.Append(" and CONVERT(DATETIME,ApplyTime) <='" + DateTime.Parse(this.enddate.Value).AddDays(1).ToString("yyyy-MM-dd") + "'"); DataTable dt = bll.GetList(strWhere.ToString()).Tables[0]; lbCount.Text = dt.Rows.Count.ToString(); this.rptList.DataSource = dt; this.rptList.DataBind(); }
//设置操作 protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e) { int id = Convert.ToInt32(((Label)e.Item.FindControl("lb_id")).Text); Spread.BLL.ReportAccounts bll = new Spread.BLL.ReportAccounts(); Spread.Model.ReportAccounts model = bll.GetModel(id); switch (e.CommandName.ToLower()) { case "ibtnstatus": if (model.Status == "待审核") bll.UpdateField(id, "Status='已审核'"); break; } RptBind("Id>0" + this.CombSqlTxt(this.UserType, this.keywords, this.property), "ApplyTime desc"); }