コード例 #1
0
        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_;
        }
コード例 #2
0
        // public double money_saved_date()
        //{

        //}

        public Task <int> SaveItemAsync(Habit_Data item)
        {
            if (item.ID != 0)
            {
                return(_database.UpdateAsync(item));
            }


            return(_database.InsertAsync(item));
        }
コード例 #3
0
 public Task <int> DeleteItemAsync(Habit_Data item)
 {
     return(_database.DeleteAsync(item));
 }
コード例 #4
0
 public Task <int> SaveJobAsync(Habit_Data habit)
 {
     return(_database.InsertAsync(habit));
 }