using System;

namespace Winson.EntityOP.Entity
{	
	/// <summary>
    /// Categories表实体类
    /// </summary>
	public class CategoriesDS
    {
        public CategoriesDS(){}
        
		#region 成员
		/// <summary>
		/// 获取或设置Categoryid(可读写)
		/// </summary>
		public int Categoryid{get;set;}
		/// <summary>
		/// 获取或设置Categoryname(可读写)
		/// </summary>
		public string Categoryname{get;set;}
		/// <summary>
		/// 获取或设置Description(可读写)
		/// </summary>
		public string Description{get;set;}
		/// <summary>
		/// 获取或设置Picture(可读写)
		/// </summary>
		public System.Byte[] Picture{get;set;}
		/// <summary>
		/// 获取字段数量(只读)
		/// </summary>
        public int Count{get { return 4; }}
        #endregion

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


