private Form createForm(string name) { Form form = null; switch (name) { case "goods": form = new GoodsForm(); break; case "customers": form = new CustomerForm(); break; case "invoices": form = new InvoiceForm(); ChangeRangeDate += delegate(object sender) { ((InvoiceForm)form).LoadInvoicesData(); }; break; } return(form); }
private void btnChooseProduct_Click(object sender, EventArgs e) { GoodsForm goodsForm = new GoodsForm(); if (goodsForm.ShowDialog() == DialogResult.OK) { InvoiceLine.PRODUCT_ID = goodsForm.CurrentProduct.PRODUCT_ID; edtProduct.Text = goodsForm.CurrentProduct.NAME; edtPrice.Text = goodsForm.CurrentProduct.PRICE.ToString("F2"); } }