コード例 #1
0
ファイル: StockSystem.cs プロジェクト: zjchenxk/SYLS
        /// <summary>
        /// 根据条件读取入库货物数据
        /// </summary>
        /// <param name="strStartTime"></param>
        /// <param name="strEndTime"></param>
        /// <param name="strCustomerName"></param>
        /// <param name="strDeliveryNo"></param>
        /// <param name="strEnterWarehouseBillNo"></param>
        /// <param name="strGoodsNo"></param>
        /// <param name="strGoodsName"></param>
        /// <param name="strSpecModel"></param>
        /// <param name="strBatchNo"></param>
        /// <param name="strEnterType"></param>
        /// <param name="strWarehouse"></param>
        /// <param name="strIsConsigning"></param>
        /// <param name="strHasDrayage"></param>
        /// <param name="nOpStaffId"></param>
        /// <param name="strOpStaffName"></param>
        /// <param name="strErrText"></param>
        /// <returns></returns>
        public List<EnterWarehouseBillGoods> LoadEnterWarehouseBillGoodsByConditions(string strStartTime, string strEndTime, string strCustomerName, string strDeliveryNo, string strEnterWarehouseBillNo, string strGoodsNo, string strGoodsName, string strSpecModel, string strBatchNo, string strEnterType, string strWarehouse, string strIsConsigning, string strHasDrayage, long nOpStaffId, string strOpStaffName, out string strErrText)
        {
            try
            {
                List<EnterWarehouseBillGoods> ret = null;

                using (TransactionScope transScope = new TransactionScope(TransactionScopeOption.Required, new TimeSpan(2, 0, 0)))
                {
                    using (StockDAO dao = new StockDAO())
                    {
                        ret = dao.LoadEnterWarehouseBillGoodsByConditions(strStartTime, strEndTime, strCustomerName, strDeliveryNo, strEnterWarehouseBillNo, strGoodsNo, strGoodsName, strSpecModel, strBatchNo, strEnterType, strWarehouse, strIsConsigning, strHasDrayage, nOpStaffId, strOpStaffName, out strErrText);
                        if (ret == null)
                            return null;
                    }
                    transScope.Complete();
                }
                return ret;
            }
            catch (Exception e)
            {
                strErrText = e.Message;
                return null;
            }
        }