Beispiel #1
0
        private void BtnChange_Click(object sender, EventArgs e)
        {
            if (this.dataGridView1.SelectedRows.Count != 1)
            {
                MessageBox.Show("Выберите одну строку");
                return;
            }
            var     selectedId = this.dataGridView1.SelectedRows[0].Cells["Id"].Value;
            Product selected   = db.Products.Find(selectedId);
            var     detail     = new ProductDetailForm(db, selected);

            detail.Show();
        }
Beispiel #2
0
        private void BtnAdd_Click(object sender, EventArgs e)
        {
            var detail = new ProductDetailForm(db);

            detail.Show();
        }