コード例 #1
0
ファイル: DDSystem.cs プロジェクト: zjchenxk/SYLS
        /// <summary>
        /// 读取指定车号的驾驶员记录
        /// </summary>
        /// <param name="strCarNo"></param>
        /// <param name="nOpStaffId"></param>
        /// <param name="strOpStaffName"></param>
        /// <param name="strErrText"></param>
        /// <returns></returns>
        public List<CarrierDriver> LoadDriversByCarNo(string strCarNo, long nOpStaffId, string strOpStaffName, out string strErrText)
        {
            try
            {
                List<CarrierDriver> dataResult = null;

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