Esempio n. 1
0
        //Ajouter restaurant
        private void buttonAddResto_Click(object sender, EventArgs e)
        {
            FormRestaurant f = new FormRestaurant();

            f.ShowDialog();
            PopulateGrids();
        }
Esempio n. 2
0
        //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();
        }
Esempio n. 3
0
        //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();
            }
        }
Esempio n. 4
0
        //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();
            }
        }