private DataGridViewModel <Dictionary <string, object> > GetDataList(CountDownQuery query) { DataGridViewModel <Dictionary <string, object> > dataGridViewModel = new DataGridViewModel <Dictionary <string, object> >(); if (query != null) { DbQueryResult countDownList = PromoteHelper.GetCountDownList(query); dataGridViewModel.rows = DataHelper.DataTableToDictionary(countDownList.Data); dataGridViewModel.total = countDownList.TotalRecords; foreach (Dictionary <string, object> row in dataGridViewModel.rows) { CountDownInfo countDownInfo = row.ToObject <CountDownInfo>(); int num = 0; if (countDownInfo.StartDate > DateTime.Now) { num = 1; } else if (countDownInfo.EndDate < DateTime.Now) { num = 2; } row.Add("State", num); } } return(dataGridViewModel); }
private void BindCountDown() { DbQueryResult countDownList = PromoteHelper.GetCountDownList(new GroupBuyQuery { ProductName = this.productName, PageIndex = this.pager.PageIndex, PageSize = this.pager.PageSize, SortBy = "DisplaySequence", SortOrder = SortAction.Desc }); this.grdCountDownsList.DataSource = countDownList.Data; this.grdCountDownsList.DataBind(); this.pager.TotalRecords = countDownList.TotalRecords; this.pager1.TotalRecords = countDownList.TotalRecords; }
private void BindCountDown() { GroupBuyQuery query = new GroupBuyQuery(); query.ProductName = productName; query.PageIndex = pager.PageIndex; query.PageSize = pager.PageSize; query.SortBy = "DisplaySequence"; query.SortOrder = SortAction.Desc; DbQueryResult countDownList = PromoteHelper.GetCountDownList(query); grdCountDownsList.DataSource = countDownList.Data; grdCountDownsList.DataBind(); pager.TotalRecords = countDownList.TotalRecords; pager1.TotalRecords = countDownList.TotalRecords; }
private void BindCountDown() { DbQueryResult countDownList = PromoteHelper.GetCountDownList(new GroupBuyQuery { ProductName = this.productName, PageIndex = this.pager.PageIndex, PageSize = this.pager.PageSize, SortBy = "DisplaySequence", SortOrder = SortAction.Desc, SupplierId = UserHelper.GetAssociatedSupplierId(HiContext.Current.User.UserId) }); this.grdCountDownsList.DataSource = countDownList.Data; this.grdCountDownsList.DataBind(); this.pager.TotalRecords = countDownList.TotalRecords; this.pager1.TotalRecords = countDownList.TotalRecords; }