Beispiel #1
0
        public override bool CommitChanges(StepPartners step, Assistant assistant)
        {
            BackgroundJob job = new BackgroundJob(step);

            job.Action += () =>
            {
                PresentationDomain.Invoke(() => { step.Notebook.Sensitive = false; });
                IList <CustomerWrapper> allCustomers = GetAllCustomers();
                if (allCustomers.Count <= 0)
                {
                    return;
                }

                CustomerWrapper def = allCustomers [0];
                // Substitute the default customer
                def.Customer.Id = Partner.DefaultId;
                def.CommitChanges();

                foreach (CustomerWrapper customer in allCustomers)
                {
                    customer.CommitChanges();
                }
            };
            assistant.EnqueueBackgroundJob(job);

            return(true);
        }
 public abstract bool CommitChanges(StepPartners step, Assistant assistant);