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());
        }
Beispiel #2
0
        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);
        }