75 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			C#
		
	
	
	
		
		
			
		
	
	
			75 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			C#
		
	
	
	
|  | using System; | |||
|  | using DeiNiu.wms.Data.Model; | |||
|  | using System.Data; | |||
|  | namespace DeiNiu.wms.Logical | |||
|  | { | |||
|  |     [Serializable] | |||
|  |     public class Llesson  | |||
|  |     { | |||
|  | 		Lesson _obj; | |||
|  | 
 | |||
|  | 
 | |||
|  |         public Llesson() | |||
|  |         { | |||
|  |             | |||
|  |             Initialize(); | |||
|  |         } | |||
|  | 
 | |||
|  |         public Lesson GetLesson  | |||
|  |         { | |||
|  |             get | |||
|  |             { | |||
|  |                 return _obj; | |||
|  |             } | |||
|  |         } | |||
|  | 		 | |||
|  | 		/// <summary> | |||
|  | 		/// get all data | |||
|  | 		/// </summary> | |||
|  |         public DataSet GetAllData() | |||
|  |         { | |||
|  |            return _obj.Query(); | |||
|  |         } | |||
|  | 
 | |||
|  |         /// <summary> | |||
|  |         /// get all data | |||
|  |         /// </summary> | |||
|  |         public DataSet GetAllActiveData() | |||
|  |         { | |||
|  |             return _obj.QueryActived(); | |||
|  |         } | |||
|  | 
 | |||
|  |  	 | |||
|  | 		/// <summary> | |||
|  | 		/// get a record by id | |||
|  | 		/// </summary> | |||
|  |         public void Initialize(int id) | |||
|  | 		{ | |||
|  |             _obj = id != 0 ? new Lesson(id) : new Lesson(); | |||
|  | 		} | |||
|  | 
 | |||
|  |         /// <summary> | |||
|  | 		/// get a record by id 0 | |||
|  | 		/// </summary> | |||
|  |         public void Initialize() | |||
|  |         { | |||
|  |             Initialize(0); | |||
|  |         } | |||
|  |         /// <summary> | |||
|  |         /// ָ<><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀγ<C4BF><CEB3>б<EFBFBD> | |||
|  |         /// </summary> | |||
|  |         /// <returns></returns> | |||
|  |         public DataTable GetLessonsByCat(int catId) | |||
|  |         { | |||
|  |             return _obj.GetActivedLessonsByCat(  catId); | |||
|  |         } | |||
|  | 
 | |||
|  |         public DataTable GetAllActivedCategories() | |||
|  |         { | |||
|  |             return new LessonCategory().QueryActived().Tables[0]; | |||
|  |         } | |||
|  |     } | |||
|  | 
 | |||
|  |     | |||
|  | } |