コード例 #1
0
ファイル: ProductBLL.cs プロジェクト: ansarbek/thewall9-CMS
 public ProductsWeb Get(int SiteID, string Url, string Lang, int CurrencyID, string ProductCategoryFriendlyUrl, int Page)
 {
     int Take = 100;//SHOULD BE FROM USER INPUT
     using (var _c = db)
     {
         if (SiteID == 0)
             SiteID = new SiteBLL().Get(Url, _c).SiteID;
         var _Culture = new CategoryBLL().GetCulture(SiteID, Lang, ProductCategoryFriendlyUrl, _c);
         var _Q = Get(SiteID, _Culture.CultureID, CurrencyID, ProductCategoryFriendlyUrl, _c);
         var _PW = new ProductsWeb();
         _PW.Products = _Q.Skip(Take * (Page - 1)).Take(Take).ToList();
         _PW.NumberPages = _Q.Count() / Take;
         //  _PW.Categories = new CategoryBLL().Get(SiteID, null, ProductCategoryFriendlyUrl, Lang, FriendlyUrl);
         _PW.CultureID = _Culture.CultureID;
         _PW.CultureName = _Culture.Name;
         //if (!string.IsNullOrEmpty(ProductCategoryFriendlyUrl))
         //{
         //    _PW.Category = new CategoryBLL().Get(ProductCategoryFriendlyUrl, _Culture.CultureID);
         //}
         return _PW;
     }
 }