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

📄 cabin.cs

📁 根据起降城市,查询到起降时间,以及航次的具体信息.
💻 CS
字号:
using System;

namespace BusinessEntity
{
	/// <summary>
	/// Cabin 的摘要说明。
	/// </summary>
	public class Cabin
	{
		private int id;
		private string cabinType;
		private string name;
		private decimal discount;
		private decimal price;
		private int remainTickets;

		public int Id
		{
			get
			{
				return id;
			}
			set
			{
				id = value;
			}
		}

		public string Name
		{
			get
			{
				return name;
			}
			set
			{
				name = value;
			}
		}

		public string CabinType
		{
			get
			{
				return cabinType;
			}
			set
			{
				cabinType = value;
			}
		}

		public int RemainTickets
		{
			get
			{
				return remainTickets;
			}
			set
			{
				if(value >= 0)
				{
					remainTickets = value;
				}
			}
		}

		public decimal Discount
		{
			get
			{
				return discount;
			}
			set
			{
				if(discount >=0 && discount <= 1)
				{
					discount = value;
				}
			}
		}

		public decimal Price
		{
			get
			{
				return price;
			}
			set
			{
				if(price >= 0)
				{
					price = value;
				}
			}
		}

		public Cabin(int id, string name, string cabinType, int remainTickets, decimal price, decimal discount)
		{
			this.id =id;
			this.name = name;
			this.cabinType = cabinType;
			this.remainTickets = remainTickets;
			this.price = price;
			this.discount = discount;
		}
	}

	public class CabinCollection : System.Collections.CollectionBase
	{
		public int Add(Cabin item)
		{
			return this.List.Add(item);
		}

		public Cabin this[int index]
		{
			get
			{
				return (Cabin)this.List[index];
			}
			set
			{
				this.List[index] = value;
			}
		}

		public void Remove(Cabin item)
		{
			this.List.Remove(item);
		}
	}
}

⌨️ 快捷键说明

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