Пример #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            switch (comboBox2.SelectedItem)
            {
            case "Suppliers":
                frmAddSupplier frm = new frmAddSupplier();
                frm.Show();
                break;

            case "Customers":
                frmAddCustomer frmc = new frmAddCustomer();
                frmc.Show();
                break;

            case "Products":
                frmAddProduct frmp = new frmAddProduct();
                frmp.Show();
                break;

            case "Orders":
                frmAddOrder frmo = new frmAddOrder();
                frmo.Show();
                break;
                //case "Order Items":
                //    frmAddOrderItem frmoi = new frmAddOrderItem();
                //    frmoi.Show();
                //    break;
            }
        }
Пример #2
0
        private void btn_edit_Click(object sender, EventArgs e)
        {
            var row = dataGridView1.CurrentRow;
            int Id  = (int)row.Cells["ID"].Value;

            switch (t)
            {
            case "Suppliers":
                frmAddSupplier frm = new frmAddSupplier(Id);
                frm.Show();
                break;

            case "Customers":
                frmAddCustomer frmc = new frmAddCustomer(Id);
                frmc.Show();
                break;

            case "Products":
                frmAddProduct frmp = new frmAddProduct(Id);
                frmp.Show();
                break;

            case "Orders":
                frmAddOrder frmo = new frmAddOrder(Id);
                frmo.Show();
                break;
                //case "Order Items":
                //    frmAddOrderItem frmoi = new frmAddOrderItem(Id);
                //    frmoi.Show();
                //    break;
            }
        }