public async void save_habit_data(Recurring Habit_, DateTime?occurence_date = null) { int i = 0; if (occurence_date == null) { occurence_date = Habit_.date_started; } occurence_date = Convert.ToDateTime(occurence_date); DateTime dt = Convert.ToDateTime(occurence_date); while (occurence_date <= Habit_.date_ended) { var Habit_Data_ = new Habit_Data { //Job = Habit_, Job_ID = Habit_.ID, date_run = dt, money_saved = Habit_.money_saved, money_stored = Habit_.money_saved, stash_to_use = Habit_.stash_to_use }; await SaveItemAsync(Habit_Data_); occurence_date = new utils_data.FrequencyTranslator().AddDate(Habit_, dt); } //return Habit_Data_; }
// public double money_saved_date() //{ //} public Task <int> SaveItemAsync(Habit_Data item) { if (item.ID != 0) { return(_database.UpdateAsync(item)); } return(_database.InsertAsync(item)); }
public Task <int> DeleteItemAsync(Habit_Data item) { return(_database.DeleteAsync(item)); }
public Task <int> SaveJobAsync(Habit_Data habit) { return(_database.InsertAsync(habit)); }