private void CountTotal() { int total = 0; ExChangeSearch search = new ExChangeSearch { status = ExchangeStatus.All, IsCount = true, PageIndex = this.pager.PageIndex, PageSize = this.pager.PageSize, SortBy = "Id", SortOrder = SortAction.Desc }; DataTable table = PointExChangeHelper.Query(search, ref total); this.lblAll.Text = (table != null) ? table.Rows.Count.ToString() : "0"; search.status = ExchangeStatus.In; table = PointExChangeHelper.Query(search, ref total); this.lblIn.Text = (table != null) ? table.Rows.Count.ToString() : "0"; search.status = ExchangeStatus.End; table = PointExChangeHelper.Query(search, ref total); this.lblEnd.Text = (table != null) ? table.Rows.Count.ToString() : "0"; search.status = ExchangeStatus.unBegin; table = PointExChangeHelper.Query(search, ref total); this.lblUnBegin.Text = (table != null) ? table.Rows.Count.ToString() : "0"; }
private void BindData() { int total = 0; string text = this.txt_name.Text; ExChangeSearch search = new ExChangeSearch { status = this.status, ProductName = text, IsCount = true, PageIndex = this.pager.PageIndex, PageSize = this.pager.PageSize, SortBy = "Id", SortOrder = SortAction.Desc }; DataTable table = PointExChangeHelper.Query(search, ref total); if (table != null) { table.Columns.Add("sStatus"); table.Columns.Add("canChkStatus"); if (table.Rows.Count > 0) { for (int i = table.Rows.Count - 1; i >= 0; i--) { DateTime time = DateTime.Parse(table.Rows[i]["BeginDate"].ToString()); DateTime time2 = DateTime.Parse(table.Rows[i]["EndDate"].ToString()); if (time > DateTime.Now) { table.Rows[i]["sStatus"] = "未开始"; table.Rows[i]["canChkStatus"] = string.Empty; } else if ((time2 >= DateTime.Now) && (time <= DateTime.Now)) { table.Rows[i]["sStatus"] = "进行中"; table.Rows[i]["canChkStatus"] = string.Empty; } else if (time2 < DateTime.Now) { table.Rows[i]["sStatus"] = "已结束"; table.Rows[i]["canChkStatus"] = "disabled"; } if (table.Rows[i]["ExChangedNumber"].ToString() == "") { table.Rows[i]["ExChangedNumber"] = "0"; } } } } this.grdProducts.DataSource = table; this.grdProducts.DataBind(); this.pager.TotalRecords = total; this.CountTotal(); }
private void BindData() { int totalRecords = 0; string text = this.txt_name.Text; System.Data.DataTable dataTable = PointExChangeHelper.Query(new ExChangeSearch { status = this.status, ProductName = text, IsCount = true, PageIndex = this.pager.PageIndex, PageSize = this.pager.PageSize, SortBy = "Id", SortOrder = SortAction.Desc }, ref totalRecords); if (dataTable != null) { dataTable.Columns.Add("sStatus"); dataTable.Columns.Add("canChkStatus"); if (dataTable.Rows.Count > 0) { for (int i = dataTable.Rows.Count - 1; i >= 0; i--) { System.DateTime t = System.DateTime.Parse(dataTable.Rows[i]["BeginDate"].ToString()); System.DateTime t2 = System.DateTime.Parse(dataTable.Rows[i]["EndDate"].ToString()); if (t > System.DateTime.Now) { dataTable.Rows[i]["sStatus"] = "未开始"; dataTable.Rows[i]["canChkStatus"] = string.Empty; } else if (t2 >= System.DateTime.Now && t <= System.DateTime.Now) { dataTable.Rows[i]["sStatus"] = "进行中"; dataTable.Rows[i]["canChkStatus"] = string.Empty; } else if (t2 < System.DateTime.Now) { dataTable.Rows[i]["sStatus"] = "已结束"; dataTable.Rows[i]["canChkStatus"] = "disabled"; } if (dataTable.Rows[i]["ExChangedNumber"].ToString() == "") { dataTable.Rows[i]["ExChangedNumber"] = "0"; } } } } this.grdProducts.DataSource = dataTable; this.grdProducts.DataBind(); this.pager.TotalRecords = totalRecords; this.CountTotal(); }
private void CountTotal() { int num = 0; ExChangeSearch exChangeSearch = new ExChangeSearch(); exChangeSearch.status = ExchangeStatus.All; exChangeSearch.IsCount = true; exChangeSearch.PageIndex = this.pager.PageIndex; exChangeSearch.PageSize = this.pager.PageSize; exChangeSearch.SortBy = "Id"; exChangeSearch.SortOrder = SortAction.Desc; System.Data.DataTable dataTable = PointExChangeHelper.Query(exChangeSearch, ref num); this.lblAll.Text = ((dataTable != null) ? dataTable.Rows.Count.ToString() : "0"); exChangeSearch.status = ExchangeStatus.In; dataTable = PointExChangeHelper.Query(exChangeSearch, ref num); this.lblIn.Text = ((dataTable != null) ? dataTable.Rows.Count.ToString() : "0"); exChangeSearch.status = ExchangeStatus.End; dataTable = PointExChangeHelper.Query(exChangeSearch, ref num); this.lblEnd.Text = ((dataTable != null) ? dataTable.Rows.Count.ToString() : "0"); exChangeSearch.status = ExchangeStatus.unBegin; dataTable = PointExChangeHelper.Query(exChangeSearch, ref num); this.lblUnBegin.Text = ((dataTable != null) ? dataTable.Rows.Count.ToString() : "0"); }
public System.Data.DataTable GetExChangeTable(System.Web.HttpContext context, ref int pageCount) { return(PointExChangeHelper.Query(this.GetExChangeSearch(context), ref pageCount)); }