/// <summary> /// Remove repair /// </summary> /// <param name="repair"></param> public void RemoveRepair(Repair repair) { baseData.Repairs.Remove(repair); this.Save(); OnPropertyChanged("Repairs"); OnPropertyChanged("AvailableSpace"); }
/// <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); }
/// <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"); }