Ejemplo n.º 1
0
 /// <summary>
 /// Remove repair
 /// </summary>
 /// <param name="repair"></param>
 public void RemoveRepair(Repair repair)
 {
     baseData.Repairs.Remove(repair);
     this.Save();
     OnPropertyChanged("Repairs");
     OnPropertyChanged("AvailableSpace");
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Save fuel
 /// </summary>
 private void saveRepair()
 {
     CoreData.Repair repair = new CoreData.Repair();
     repair.Odometer = new CoreData.Odometer(this.odometer, DataController.Distance);
     repair.Date = this.Date;
     repair.ServiceName = this.serviceName;
     repair.Price = new CoreData.Price(this.repairPrice, DataController.Currency);
     repair.Description = this.description;
     DataController.AddRepair(repair);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Add repair
 /// </summary>
 /// <param name="repair"></param>
 public void AddRepair(Repair repair)
 {
     //find right record
     var before = baseData.Repairs.Where(e => e.Date >= repair.Date).Count();
     baseData.Repairs.Insert(before, repair);
     //save data
     this.Save();
     OnPropertyChanged("Repairs");
     OnPropertyChanged("AvailableSpace");
 }