private void CountTotal()
        {
            ActivitySearch activitySearch = new ActivitySearch();

            activitySearch.status    = ActivityStatus.All;
            activitySearch.IsCount   = true;
            activitySearch.PageIndex = this.pager1.PageIndex;
            activitySearch.PageSize  = this.pager1.PageSize;
            activitySearch.SortBy    = "LimitedTimeDiscountId";
            activitySearch.SortOrder = SortAction.Desc;
            DbQueryResult discountQuery = LimitedTimeDiscountHelper.GetDiscountQuery(activitySearch);

            System.Data.DataTable dataTable = (System.Data.DataTable)discountQuery.Data;
            this.lblAll.Text      = ((dataTable != null) ? dataTable.Rows.Count.ToString() : "0");
            activitySearch.status = ActivityStatus.In;
            discountQuery         = LimitedTimeDiscountHelper.GetDiscountQuery(activitySearch);
            dataTable             = (System.Data.DataTable)discountQuery.Data;
            this.lblIn.Text       = ((dataTable != null) ? dataTable.Rows.Count.ToString() : "0");
            activitySearch.status = ActivityStatus.End;
            discountQuery         = LimitedTimeDiscountHelper.GetDiscountQuery(activitySearch);
            dataTable             = (System.Data.DataTable)discountQuery.Data;
            this.lblEnd.Text      = ((dataTable != null) ? dataTable.Rows.Count.ToString() : "0");
            activitySearch.status = ActivityStatus.unBegin;
            discountQuery         = LimitedTimeDiscountHelper.GetDiscountQuery(activitySearch);
            dataTable             = (System.Data.DataTable)discountQuery.Data;
            this.lblUnBegin.Text  = ((dataTable != null) ? dataTable.Rows.Count.ToString() : "0");
        }
        private void BindData()
        {
            string text = this.txtActivityName.Text;

            System.DateTime?selectedDate  = this.calendarStartDate.SelectedDate;
            System.DateTime?selectedDate2 = this.calendarEndDate.SelectedDate;
            DbQueryResult   discountQuery = LimitedTimeDiscountHelper.GetDiscountQuery(new ActivitySearch
            {
                status    = (ActivityStatus)this.status,
                IsCount   = true,
                PageIndex = this.pager1.PageIndex,
                PageSize  = this.pager1.PageSize,
                SortBy    = "LimitedTimeDiscountId",
                SortOrder = SortAction.Desc,
                Name      = text,
                begin     = selectedDate,
                end       = selectedDate2
            });

            System.Data.DataTable dataSource = (System.Data.DataTable)discountQuery.Data;
            this.grdLimitedTimeDiscountList.DataSource = dataSource;
            this.grdLimitedTimeDiscountList.DataBind();
            this.pager1.TotalRecords = discountQuery.TotalRecords;
            this.CountTotal();
        }
Beispiel #3
0
        private void CountTotal()
        {
            ActivitySearch query = new ActivitySearch {
                status    = ActivityStatus.All,
                IsCount   = true,
                PageIndex = this.pager1.PageIndex,
                PageSize  = this.pager1.PageSize,
                SortBy    = "LimitedTimeDiscountId",
                SortOrder = SortAction.Desc
            };
            DataTable data = (DataTable)LimitedTimeDiscountHelper.GetDiscountQuery(query).Data;

            this.lblAll.Text     = (data != null) ? data.Rows.Count.ToString() : "0";
            query.status         = ActivityStatus.In;
            data                 = (DataTable)LimitedTimeDiscountHelper.GetDiscountQuery(query).Data;
            this.lblIn.Text      = (data != null) ? data.Rows.Count.ToString() : "0";
            query.status         = ActivityStatus.End;
            data                 = (DataTable)LimitedTimeDiscountHelper.GetDiscountQuery(query).Data;
            this.lblEnd.Text     = (data != null) ? data.Rows.Count.ToString() : "0";
            query.status         = ActivityStatus.unBegin;
            data                 = (DataTable)LimitedTimeDiscountHelper.GetDiscountQuery(query).Data;
            this.lblUnBegin.Text = (data != null) ? data.Rows.Count.ToString() : "0";
        }