Exemplo n.º 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;
            }
        }
Exemplo n.º 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;
            }
        }