示例#1
0
        public void CreateData()
        {
            var          factory     = OrnamentContext.DaoFactory.GetDaoFactory <IRegionDaoFactory>();
            IProvicenDao provinceDao = factory.CreateProvinceDao();

            List <Province> provicnes = Province.ProvinceData;

            foreach (Province item in provicnes)
            {
                provinceDao.Save(item);
            }

            ICityDao     cityDao = factory.CreateCityDao();
            IList <City> cities  = City.CreateNewCityData(provicnes);

            foreach (City city in cities)
            {
                cityDao.Save(city);
            }
            IAreaDao areaDao = factory.CreateAreaDao();
            var      areas   = Area.CreateData(cities);

            foreach (Area city in areas)
            {
                areaDao.Save(city);
            }
            areaDao.Flush();
        }
示例#2
0
 /// <summary>
 ///     Speichert das Gebiet
 /// </summary>
 /// <param name="area"></param>
 public void Save(Area area)
 {
     if (area == null)
     {
         throw new ArgumentNullException(nameof(area));
     }
     _areaDao.Save(area);
 }