| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |  | 
					
						
							|  |  |  |  | /// <summary> | 
					
						
							|  |  |  |  | ///INTERFACE CLASS FOR TABLE t_wmsOutDetail | 
					
						
							|  |  |  |  | ///By wm with codesmith.  | 
					
						
							|  |  |  |  | ///on 05/18/2017 | 
					
						
							|  |  |  |  | /// </summary> | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | using System; | 
					
						
							|  |  |  |  | using System.Collections.Generic; | 
					
						
							|  |  |  |  | using System.Linq; | 
					
						
							|  |  |  |  | using System.Text; | 
					
						
							|  |  |  |  | using System.Data; | 
					
						
							|  |  |  |  | using DeiNiu.Utils; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | namespace DeiNiu.wms.Data.Model | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  |     [Serializable] | 
					
						
							|  |  |  |  |     public class WmsOutDetail : WmsOutDetail_base | 
					
						
							|  |  |  |  |     { | 
					
						
							|  |  |  |  |         public WmsOutDetail() | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         public WmsOutDetail(int id): base(id) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |          public WmsOutDetail(DataRow dr): base(dr) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |          protected override void getImp() | 
					
						
							|  |  |  |  |          { | 
					
						
							|  |  |  |  |              model_imp = new WmsOutDetail_Imp(); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |          } | 
					
						
							|  |  |  |  |         | 
					
						
							|  |  |  |  |         //begin cust db operation, query, excute sql etc. | 
					
						
							|  |  |  |  |         public DataSet QueryByName(string name) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             cmdParameters[0] = name; | 
					
						
							|  |  |  |  |             return  CustQuery(100); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         private WmsGoods _goods; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         public WmsGoods goods | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             get { | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                 if (_goods == null) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     _goods = new WmsGoods(_goodsId,_skuId,_batch); | 
					
						
							|  |  |  |  |                 }   | 
					
						
							|  |  |  |  |                  | 
					
						
							|  |  |  |  |                 return _goods; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |           //  set { _goods = value; } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 取商品库存总量 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							|  |  |  |  |         public decimal getGoodsStockCnt() | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             return getGoodsStockCnt(-1); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 根据货位类型取商品库存总量 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="locVolType"></param> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							|  |  |  |  |         private decimal getGoodsStockCnt(int locVolType) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             cmdParameters[0] = _goodsId; | 
					
						
							|  |  |  |  |             cmdParameters[1] = _batch; | 
					
						
							|  |  |  |  |             cmdParameters[2] = locVolType; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             DataTable dt = CustQuery(200).Tables[0]; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |            /*if (dt.Rows.Count == 0) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 return 0m; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             return Convert.ToDecimal(dt.Rows[0][0].ToString()); | 
					
						
							|  |  |  |  |            * */ | 
					
						
							|  |  |  |  |             try | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 foreach (DataRow dr in dt.Rows) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     return Convert.ToDecimal(dr[0].ToString()); | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             catch (Exception e) // not exist in stock | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 return 0m;   | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             return 0m; | 
					
						
							|  |  |  |  |               | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 根据货位类型取商品库存总量 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="locVolType">货位类型</param> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							|  |  |  |  |         public decimal getGoodsStockCnt(DeiNiu.Utils.enumWhLocVol locVol) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             return getGoodsStockCnt((int)locVol); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /*public void updatePickState(string custID, string custName, string custAddress, string pickOrderNo | 
					
						
							|  |  |  |  |             , Utils.enumOutStockRequestStatus rstate, enumOutStockDetailStatus dstate | 
					
						
							|  |  |  |  |             ) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             cmdParameters[0] = custID; | 
					
						
							|  |  |  |  |             cmdParameters[1] = custName; | 
					
						
							|  |  |  |  |             cmdParameters[2] = custAddress; | 
					
						
							|  |  |  |  |             cmdParameters[3] = (int)rstate; | 
					
						
							|  |  |  |  |             cmdParameters[4] = (int)dstate; | 
					
						
							|  |  |  |  |             cmdParameters[5] = operater;  | 
					
						
							|  |  |  |  |             CustOper(300); | 
					
						
							|  |  |  |  |         }*/ | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-09-04 22:41:19 +08:00
										 |  |  |  |         public void updatePickState(string pickOrderNo, enumOutStockDetailStatus dstate  ) | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |         {   | 
					
						
							|  |  |  |  |             cmdParameters[0] = (int)dstate; | 
					
						
							|  |  |  |  |             cmdParameters[1] = operater; | 
					
						
							| 
									
										
										
										
											2023-09-04 22:41:19 +08:00
										 |  |  |  |             cmdParameters[2]=pickOrderNo; | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |             CustOper(310); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |     } | 
					
						
							|  |  |  |  | } | 
					
						
							|  |  |  |  |   |