Order.cs
上传用户:lxycoco
上传日期:2022-07-21
资源大小:38457k
文件大小:2k
- using System;
- using System.Collections;
- namespace Wrox.ProCSharp.EnterpriseServices
- {
- [Serializable]
- public class Order
- {
- public static Order Create(string customerId, DateTime orderDate, string shipAddress,
- string shipCity, string shipCountry)
- {
- Order o = new Order();
- o.customerId = customerId;
- o.orderDate = orderDate;
- o.shipAddress = shipAddress;
- o.shipCity = shipCity;
- o.shipCountry = shipCountry;
- return o;
- }
-
- public Order()
- {
- }
- internal void SetOrderId(int orderId)
- {
- this.orderId = orderId;
- }
- public void AddOrderLine(OrderLine orderLine)
- {
- orderLines.Add(orderLine);
- }
- private int orderId;
- private string customerId;
- private DateTime orderDate;
- private string shipAddress;
- private string shipCity;
- private string shipCountry;
- private ArrayList orderLines = new ArrayList();
- public int OrderId
- {
- get
- {
- return orderId;
- }
- }
- public string CustomerId
- {
- get
- {
- return customerId;
- }
- }
- public DateTime OrderDate
- {
- get
- {
- return orderDate;
- }
- }
- public string ShipAddress
- {
- get
- {
- return shipAddress;
- }
- }
- public string ShipCity
- {
- get
- {
- return shipCity;
- }
- }
- public string ShipCountry
- {
- get
- {
- return shipCountry;
- }
- }
- public OrderLine[] OrderLines
- {
- get
- {
- OrderLine[] ol = new OrderLine[orderLines.Count];
- orderLines.CopyTo(ol);
- return ol;
- }
- }
- }
- }