using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace WebSite.Models
{
	public class FloorModel 
	{
		private IList<RoomModel> floorRooms = new List<RoomModel>();

		public IList<RoomModel> FloorRooms
		{
			get { return this.floorRooms; }
			set { if (value != null) { this.floorRooms = value; } }
		}

		public int Sort { get; set; }
	}

    public class RoomModel
    {
        private string roomNumber = "";

        private string roomStatus = "";

        private IList<ServiceModel> services = new List<ServiceModel>();
        private IList<AirDetectModel> airDetect = new List<AirDetectModel>();
        private IList<RoomCustomer> customers = new List<RoomCustomer>();

        public int ID { get; set; }
        /// <summary>
        /// 主机状态：是否在线
        /// </summary>
        public bool HostStatus { get; set; }

        //public ServiceModel CurrentService { get { return new ServiceModel { Code = "B00", Color = "#FFFFFF" }; } }
        /// <summary>
        /// 房号
        /// </summary>
        public string RoomNumber
        {
            get { return this.roomNumber; }
            set { this.roomNumber = value ?? ""; }
        }
        /// <summary>
        /// 房态名称
        /// </summary>
        public string RoomStatus
        {
            get { return this.roomStatus; }
            set { this.roomStatus = value ?? ""; }
        }

        public int RoomStatusID { get; set; }

        public string Identity { get; set; }

        public int AirID { get; set; }//空调ID

        public string ModalAddress { get; set; }//空调回路地址

        public int AirStatus { get; set; }//空调开关状态，2/关，1/开

        public string AirStatusName { get; set; }//空调开关状态

        public int RoomTemp { get; set; }

        public int SettingTemp { get; set; }

        public int Mode { get; set; }

        public int FanSpeed { get; set; }

        public int Valve { get; set; }

        public string ValveName { get; set; }
        /// <summary>
        /// 客房电源
        /// </summary>
        public bool PowerSupply { get; set; }
        public string PowerSupplyName { get; set; }
        /// <summary>
        /// 门锁状态
        /// </summary>
        public int LockStatus { get; set; }
        /// <summary>
        /// 门锁状态名称
        /// </summary>
        public string LockStatusName { get; set; }
        /// <summary>
        /// 锁电压
        /// </summary>
        public float LockVoltage { get; set; }
        /// <summary>
        /// 外设离线数量
        /// </summary>
        public int PeripheralOfflineCount { get; set; }
        /// <summary>
        /// 外设低电数量
        /// </summary>
        public int PeripheralLowPowerCount { get; set; }
        /// <summary>
        /// 外设描述
        /// </summary>
        public string Peripheral { get; set; }
        /// <summary>
        /// 是否是连通房
        /// </summary>
        public bool IsConnectingRoom { get; set; }

        /// <summary>
        /// 碳达人
        /// </summary>
        public string CarbonVIP { get; set; }

        /// <summary>
        /// 功率
        /// </summary>
        public string Power { get; set; }

        public ServiceModel SOS { get; set; }

        public ServiceModel DND { get; set; }

        public ServiceModel Clean { get; set; }

        public ServiceModel Checkout { get; set; }

        public IList<ServiceModel> Services
        {
            get { return this.services; }
            set { if (value != null) { this.services = value; } }
        }

        public IList<AirDetectModel> AirDetects
        {
            get { return this.airDetect; }
            set { if (value != null) { this.airDetect = value; } }
        }
        /// <summary>
        /// 当前入住人信息
        /// </summary>
        public IList<RoomCustomer> Customers
        {
            get { return this.customers; }
            set { if (value != null) { this.customers = value; } }
        }
    }

	public class ServiceModel
	{
        public string Code { get; set; }
		public string Name { get; set; }
		public int Status { get; set; }
		public string Color { get; set; }
	}

    public class AirDetectModel
    {
        public string Name { get; set; }
        public string Value { get; set; }
    }

	public class RoomInfoModel
	{
		public int HostID { get; set; }
		public string RoomNumber { get; set; }
		public string RoomStatus { get; set; }
		public string Identity { get; set; }
		public string HostStatus { get; set; }
        public string IP { get; set; }
        public int Port { get; set; }
        public bool PowerSupply { get; set; }
	}

    public class RoomCustomer
    {
        /// <summary>
        /// 0 身份证，1 护照，2 军官证，3 其他
        /// </summary>
        public string idtype { get; set; }
        /// <summary>
        /// 证件号
        /// </summary>
        public string idcard { get; set; }
        /// <summary>
        /// 姓名
        /// </summary>
        public string customer { get; set; }
        /// <summary>
        /// 性别：男、女
        /// </summary>
        public string sex { get; set; }
        /// <summary>
        /// 0 国内，1 国际
        /// </summary>
        public string country { get; set; }
        /// <summary>
        /// 入住时间
        /// </summary>
        public DateTime checkindate { get; set; }
        /// <summary>
        /// 电话号码
        /// </summary>
        public string phoneNumber { get; set; }
    }
}