async private void BtnSave(object sender, EventArgs e) { if (string.IsNullOrWhiteSpace(filierName_Entry.Text)) { await DisplayAlert("Erorr ", "Il faut remplire le champ de la filiére", "Ok", "Cancel"); } else { Filiere filiere = new Filiere() { FiliereName = filierName_Entry.Text }; FiliereRepository dataFilier = new FiliereRepository(); bool resultat = await dataFilier.AddFiliere(filiere); if (resultat) { await DisplayAlert("Congratulation ", "La filiére est ajouter avec succée ", "Ok"); await Navigation.PushAsync(new HomePage2()); } else { await DisplayAlert("Error ", "La fliére est déja Existe", "Ok"); await Navigation.PushAsync(new FilierePage()); } } }
async public void OnPickerSelectedIndexChanged(object sender, EventArgs e) { int selectedIndex = PickerFilier.SelectedIndex; if (selectedIndex != -1) { FiliereRepository filiereRepository = new FiliereRepository(); StudentRepository StudentData = new StudentRepository(); selectedFilierName = PickerFilier.Items[selectedIndex]; id = Dc[selectedFilierName]; } }
async private void Button_Clicked(object sender, EventArgs e) { int selectedIndex = PickerFilier.SelectedIndex; if (string.IsNullOrWhiteSpace(txtLessName.Text) && selectedIndex == -1) { await this.DisplayAlert("Error", "Il faut remplire tous les champs", "ok"); } else { FiliereRepository filiereRepository = new FiliereRepository(); var LessonName = txtLessName.Text; Console.WriteLine(selectedFilierName); var res = await dataLesson.insertToLesson(LessonName, id); if (res) { await this.DisplayAlert("info", "La lesson est ajouter avec success", "ok"); await Navigation.PushAsync(new HomePage2()); } } }
public StatisticsPage() { dataFilier = new FiliereRepository(); InitializeComponent(); }
public SearchPage() { dataFilier = new FiliereRepository(); InitializeComponent(); }