?? orderread.cs
字號:
using System;
//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 the retrieval of orders
/// Creation of an order requires a distributed transaction, however
/// reading the order does not, so the the component has been split into 2 parts
/// By splitting the component into 2 we avoid the overhead of Enterprise Services
/// </summary>
public class OrderRead{
/// <summary>
/// A method to read an order from the system
/// </summary>
/// <param name="orderId">Unique identifier for an order</param>
/// <returns></returns>
public OrderInfo GetOrder(int orderId) {
// Validate input
if (orderId < 1)
return null;
// Get an instance of the Order DAL using the DALFactory
IOrder dal = BookShop.DALFactory.Order.Create();
// Return the order from the DAL
return dal.GetOrder(orderId);
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -