dinnerorderinfo.cs

来自「这个版本(InteliIM Open Kernel Release 2)是目前最」· CS 代码 · 共 153 行

CS
153
字号
#region Using Directives

using System;
using System.Collections.Generic; 

#endregion

namespace Org.InteliIM.Applications.Tourism.Dinner
{
	/// <summary>
	/// Represents a dinner order.
	/// </summary>
	public class DinnerOrderInfo: OrderInfo
	{
		/// <summary>
		/// Initializes a new instance of the DinnerOrder class.
		/// </summary>
		public DinnerOrderInfo()
		{
			
		}
		
		private string purchaserId;
		
		/// <summary>
		/// Gets or sets the purchaser's id.
		/// </summary>
		public string PurchaserId
		{
			get
			{
				if(this.purchaserId == null)
					this.purchaserId = "";
				
				return this.purchaserId;
			}
			set
			{
				this.purchaserId = value;
			}
		}
		
		private string delivererId;
		
		/// <summary>
		/// Gets or sets the deliverer's id.
		/// </summary>
		public string DelivererId
		{
			get
			{
				if(this.delivererId == null)
					this.delivererId = "";
				
				return this.delivererId;
			}
			set
			{
				this.delivererId = value;
			}
		}

		private Collection<DinnerOrderEntry> entries;

		/// <summary>
		/// Gets or sets the dinner order entries.
		/// </summary>
		public Collection<DinnerOrderEntry> Entries
		{
			get
			{
				if(this.entries == null)
					this.entries = new Collection<DinnerOrderEntry>();

				return this.entries;
			}
			set
			{
				this.entries = value;
			}
		}
		
		private DateTime orderTime;
		
		/// <summary>
		/// Gets or sets the order time.
		/// </summary>
		public DateTime OrderTime
		{
			get
			{
				return this.orderTime;
			}
			set
			{
				this.orderTime = value;
			}
		}
		
		private DateTime shipTime;
		
		/// <summary>
		/// Gets or sets the ship time.
		/// </summary>
		public DateTime ShipTime
		{
			get
			{
				return this.shipTime;
			}
			set
			{
				this.shipTime = value;
			}
		}
		
		private DinnerOrderStatus status = DinnerOrderStatus.Purchasing;
		
		/// <summary>
		/// Gets or sets the dinner order status.
		/// </summary>
		public DinnerOrderStatus Status
		{
			get
			{
				return this.status;
			}
			set
			{
				this.status = value;
			}
		}
		
		/// <summary>
		/// Gets or sets the price.
		/// </summary>
		public decimal Price
		{
			get
			{
				decimal price = 0;
				
				foreach(DinnerOrderEntry entry in this.entries)
				{
					price += entry.Price;
				}
				
				return price;
			}
		}
	}
}

⌨️ 快捷键说明

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