//Ajouter restaurant private void buttonAddResto_Click(object sender, EventArgs e) { FormRestaurant f = new FormRestaurant(); f.ShowDialog(); PopulateGrids(); }
//Bouton ajouter restaurant private void buttonAddResto_Click(object sender, EventArgs e) { //Affichage du form d'ajout en passant l'id du restaurateur en paramètre FormRestaurant f = new FormRestaurant(idRestaurateur); f.ShowDialog(); Populate(); }
//Bouton modifier restaurant private void buttonModResto_Click(object sender, EventArgs e) { //récupération du restaurant Restaurant r = RestaurantManager.GetAll().Find(x => x.id == (int)dataGridViewRestOwned.SelectedRows[0].Cells[0].Value); if (r != null) { FormRestaurant f = new FormRestaurant(r); f.ShowDialog(); Populate(); } }
//Modifier restaurant private void buttonModResto_Click(object sender, EventArgs e) { int id = (int)dataGridViewRestaurants.SelectedRows[0].Cells[0].Value; if (id > 0) { Restaurant restaurant = RestaurantManager.GetAll().Find(x => x.id == id); FormRestaurant f = new FormRestaurant(restaurant); f.ShowDialog(); PopulateGrids(); } }