コード例 #1
0
ファイル: DDSystem.cs プロジェクト: zjchenxk/SYLS
        /// <summary>
        /// 读取指定城市自定义数据
        /// </summary>
        /// <param name="nCityId">城市编码</param>
        /// <param name="nOpStaffId">操作员工编码</param>
        /// <param name="strOpStaffName">操作员工姓名</param>
        /// <param name="strErrText">出错信息</param>
        /// <returns>城市数据集</returns>
        public City LoadCity(long nCityId, long nOpStaffId, string strOpStaffName, out string strErrText)
        {
            try
            {
                City dsRet = null;

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