コード例 #1
0
ファイル: DDSystem.cs プロジェクト: zjchenxk/SYLS
        /// <summary>
        /// 读取指定收货单位的所有距离数据
        /// </summary>
        /// <param name="nReceiverId"></param>
        /// <param name="nOpStaffId"></param>
        /// <param name="strOpStaffName"></param>
        /// <param name="strErrText"></param>
        /// <returns></returns>
        public List<ReceiverDistance> LoadReceiverDistances(long nReceiverId, long nOpStaffId, string strOpStaffName, out string strErrText)
        {
            try
            {
                List<ReceiverDistance> dataResult = null;

                using (TransactionScope transScope = new TransactionScope(TransactionScopeOption.Required, new TimeSpan(2, 0, 0)))
                {
                    using (DDDAO dao = new DDDAO())
                    {
                        dataResult = dao.LoadReceiverDistances(nReceiverId, nOpStaffId, strOpStaffName, out strErrText);
                    }
                    transScope.Complete();
                }
                return dataResult;
            }
            catch (Exception e)
            {
                strErrText = e.Message;
                return null;
            }
        }