Beispiel #1
0
 public void DeleteCarOwner(int id)
 {
     if (CarOwners.Any(p => p.ID == id))
     {
         CarOwners.Remove(CarOwners.First(p => p.ID == id));
     }
     fileDataAccess.SetModel(this);
 }
Beispiel #2
0
 public CarOwner GetCarOwnerByID(int id)
 {
     if (CarOwners.Any(p => p.ID == id))
     {
         return(CarOwners.First(p => p.ID == id));
     }
     return(null);
 }
Beispiel #3
0
 public void AddCarOwner(CarOwner carOwner)
 {
     if (CarOwners.Any(p => p.ID == carOwner.ID))
     {
         var co = CarOwners.First(p => p.ID == carOwner.ID);
         co.Name       = carOwner.Name;
         co.Surname    = carOwner.Surname;
         co.SecondName = carOwner.SecondName;
         co.Phone      = carOwner.Phone;
         co.Birthday   = carOwner.Birthday;
     }
     else
     {
         iCarOwners++;
         carOwner.ID = iCarOwners;
         CarOwners.Add(carOwner);
     }
     fileDataAccess.SetModel(this);
 }