152 lines
		
	
	
		
			3.8 KiB
		
	
	
	
		
			C#
		
	
	
	
		
		
			
		
	
	
			152 lines
		
	
	
		
			3.8 KiB
		
	
	
	
		
			C#
		
	
	
	
|  |  | |||
|  | /// <summary> | |||
|  | ///INTERFACE CLASS FOR TABLE t_wmsOutPickDetail | |||
|  | ///By wm with codesmith.  | |||
|  | ///on 05/22/2017 | |||
|  | /// </summary> | |||
|  | 
 | |||
|  | using System; | |||
|  | using System.Collections.Generic; | |||
|  | using System.Linq; | |||
|  | using System.Text; | |||
|  | using System.Data; | |||
|  | 
 | |||
|  | namespace DeiNiu.wms.Data.Model | |||
|  | { | |||
|  |     [Serializable] | |||
|  |     public class WmsOutPickDetail : WmsOutPickDetail_base | |||
|  |     { | |||
|  |         public WmsOutPickDetail() | |||
|  |         { | |||
|  | 
 | |||
|  |         } | |||
|  | 
 | |||
|  |         public WmsOutPickDetail(int id): base(id) | |||
|  |         { | |||
|  | 
 | |||
|  |         } | |||
|  |         public WmsOutPickDetail(DataRow dr): base(dr) | |||
|  |         { | |||
|  | 
 | |||
|  |         } | |||
|  | 
 | |||
|  |         protected override void getImp() | |||
|  |         { | |||
|  |             model_imp = new WmsOutPickDetail_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()); | |||
|  |              | |||
|  |             foreach (DataRow dr in dt.Rows) | |||
|  |             { | |||
|  |                 return Convert.ToDecimal(dr[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) | |||
|  |         { | |||
|  |          //  DeiNiu.Utils.LogHelper.WriteLog(this.GetType(),"start to get good stock cnt"); | |||
|  |             return getGoodsStockCnt((int)locVol); | |||
|  |          //   DeiNiu.Utils.LogHelper.WriteLog(this.GetType(), "end to get good stock cnt"); | |||
|  |           | |||
|  |         } | |||
|  |         #region obsoleted | |||
|  |         /* | |||
|  |         public int saveError(string orderNo) | |||
|  |         { | |||
|  |             WmsOutPickDetail_error pe = new WmsOutPickDetail_error(); | |||
|  |             pe.orderNo = orderNo; | |||
|  |             pe._batch = _batch; | |||
|  |             pe._batch1Count = _batch1Count; | |||
|  |             pe._batch2Count = _batch2Count; | |||
|  |             pe._boxcnt = _boxcnt; | |||
|  |             pe._bulkCount = _bulkCount; | |||
|  |             pe._count = _count; | |||
|  |             pe._customerId = _customerId; | |||
|  |             pe._customerName = _customerName; | |||
|  |             pe._description = _description; | |||
|  |             pe._goodsId = _goodsId; | |||
|  |             pe._pickOrderNo = _pickOrderNo; | |||
|  |             pe._productDate = _productDate; | |||
|  |             pe._validDate = _validDate; | |||
|  |             pe._whtype = _whtype; | |||
|  |             return  pe.Add(); | |||
|  | 
 | |||
|  |         } | |||
|  |          * */ | |||
|  |         #endregion | |||
|  |     } | |||
|  | } | |||
|  |   |