Exemple #1
0
        private void UpdatePayment_Click(object sender, RoutedEventArgs e)
        {
            PaymentViewModel  pmntVM = PaymentGrid.SelectedItem as PaymentViewModel;
            EditWindowPayment ew     = new EditWindowPayment(pmntVM);
            var result = ew.ShowDialog();

            if (result == true)
            {
                paymentService.Update(pmntVM);
                ew.Close();
                orgs                    = orgService.GetAll();
                clients                 = clientService.GetAll();
                orders                  = orderService.GetAll();
                payments                = paymentService.GetAll();
                OrgBox.ItemsSource      = orgs;
                ClientBox.ItemsSource   = clients;
                OrderBox.ItemsSource    = orders;
                PaymentGrid.ItemsSource = payments;
            }
        }
Exemple #2
0
        private void AddPayment_Click(object sender, RoutedEventArgs e)
        {
            var payment = OrderBox.SelectedItem as OrderViewModel;
            var pmntVM  = new PaymentViewModel();

            pmntVM.PaymentData = "01.01.2017";
            EditWindowPayment ew = new EditWindowPayment(pmntVM);
            var result           = ew.ShowDialog();

            if (result == true)
            {
                paymentService.AddPaymentToOrder(payment.OrderID, pmntVM);
                ew.Close();
                //orgs = orgService.GetAll();
                //clients = clientService.GetAll();
                //orders = orderService.GetAll();
                payments = paymentService.GetAll();
                //OrgBox.ItemsSource = orgs;
                //ClientBox.ItemsSource = clients;
                //OrderBox.ItemsSource = orders;
                PaymentGrid.ItemsSource = payments;
            }
        }