public Task <int> SaveItemAsync(_Interval interval, Workout workout) { if (workout.Id <= 0) { throw new Exception("WorkoutId not set!"); } interval.WorkoutId = workout.Id; if (interval.Id != 0) { return(Database.UpdateAsync(interval, typeof(_Interval))); } else { return(Database.InsertAsync(interval, typeof(_Interval))); } }
public IntervalViewModel(_Interval interval, int intervalIndex) { _interval = interval; IntervalIndex = intervalIndex; Reset(); Color = Color.LightBlue; Types = new ObservableCollection <string>(); var arr = Enum.GetValues(typeof(IntervalType)); //Skip the first enum "NULL" for (int i = 1; i < arr.Length; i++) { Types.Add(arr.GetValue(i).ToString()); } }
private Task <int> DeleteItemAsync(_Interval item) { return(Database.DeleteAsync(item)); }