コード例 #1
0
        public void AddCarOwner()
        {
            var carOwner = new CarOwnerViewModel();

            CarOwners.Add(carOwner);
            CurrentOwner = carOwner;
        }
コード例 #2
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);
 }