Mercurial > pub > bltoolkit
diff Demo/Asp.Net/BusinessLogic/ProductManager.cs @ 0:f990fcb411a9
Копия текущей версии из github
author | cin |
---|---|
date | Thu, 27 Mar 2014 21:46:09 +0400 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Demo/Asp.Net/BusinessLogic/ProductManager.cs Thu Mar 27 21:46:09 2014 +0400 @@ -0,0 +1,79 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace PetShop.BusinessLogic +{ + using DataAccess; + using ObjectModel; + + public class ProductManager + { + #region Product + + public Product GetProduct(string id) + { + return Accessor.Query.SelectByKey<Product>(id) ?? new Product(); + } + + public IList<Product> GetProductListByCategoryID(string id) + { + return Accessor.GetProductListByCategoryID(id); + } + + public IList<Product> SearchProducts(string[] keyWords) + { + return Accessor.Query.SelectByKeyWords<Product>(keyWords); + } + + #endregion + + #region Item + + public IList<Item> GetItemListByProductID(string id) + { + return Accessor.GetItemListByProductID(id); + } + + public Item GetItem(string itemId) + { + return Accessor.GetItem(itemId); + } + + public List<Item> GetAllItemList() + { + return Accessor.GetAllItemList(); + } + + #endregion + + #region Category + + public IList<Category> GetCategoryList() + { + return Accessor.Query.SelectAll<Category>(); + } + + public Category GetCategory(string id) + { + return Accessor.GetCategory(id); + } + + public List<Category> SearchCategories(string[] keyWords) + { + return Accessor.Query.SelectByKeyWords<Category>(keyWords); + } + + #endregion + + #region Accessor + + ProductAccessor Accessor + { + [System.Diagnostics.DebuggerStepThrough] + get { return ProductAccessor.CreateInstance(); } + } + + #endregion + } +}