Exemple #1
0
        private void drgvRestaurant_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            Restaurant selectedRestaurant = drgvRestaurant.Rows[drgvRestaurant.CurrentCell.RowIndex].DataBoundItem as Restaurant;

            if (selectedRestaurant == null)
            {
                return;
            }

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

            formNewRestaurant.SetDataForm(selectedRestaurant);
            formNewRestaurant.ShowDialog();
        }
Exemple #2
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            Restaurant selectedRestaurant = drgvRestaurant.Rows[drgvRestaurant.CurrentCell.RowIndex].DataBoundItem as Restaurant;

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

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

            formNewRestaurant.SetDataForm(selectedRestaurant);
            formNewRestaurant.ShowDialog();
        }
 public FormRestaurantMap(FormRestaurantAddEdit _formParent, Restaurant _restaurant)
 {
     this.formParent = _formParent;
     this.restaurant = _restaurant;
     InitializeComponent();
 }
Exemple #4
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            FormRestaurantAddEdit formNewRestaurant = new FormRestaurantAddEdit(this, FormRestaurantAddEdit.ACTION_TYPE.CREATE);

            formNewRestaurant.ShowDialog();
        }