dinnerorder.cs

来自「该源代码用 C# 写成」· CS 代码 · 共 145 行

CS
145
字号
using System;

namespace Org.InteliIM.Activities.Dinner
{
	/// <summary>
	/// 餐饮订单
	/// </summary>
	public class DinnerOrder: Order
	{
		/// <summary>
		/// 构造函数
		/// </summary>
		public DinnerOrder()
		{
			
		}
		
		private string purchaserId;
		
		/// <summary>
		/// 购买者编号
		/// </summary>
		public string PurchaserId
		{
			get
			{
				if(this.purchaserId == null)
					this.purchaserId = "";
				
				return this.purchaserId;
			}
			set
			{
				this.purchaserId = value;
			}
		}
		
		private string delivererId;
		
		/// <summary>
		/// 送货员编号
		/// </summary>
		public string DelivererId
		{
			get
			{
				if(this.delivererId == null)
					this.delivererId = "";
				
				return this.delivererId;
			}
			set
			{
				this.delivererId = value;
			}
		}

		private DinnerOrderEntryCollection entries;

		/// <summary>
		/// 项集合
		/// </summary>
		public DinnerOrderEntryCollection Entries
		{
			get
			{
				if(this.entries == null)
					this.entries = new DinnerOrderEntryCollection();

				return this.entries;
			}
			set
			{
				this.entries = value;
			}
		}
		
		private DateTime orderTime;
		
		/// <summary>
		/// 下单时间
		/// </summary>
		public DateTime OrderTime
		{
			get
			{
				return this.orderTime;
			}
			set
			{
				this.orderTime = value;
			}
		}
		
		private DateTime shipTime;
		
		/// <summary>
		/// 发货时间
		/// </summary>
		public DateTime ShipTime
		{
			get
			{
				return this.shipTime;
			}
			set
			{
				this.shipTime = value;
			}
		}
		
		private DinnerOrderStatus status = DinnerOrderStatus.Purchasing;
		
		/// <summary>
		/// 状态
		/// </summary>
		public DinnerOrderStatus Status
		{
			get
			{
				return this.status;
			}
			set
			{
				this.status = value;
			}
		}
		
		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 + -
显示快捷键?