public PageModel <FightGroupActivitiyModel> GetFightGroupActivitieLists(FightGroupActivityQuery query) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append(" (StartDate >= getdate () OR getdate () BETWEEN StartDate AND EndDate) "); if (query.ProductId.HasValue) { stringBuilder.Append(" AND ProductId = @ProductId"); } if (!string.IsNullOrEmpty(query.ProductName)) { stringBuilder.Append(" AND ProductId = IN(SELECT ProductId FROM Hishop_Products WHERE ProductName like '%" + DataHelper.CleanSearchString(query.ProductName) + "%')"); } if (query.Status.HasValue) { stringBuilder.Append(" AND fga.Status = @Status"); } if (query.UserId.HasValue) { stringBuilder.Append(" AND fga.FightGroupActivityId IN (SELECT FightGroupActivityId FROM Hishop_FightGroups WHERE UserId = @UserId)"); } StringBuilder stringBuilder2 = new StringBuilder(); stringBuilder2.Append("* ,(select min(fgs.SalePrice) from Hishop_FightGroupSkus fgs where fgs.FightGroupActivityId = fga.FightGroupActivityId) FightPrice,"); stringBuilder2.Append(" (select min( SalePrice) from Hishop_SKUs s where s.ProductId = fga.ProductId) SalePrice"); return(DataHelper.PagingByRownumber <FightGroupActivitiyModel>(query.PageIndex, query.PageSize, query.SortBy, query.SortOrder, query.IsCount, "Hishop_FightGroupActivities fga", "FightGroupActivityId", stringBuilder.ToString(), stringBuilder2.ToString())); }
private void FightGroupActivities() { int num = this.context.Request["PageIndex"].ToInt(0); int num2 = this.context.Request["PageSize"].ToInt(0); FightGroupActivityQuery fightGroupActivityQuery = new FightGroupActivityQuery(); fightGroupActivityQuery.PageIndex = ((num == 0) ? 1 : num); fightGroupActivityQuery.PageSize = ((num2 == 0) ? 3 : num2); fightGroupActivityQuery.SortBy = "DisplaySequence DESC,FightGroupActivityId"; fightGroupActivityQuery.SortOrder = SortAction.Asc; fightGroupActivityQuery.IsCount = true; PageModel <FightGroupActivitiyModel> fightGroupActivitieLists = VShopHelper.GetFightGroupActivitieLists(fightGroupActivityQuery); List <FightGroupActivitiyModel> dtResult = fightGroupActivitieLists.Models.ToList(); string s = this.BuildFightGroupActivities(dtResult); this.context.Response.Write(s); }
protected override void AttachChildControls() { int num = this.Page.Request["PageIndex"].ToInt(0); int num2 = this.Page.Request["PageSize"].ToInt(0); FightGroupActivityQuery fightGroupActivityQuery = new FightGroupActivityQuery(); fightGroupActivityQuery.PageIndex = ((num == 0) ? 1 : num); fightGroupActivityQuery.PageSize = ((num2 == 0) ? 3 : num2); fightGroupActivityQuery.SortBy = "DisplaySequence DESC,FightGroupActivityId"; fightGroupActivityQuery.SortOrder = SortAction.Asc; fightGroupActivityQuery.IsCount = true; this.rptFightGroupActivities = (WapTemplatedRepeater)this.FindControl("rptFightGroupActivities"); this.rptFightGroupActivities.ItemDataBound += this.rptFightGroupActivities_ItemDataBound; PageModel <FightGroupActivitiyModel> fightGroupActivitieLists = VShopHelper.GetFightGroupActivitieLists(fightGroupActivityQuery); this.rptFightGroupActivities.DataSource = fightGroupActivitieLists.Models; this.rptFightGroupActivities.DataBind(); if (fightGroupActivitieLists.Total == 0) { this.Page.Response.Redirect("FightGroupNever.aspx"); } }