138 lines
		
	
	
		
			3.4 KiB
		
	
	
	
		
			C#
		
	
	
	
		
		
			
		
	
	
			138 lines
		
	
	
		
			3.4 KiB
		
	
	
	
		
			C#
		
	
	
	
|  |  | |||
|  | /// <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,_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) | |||
|  |         { | |||
|  |             cmdParameters[0] = custID; | |||
|  |             cmdParameters[1] = custName; | |||
|  |             cmdParameters[2] = custAddress;  | |||
|  |             cmdParameters[3] = string.IsNullOrEmpty(pickOrderNo) ? (int) Utils.enumOutStockRequestStatus.准备合并 | |||
|  |                                : (int)Utils.enumOutStockRequestStatus.等待分拣; | |||
|  |             cmdParameters[4] = string.IsNullOrEmpty(pickOrderNo) ? (int)enumOutStockRequestDetailStatus.normal  | |||
|  |                                 : (int)enumOutStockRequestDetailStatus.picking; | |||
|  |             cmdParameters[5] = operater;  | |||
|  |             CustOper(1200); | |||
|  |         } | |||
|  | 
 | |||
|  | 
 | |||
|  | 
 | |||
|  | 
 | |||
|  | 
 | |||
|  | 
 | |||
|  | 
 | |||
|  |     } | |||
|  | } | |||
|  |   |