async void OnButtonClicked(object sender, EventArgs args) { string subtyype = "TASK_SUBTYPE_PERS"; string tyype = "PERSONAL"; if (school) { subtyype = "TASK_SUBTYPE_SC"; tyype = "SCHOOL"; } SchoolTask.InsertSchoolTask(MyUser.me, ListEntry.getEntryfromTypeAndCode("TASK_CATEGORIES", tyype), coloursforevent.ListEntryList[Task_colour.SelectedIndex], timeconsuminglevel.ListEntryList[Task_consuming.SelectedIndex], ListEntry.getEntryfromTypeAndCode(subtyype, subtype), Desc.Text, SubDesc.Text, false, test.Date); if (subtype != "OTHER") { SchoolTask.Intelligent(MyUser.me, ListEntry.getEntryfromTypeAndCode("TASK_CATEGORIES", tyype), coloursforevent.ListEntryList[Task_colour.SelectedIndex], timeconsuminglevel.ListEntryList[Task_consuming.SelectedIndex], ListEntry.getEntryfromTypeAndCode(subtyype, subtype), Desc.Text, SubDesc.Text, false, test.Date); } await Navigation.PushAsync(new Calendar()); }
public static void InsertWorkout( ListEntry ex1, ListEntry ex2, ListEntry ex3, ListEntry ex4, ListEntry ex5, ListEntry ex6, ListEntry ex7, ListEntry ex8, ListEntry ex9, ListEntry ex10, DateTime DueDate, String Type) { // Get a collection (or create, if doesn't exist) var col = Database.db.GetCollection <Workout>("AllWorkouts"); // Index document using these properties col.EnsureIndex(x => x.Exercice1); col.EnsureIndex(x => x.Exercice2); col.EnsureIndex(x => x.Exercice3); col.EnsureIndex(x => x.Exercice4); col.EnsureIndex(x => x.Exercice5); col.EnsureIndex(x => x.Exercice6); col.EnsureIndex(x => x.Exercice7); col.EnsureIndex(x => x.Exercice8); col.EnsureIndex(x => x.Exercice9); col.EnsureIndex(x => x.Exercice10); col.EnsureIndex(x => x.DueDate); col.EnsureIndex(x => x.Type); // Create initial data col.Insert( new Workout { Exercice1 = ex1, Exercice2 = ex2, Exercice3 = ex3, Exercice4 = ex4, Exercice5 = ex5, Exercice6 = ex6, Exercice7 = ex7, Exercice8 = ex8, Exercice9 = ex9, Exercice10 = ex10, DueDate = DueDate, Type = Type } ); SchoolTask.InsertSchoolTask(MyUser.me, ListEntry.getEntryfromTypeAndCode("TASK_CATEGORIES", "PERSONAL"), ListEntry.getEntryfromTypeAndCode("COLOURS", "WHITE"), ListEntry.getEntryfromTypeAndCode("TASK_COMPLEXITIES", "MEDIUM"), ListEntry.getEntryfromTypeAndCode("TASK_SUBTYPE_PERS", "SPORT"), "My workout", "Your very own workout session is waiting for you, go to My workouts", false, DueDate); }
public static void Initiate() { //db = new LiteDatabase(@Constants.appDbFilename); db = new LiteDatabase(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), Constants.appDbFilename)); // Si la base est vide il faut créer les collections et données de depart. // Vérifier lignes en users > 0 pour cela. var users = db.GetCollection <User>("Users"); if (users.Count() == 0) { ListEntry.Initiate(); User.Initiate(); SchoolTask.Initiate(); ListEntryForFood.Initiate(); ListEntrySport.Initiate(); ListEntryYOGA.Initiate(); FoodItem.Initiate(); Money.Initiate(); CollectionForMax.Initiate(); MyUser.isDefault = true; } var foodweek = db.GetCollection <Food>("EntriesforFood"); /*var data_list = foodweek.Find(Query.All(), 0, 20); * foreach (var row in data_list) * { * foodweek.Delete(row.Id); * * } */ var sizetest = foodweek.Count(); if (sizetest == 0) { MyFoodWeek.isDefault = true; Food.Initiate(); } MyUser.Initiate(); MyFoodWeek.Initiate(); //FoodItem.Initiate(); ThisMaxMoney.Initiate(); }