コード例 #1
0
ファイル: XmlDBProvider.cs プロジェクト: PavelBadeha/TAT2019
        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
ファイル: University.cs プロジェクト: PavelBadeha/TAT2019
 /// <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);
 }