using System;

namespace Winson.EntityOP.Entity
{	
	/// <summary>
    /// Wtype表实体类
    /// </summary>
	public class WtypeDS
    {
        public WtypeDS(){}
        
		#region 成员
		private int _id;
		private int _wparentid;
		private bool _wparentidSetValue = false;
		private string _wtypename;	
		private int _wtypedepth;
		private bool _wtypedepthSetValue = false;
		private string _wtypepath;	
		private int _wtypeorder;
		private bool _wtypeorderSetValue = false;
		private System.DateTime _createtime;	
							
				
			
		/// <summary>
		/// 获取或设置Id(可读写)
		/// </summary>
		public int Id
		{ 
			get {return _id;} 
			set { _id = value; }
		}
			
		/// <summary>
		/// 获取或设置Wparentid(可读写)
		/// </summary>
		public int Wparentid
		{ 
			get {return _wparentid;} 
			set { _wparentid = value; _wparentidSetValue = true;}
		}
			
		/// <summary>
		/// 获取或设置Wtypename(可读写)
		/// </summary>
		public string Wtypename
		{ 
			get {return _wtypename;} 
			set { _wtypename = value; }
		}
			
		/// <summary>
		/// 获取或设置Wtypedepth(可读写)
		/// </summary>
		public int Wtypedepth
		{ 
			get {return _wtypedepth;} 
			set { _wtypedepth = value; _wtypedepthSetValue = true;}
		}
			
		/// <summary>
		/// 获取或设置Wtypepath(可读写)
		/// </summary>
		public string Wtypepath
		{ 
			get {return _wtypepath;} 
			set { _wtypepath = value; }
		}
			
		/// <summary>
		/// 获取或设置Wtypeorder(可读写)
		/// </summary>
		public int Wtypeorder
		{ 
			get {return _wtypeorder;} 
			set { _wtypeorder = value; _wtypeorderSetValue = true;}
		}
			
		/// <summary>
		/// 获取或设置Createtime(可读写)
		/// </summary>
		public System.DateTime Createtime
		{ 
			get {return _createtime;} 
			set { _createtime = value; }
		}
		/// <summary>
		/// 获取字段数量(只读)
		/// </summary>
        public int Count{get { return 7; }}
        #endregion

		#region 索引器
        public object this[int index, int type, int maxID]
        {			 
			get
			{
				if(type==1)
                {
                    #region 返回字段名
                    switch (index)
                    {
						 case 0:
							 if (maxID > 0 || Id > 0)
								 return "Id";
							 else
								 return null;
						 case 1:
							 if(_wparentid != 0 || _wparentidSetValue)
								 return "Wparentid";
                             else//5~1~a~s~p~x
								 return null;
						 case 2:
							 if(Wtypename != null && Wtypename.Length > 0)
								 return "Wtypename";
							 else
								 return null;
						 case 3:
							 if(_wtypedepth != 0 || _wtypedepthSetValue)
								 return "Wtypedepth";
							 else
								 return null;
						 case 4:
							 if(Wtypepath != null && Wtypepath.Length > 0)
								 return "Wtypepath";
							 else
								 return null;
						 case 5:
							 if(_wtypeorder != 0 || _wtypeorderSetValue)
								 return "Wtypeorder";
							 else
								 return null;
						 case 6:
							 if(Createtime != DateTime.MaxValue && Createtime != DateTime.MinValue)
								 return "Createtime";
							 else
								 return null;
                        default:
                            return null;                           
                    }
                    #endregion
                }
                else
                {
                    #region 返回字段值
                    switch (index)
                    {
						 case 0:
							 if (maxID > 0)
								 return maxID;
							 else if(Id > 0)
								 return  Id;
							 else
								 return null;
						 case 1:
								 return Wparentid;
						 case 2:
								 return Wtypename;
						 case 3:
								 return Wtypedepth;
						 case 4:
								 return Wtypepath;
						 case 5:
								 return Wtypeorder;
						 case 6:
								 return Createtime;
                        default:
                            return null;                           
                    }
                    #endregion
                }
			}
        }//5+1-a-s-p-x
		#endregion
	}
}


