public override void Run() { ItemReceiptForm2 form = new ItemReceiptForm2(); IItemReceiptRepository receiptDao = new NHibernateItemReceiptRepository(); IVendorRepository vendorDao = new NHibernateVendorRepository(); form.VendorsList += delegate { form.Vendors = vendorDao.FindActive(); }; form.ItemReceiptSaveAndClose += delegate(object sender, ItemReceiptEventArgs e) { receiptDao.SaveOrUpdate(e.ItemReceipt); form.Close(); }; WorkbenchSingleton.AddChild(form); }
public override void Run() { var form = new ItemReceiptForm2(receipt); WorkbenchSingleton.AddChild(form); }