Exemplo n.º 1
0
 private void BindGifts()
 {
     GiftQuery query = new GiftQuery();
     query.Page.PageSize = 10;
     query.Page.PageIndex = pager.PageIndex;
     query.Name = txtSearchText.Text.Trim();
     DbQueryResult gifts = SubsiteSalesHelper.GetGifts(query);
     dlstGifts.DataSource = gifts.Data;
     dlstGifts.DataBind();
     pager.TotalRecords = gifts.TotalRecords;
 }
Exemplo n.º 2
0
 private void BindData()
 {
     GiftQuery query = new GiftQuery();
     query.Name = Globals.HtmlEncode(giftName);
     query.Page.PageSize = pager.PageSize;
     query.Page.PageIndex = pager.PageIndex;
     query.Page.SortBy = grdGift.SortOrderBy;
     if (grdGift.SortOrder.ToLower() == "desc")
     {
         query.Page.SortOrder = SortAction.Desc;
     }
     DbQueryResult gifts = SubsiteGiftHelper.GetGifts(query);
     grdGift.DataSource = gifts.Data;
     grdGift.DataBind();
     pager.TotalRecords = gifts.TotalRecords;
     pager1.TotalRecords = gifts.TotalRecords;
 }
Exemplo n.º 3
0
 public static DbQueryResult GetGifts(GiftQuery query)
 {
     return SalesProvider.Instance().GetGifts(query);
 }
Exemplo n.º 4
0
 public override DbQueryResult GetGifts(GiftQuery query)
 {
     string filter = null;
     if (!string.IsNullOrEmpty(query.Name))
     {
         filter = string.Format("[Name] LIKE '%{0}%'", DataHelper.CleanSearchString(query.Name));
     }
     Pagination page = query.Page;
     return DataHelper.PagingByRownumber(page.PageIndex, page.PageSize, page.SortBy, page.SortOrder, page.IsCount, "Hishop_Gifts", "GiftId", filter, "*");
 }
Exemplo n.º 5
0
 public static IList<GiftInfo> GetGiftList(GiftQuery query)
 {
     return SalesProvider.Instance().GetGiftList(query);
 }
Exemplo n.º 6
0
 public abstract DbQueryResult GetGifts(GiftQuery query);
Exemplo n.º 7
0
 public override IList<GiftInfo> GetGiftList(GiftQuery query)
 {
     IList<GiftInfo> list = new List<GiftInfo>();
     string str = string.Format("SELECT * FROM Hishop_Gifts WHERE [Name] LIKE '%{0}%'", DataHelper.CleanSearchString(query.Name));
     DbCommand sqlStringCommand = database.GetSqlStringCommand(str);
     using (IDataReader reader = database.ExecuteReader(sqlStringCommand))
     {
         while (reader.Read())
         {
             list.Add(DataMapper.PopulateGift(reader));
         }
     }
     return list;
 }
Exemplo n.º 8
0
 public abstract IList<GiftInfo> GetGiftList(GiftQuery query);
Exemplo n.º 9
0
 public override DbQueryResult GetGifts(GiftQuery query)
 {
     string filter = "IsDownLoad=1 and GiftId not in (select GiftId from distro_Gifts where DistributorUserId=" + HiContext.Current.User.UserId + ")";
     if (!string.IsNullOrEmpty(query.Name))
     {
         filter = filter + string.Format(" and [Name] LIKE '%{0}%'", DataHelper.CleanSearchString(query.Name));
     }
     Pagination page = query.Page;
     return DataHelper.PagingByRownumber(page.PageIndex, page.PageSize, page.SortBy, page.SortOrder, page.IsCount, "Hishop_Gifts", "GiftId", filter, "*");
 }
Exemplo n.º 10
0
 public override DbQueryResult GetAbstroGiftsById(GiftQuery query)
 {
     string filter = "d_DistributorUserId=" + HiContext.Current.User.UserId;
     if (!string.IsNullOrEmpty(query.Name))
     {
         filter = string.Format(" ([Name] LIKE '%{0}%' or d_Name like '%{1}%')", DataHelper.CleanSearchString(query.Name), DataHelper.CleanSearchString(query.Name));
     }
     Pagination page = query.Page;
     return DataHelper.PagingByRownumber(page.PageIndex, page.PageSize, page.SortBy, page.SortOrder, page.IsCount, "vw_distro_Gifts", "d_GiftId", filter, "d_GiftId,d_DistributorUserId,d_Name,d_NeedPoint,Name,GiftId,PurchasePrice");
 }
Exemplo n.º 11
0
 public abstract DbQueryResult GetAbstroGiftsById(GiftQuery query);
Exemplo n.º 12
0
 public static DbQueryResult GetGifts(GiftQuery query)
 {
     return SubsitePromotionsProvider.Instance().GetGifts(query);
 }