Esempio n. 1
0
        async void Save_Clicked(object sender, System.EventArgs e)
        {
            RealmDataBase db      = new RealmDataBase();
            var           student = db.GetStudent();

            if (student != null && !string.IsNullOrEmpty(Subject.Text) && !string.IsNullOrEmpty(day) && period > 0 && semester > 0)
            {
                UserDialogs.Instance.ShowLoading("Saving Please Wait", MaskType.Black);
                await Loading();

                db.Write(Subject.Text, period.ToString(), new TimeProvider().GetPeriodTime(period.ToString()), semester, day);
                UserDialogs.Instance.HideLoading();
            }
            else
            {
                await DisplayAlert("N***a is you dumb?", "N***a is you dumb? fill all the required information yesses!!", "Cancel");
            }
        }
        async void Save_Clicked(object sender, System.EventArgs e)
        {
            RealmDataBase db      = new RealmDataBase();
            var           student = db.GetStudent();

            if (student == null)
            {
                UserDialogs.Instance.Alert("Please add your timetable using your student number in the Add timetable screen before proceeding with \n adding any addittional subjects, the application only works for undergraduate \n students whos timetable is stored on the universities timetable database."); return;
            }
            if (student != null && !string.IsNullOrEmpty(Subject.Text) && !string.IsNullOrEmpty(day) && period > 0 && semester > 0)
            {
                UserDialogs.Instance.ShowLoading("Saving Please Wait", MaskType.Black);
                await Loading();

                db.Write(Subject.Text, period.ToString(), new TimeProvider().GetPeriodTime(period.ToString()), semester, day);
                UserDialogs.Instance.HideLoading();
            }
            else
            {
                await DisplayAlert("Error!", "Please fill all the required information!!", "OK");
            }
        }