using System;

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

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


