Esempio n. 1
0
        private void btnAdd_Click_1(object sender, EventArgs e)
        {
            var form = new ProductAddForm();

            form.ShowDialog();
            if (form.DialogResult == DialogResult.OK)
            {
                dgvProductsRefresh();
            }
        }
Esempio n. 2
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            if (dgvProducts.SelectedRows.Count == 0)
            {
                return;
            }

            var form = new ProductAddForm();

            form.EditMode  = true;
            form.ProductId = Convert.ToInt32(dgvProducts.SelectedRows[0].Cells["clnProductId"].Value);
            form.ShowDialog();
            if (form.DialogResult == DialogResult.OK)
            {
                dgvProductsRefresh();
            }
        }