Beispiel #1
0
        public override void Run()
        {
            CustomerForm        form = new CustomerForm();
            ICustomerRepository dao  = new NHibernateCustomerRepository();

            form.CustomerSave += delegate(object sender, CustomerEventArgs e) {
                dao.SaveOrUpdate(e.Customer);
                form.Close();
            };
            WorkbenchSingleton.AddChild(form);
        }
Beispiel #2
0
        public override void Run()
        {
//			var view = new CustomerForm(customer);
//			view.ListJobTypes += delegate { view.JobTypes = JobType.FindActive(); };
//			view.ListCustomerTypes += delegate { view.Types = CustomerType.FindActive(); };
//			view.ListTerms += delegate { view.Terms = Terms.FindActive(); };
//			view.ListPriceLevels += delegate { view.PriceLevels = PriceLevel.FindActive(); };
//			view.ListPaymentMethods += delegate { view.PaymentMethods = PaymentMethod.FindActive(); };
//			view.ListSalesTaxCodes += delegate { view.SalesTaxCodes = SalesTaxCode.FindActive(); };
//			view.SaveCustomer += delegate(Customer sender, EventArgs e) {
//				sender.SaveOrUpdate();
//				view.Close();
//			};
//			WorkbenchSingleton.AddChild(view, "Edit Customer");
            CustomerForm        form = new CustomerForm(customer);
            ICustomerRepository dao  = new NHibernateCustomerRepository();

            form.CustomerSave += delegate(object sender, CustomerEventArgs e) {
                dao.SaveOrUpdate(e.Customer);
                form.Close();
            };
            WorkbenchSingleton.AddChild(form, "Edit Customer");
        }