using System;

namespace Winson.EntityOP.Entity
{	
	/// <summary>
    /// EmployeeTerritories表实体类
    /// </summary>
	public class EmployeeTerritoriesDS
    {
        public EmployeeTerritoriesDS(){}
        
		#region 成员
		/// <summary>
		/// 获取或设置Employeeid(可读写)
		/// </summary>
		public int Employeeid{get;set;}
		/// <summary>
		/// 获取或设置Territoryid(可读写)
		/// </summary>
		public string Territoryid{get;set;}
		/// <summary>
		/// 获取字段数量(只读)
		/// </summary>
        public int Count{get { return 2; }}
        #endregion

		#region 索引器
        public object this[int index, int type, int maxID]
        {			 
			get
			{
				if(type==1)
                {
                    #region 返回字段名
                    switch (index)
                    {
						 case 0:
							 if (maxID > 0 || Employeeid > 0)
								 return "Employeeid";
							 else
								 return null;
						 case 1:
							 if(Territoryid != null && Territoryid.Length > 0)
								 return "Territoryid";
							 else
								 return null;
                        default:
                            return null;                           
                    }
                    #endregion
                }
                else
                {
                    #region 返回字段值
                    switch (index)
                    {
						 case 0:
							 if (maxID > 0)
								 return maxID;
							 else if(Employeeid > 0)
								 return  Employeeid;
							 else
								 return null;
						 case 1:
								 return Territoryid;
                        default:
                            return null;                           
                    }
                    #endregion
                }
			}	            
        }
		#endregion
	}
}


