| 
									
										
										
										
											2025-08-14 14:03:14 +08:00
										 |  |  |  |  | 
					
						
							|  |  |  |  | /// <summary> | 
					
						
							|  |  |  |  | ///INTERFACE CLASS FOR TABLE t_wmslocation | 
					
						
							|  |  |  |  | ///By wm with codesmith.  | 
					
						
							|  |  |  |  | ///on 05/02/2017 | 
					
						
							|  |  |  |  | /// </summary> | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | using System; | 
					
						
							|  |  |  |  | using System.Collections.Generic; | 
					
						
							|  |  |  |  | using System.Linq; | 
					
						
							|  |  |  |  | using System.Text; | 
					
						
							|  |  |  |  | using System.Data; | 
					
						
							|  |  |  |  | using System.Data.SqlClient; | 
					
						
							|  |  |  |  | using DeiNiu.Utils; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | namespace DeiNiu.wms.Data.Model | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  |     [Serializable] | 
					
						
							|  |  |  |  |     public class Wmslocation : WmsLocation_base | 
					
						
							|  |  |  |  |     { | 
					
						
							|  |  |  |  |         public Wmslocation() | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         public Wmslocation(SqlConnection _Conn):base(_Conn)  | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         public Wmslocation(int id): base(id) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |          public Wmslocation(DataRow dr): base(dr) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |          public Wmslocation(String locationId)  | 
					
						
							|  |  |  |  |          { | 
					
						
							|  |  |  |  |              cmdParameters[0] = locationId; | 
					
						
							|  |  |  |  |              getModel(10); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |          } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |          public new int Add() | 
					
						
							|  |  |  |  |          { | 
					
						
							|  |  |  |  |              base.Add(); | 
					
						
							|  |  |  |  |              this.locationId128 = Util.getCode128(locationId + ""); | 
					
						
							|  |  |  |  |              Update(); | 
					
						
							|  |  |  |  |              return ID; | 
					
						
							|  |  |  |  |          } | 
					
						
							|  |  |  |  |          protected override void getImp() | 
					
						
							|  |  |  |  |          { | 
					
						
							|  |  |  |  |              model_imp = new Wmslocation_Imp(); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |          } | 
					
						
							|  |  |  |  |         | 
					
						
							|  |  |  |  |         //begin cust db operation, query, excute sql etc. | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         //public override DataSet Query()   | 
					
						
							|  |  |  |  |         //{  | 
					
						
							|  |  |  |  |         //    return  CustQuery(100); | 
					
						
							|  |  |  |  |         //} | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         | 
					
						
							|  |  |  |  |           | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 清除空货位 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							|  |  |  |  |         public int freeLocations() | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             return CustOper(400); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// get location info by locId | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							|  |  |  |  |         public DataTable getLocations(string locId) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             cmdParameters[0] = locId; | 
					
						
							|  |  |  |  |             return CustQuery(500).Tables[0]; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |          | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         public bool updateLocationStatus(string IDS, int status, int operId) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             cmdParameters[0] = IDS; | 
					
						
							|  |  |  |  |             cmdParameters[1] = status; | 
					
						
							|  |  |  |  |             cmdParameters[2] = operId; | 
					
						
							|  |  |  |  |             return CustOper(620) > 0; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |        | 
					
						
							|  |  |  |  |         public bool updateLocationLabelId(string IDs, LocStructs locs, int operId) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             cmdParameters[0] = IDs; | 
					
						
							|  |  |  |  |             cmdParameters[1] = locs.elabId; | 
					
						
							|  |  |  |  |             cmdParameters[2] = operId; | 
					
						
							|  |  |  |  |             return CustOper(640) > 0;  | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         public int deleteLocations(string IDs) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             cmdParameters[0] = IDs; | 
					
						
							|  |  |  |  |              | 
					
						
							|  |  |  |  |             return CustOper(650) ;  | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// query location percent data | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							|  |  |  |  |         public DataTable getLocationsUsedPercent() | 
					
						
							|  |  |  |  |         {  | 
					
						
							|  |  |  |  |             return CustQuery(670).Tables[0]; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         internal bool updateLocationOwnerCode(string IDs, LocStructs locs, int operId) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             cmdParameters[0] = IDs; | 
					
						
							|  |  |  |  |             cmdParameters[1] = locs.ownerCode;  | 
					
						
							|  |  |  |  |             cmdParameters[2] = operId; | 
					
						
							|  |  |  |  |             return CustOper(680) > 0;  | 
					
						
							|  |  |  |  |         } | 
					
						
							| 
									
										
										
										
											2025-09-15 10:15:35 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  |         public Wmslocation getLocsByOwner(string ownerCode) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             cmdParameters[0] = ownerCode; | 
					
						
							|  |  |  |  |             DataTable dt = CustQuery(700).Tables[0]; | 
					
						
							|  |  |  |  |             foreach (DataRow dr in dt.Rows) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 Wmslocation loc = new Wmslocation(dr); | 
					
						
							|  |  |  |  |                 return loc ; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             return new Wmslocation();  | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-08-14 14:03:14 +08:00
										 |  |  |  |     } | 
					
						
							|  |  |  |  | } | 
					
						
							|  |  |  |  |   |