⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 item.cs

📁 ASP.net网站开发四“酷”全书:新闻、论坛、电子商城、博客_源码
💻 CS
字号:
using System.Collections;

//References to PetShop specific libraries
//PetShop busines entity library
using BookShop.Model;
//PetShop DAL interfaces
using BookShop.IDAL;

namespace BookShop.BLL {

	/// <summary>
	/// A business component to manage product items
	/// </summary>
	public class Item {

		/// <summary>
		/// A method to list items by productId
		/// Every item is associated with a parent product
		/// </summary>
		/// <param name="productId">The productId to search by</param>
		/// <param name="productName">Name of the product associated with the product</param>
		/// <returns>An interface to an arraylist</returns>
		public IList GetItemsByProduct(string productId) {

			// Validate input
			if (productId.Trim() == string.Empty)
				return null;

			// Get an instance of the Item DAL using the DALFactory
			IItem dal = BookShop.DALFactory.Item.Create();

			// Use the dal to search by productId
			return dal.GetItemsByProduct(productId);
		}

		/// <summary>
		/// Search for an item given it's unique identifier
		/// </summary>
		/// <param name="itemId">Unique identifier for an item</param>
		/// <returns>An Item business entity</returns>
		public ItemInfo GetItem(string itemId) {

			// Validate input
			if (itemId.Trim() == string.Empty)
				return null;

			// Get an instance of the Item DAL using the DALFactory
			IItem dal = BookShop.DALFactory.Item.Create();

			// Use the dal to search by ItemId
			return dal.GetItem(itemId);
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -