Пример #1
0
        private void drgvFood_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            Food selectedFood = drgvFood.Rows[drgvFood.CurrentCell.RowIndex].DataBoundItem as Food;

            if (selectedFood == null)
            {
                return;
            }

            FormFoodAddEdit formNewRestaurant = new FormFoodAddEdit(this, FormFoodAddEdit.ACTION_TYPE.VIEW);

            formNewRestaurant.SetDataForm(selectedFood);
            formNewRestaurant.ShowDialog();
        }
Пример #2
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            Food selectedFood = drgvFood.Rows[drgvFood.CurrentCell.RowIndex].DataBoundItem as Food;

            if (selectedFood == null)
            {
                MessageBox.Show("Bạn phải chọn món ăn !!!", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            FormFoodAddEdit formNewRestaurant = new FormFoodAddEdit(this, FormFoodAddEdit.ACTION_TYPE.EDIT);

            formNewRestaurant.SetDataForm(selectedFood);
            formNewRestaurant.ShowDialog();
        }
Пример #3
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            FormFoodAddEdit formNewRestaurant = new FormFoodAddEdit(this, FormFoodAddEdit.ACTION_TYPE.CREATE);

            formNewRestaurant.ShowDialog();
        }