コード例 #1
0
ファイル: EventEdit.xaml.cs プロジェクト: Azur0/festispec
        private void LoadEvent(int eventId)
        {
            PageHelper.DoAsync(overlay, Dispatcher, () =>
            {
                // Ophalen van huidige event
                EventViewModel.LoadEventByPK(eventId);
                EventViewModel.LoadCustomers();
                EventViewModel.LoadPaymentStatus();

                // fill dropdown with customers
                PageHelper.MainUI(Dispatcher, () =>
                {
                    this.EventViewModel.Customers.ForEach(customer =>
                    {
                        dropDownItemsCustomer.AddItem(customer.Id, customer.Name.Substring(0, 1).ToUpper() + customer.Name.Substring(1, customer.Name.Length - 1).ToLower());
                    });

                    // fill dropdown with payment statusses
                    this.EventViewModel.PaymentStatusList.ForEach(PaymentStatus =>
                    {
                        dropDownItemsPaymentStatus.AddItem(PaymentStatus, PaymentStatus.Substring(0, 1).ToUpper() + PaymentStatus.Substring(1, PaymentStatus.Length - 1).ToLower());
                    });

                    this.EventViewModel.PaymentStatus = this.EventViewModel.PaymentStatus;
                    this.EventViewModel.CustomerId    = this.EventViewModel.CustomerId;
                    this.Bindings.Update();
                });
            });
        }