114 lines
		
	
	
		
			2.2 KiB
		
	
	
	
		
			C#
		
	
	
	
		
		
			
		
	
	
			114 lines
		
	
	
		
			2.2 KiB
		
	
	
	
		
			C#
		
	
	
	
|  | using System; | |||
|  | using System.Collections.Generic; | |||
|  | using System.Linq; | |||
|  | using System.Text; | |||
|  | using DeiNiu.wms.Data.Model; | |||
|  | using System.Data; | |||
|  | using System.Transactions; | |||
|  | 
 | |||
|  | namespace DeiNiu.wms.Logical | |||
|  | { | |||
|  |    public class lNode | |||
|  |     { | |||
|  |         Node _obj; | |||
|  | 
 | |||
|  | 
 | |||
|  |         public lNode() | |||
|  |         { | |||
|  |             | |||
|  |             initialize(); | |||
|  |         } | |||
|  | 
 | |||
|  |         public Node getNode | |||
|  |         { | |||
|  |             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 Node(id) : new Node(); | |||
|  | 		} | |||
|  | 
 | |||
|  |         /// <summary> | |||
|  | 		/// get a record by id 0 | |||
|  | 		/// </summary> | |||
|  |         public void initialize() | |||
|  |         { | |||
|  |             initialize(0); | |||
|  |         } | |||
|  | 
 | |||
|  | 
 | |||
|  |         /// <summary> | |||
|  |         /// get a record by id | |||
|  |         /// </summary> | |||
|  |         public void initialize(DataRow dr) | |||
|  |         { | |||
|  |             _obj =   new Node(dr); | |||
|  |         } | |||
|  | 
 | |||
|  |         | |||
|  |         //begin cust db operation, query, excute sql etc. | |||
|  |         public DataSet Query(string goodsName, int rownumStart, int rownumEnd) | |||
|  |         { | |||
|  |             if (rownumEnd > rownumStart && rownumStart > 0) | |||
|  |             { | |||
|  |                 _obj.rownumStart = rownumStart; | |||
|  |                 _obj.rownumEnd = rownumEnd; | |||
|  |             } | |||
|  |             DataSet ds = string.IsNullOrEmpty(goodsName) ? _obj.Query()  : _obj.QueryByName(goodsName) ; | |||
|  |             return ds; | |||
|  |         //    return string.IsNullOrEmpty(goodsName) ? _obj.Query().Tables[0] : _obj.QueryByName(goodsName).Tables[0]; | |||
|  |         } | |||
|  | 
 | |||
|  | 
 | |||
|  |         public int getCntByName(string name) | |||
|  |         { | |||
|  |             return _obj.getCntByName(name); | |||
|  |         } | |||
|  | 
 | |||
|  |         | |||
|  | 
 | |||
|  |         private bool valid() | |||
|  |         {  | |||
|  |             return true; | |||
|  |         } | |||
|  | 
 | |||
|  | 
 | |||
|  |         /// <summary> | |||
|  |         /// query dic that has flag | |||
|  |         /// used for building combox | |||
|  |         /// </summary> | |||
|  |         /// <returns></returns> | |||
|  |         public DataTable QueryByFlags() | |||
|  |         { | |||
|  |             return _obj.QueryByFlags(); | |||
|  | 
 | |||
|  |         } | |||
|  | 
 | |||
|  | 
 | |||
|  |     } | |||
|  | } |