Пример #1
0
        public void AddParking(Parking parking, int departmentId, int universityId)
        {
            document.Root.Element("Parkings").Add(new XElement("Parking",
                                                               new XAttribute("Name", parking.Name)
                                                               , new XAttribute("DepartmentId", departmentId)
                                                               , new XAttribute("UniversityId", universityId)));

            foreach (Car car in parking.Cars)
            {
                AddCar(car, departmentId);
            }
            foreach (Garage garage in parking.Garages)
            {
                AddGarage(garage, departmentId);
            }
            AddHead(parking.Head, departmentId);
            AddAddress(parking.Address, departmentId);

            document.Save(fileName);
        }
Пример #2
0
 /// <summary>
 /// Method that add parking to the list of parkings.
 /// </summary>
 /// <param name="parking">Parking that need to add.</param>
 public void AddParking(Parking parking)
 {
     Parkings.Add(parking);
 }