using System;

namespace Winson.EntityOP.Entity
{	
	/// <summary>
    /// Region表实体类
    /// </summary>
	public class RegionDS
    {
        public RegionDS(){}
        
		#region 成员
		/// <summary>
		/// 获取或设置Regionid(可读写)
		/// </summary>
		public int Regionid{get;set;}
		/// <summary>
		/// 获取或设置Regiondescription(可读写)
		/// </summary>
		public string Regiondescription{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 || Regionid > 0)
								 return "Regionid";
							 else
								 return null;
						 case 1:
							 if(Regiondescription != null && Regiondescription.Length > 0)
								 return "Regiondescription";
							 else
								 return null;
                        default:
                            return null;                           
                    }
                    #endregion
                }
                else
                {
                    #region 返回字段值
                    switch (index)
                    {
						 case 0:
							 if (maxID > 0)
								 return maxID;
							 else if(Regionid > 0)
								 return  Regionid;
							 else
								 return null;
						 case 1:
								 return Regiondescription;
                        default:
                            return null;                           
                    }
                    #endregion
                }
			}	            
        }
		#endregion
	}
}


