コード例 #1
0
ファイル: DDSystem.cs プロジェクト: zjchenxk/SYLS
        /// <summary>
        /// 读取指定省份的城市数据集
        /// </summary>
        /// <param name="strCountryName">国家名称</param>
        /// <param name="strProvinceName">省份名称</param>
        /// <param name="nOpStaffId">操作员工编码</param>
        /// <param name="strOpStaffName">操作员工姓名</param>
        /// <param name="strErrText">出错信息</param>
        /// <returns></returns>
        public List<City> LoadCitysByProvince(string strCountryName, string strProvinceName, long nOpStaffId, string strOpStaffName, out string strErrText)
        {
            try
            {
                List<City> dataResult = null;
                strErrText = String.Empty;

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