Esempio n. 1
0
        private void UpdateClient_Click(object sender, RoutedEventArgs e)
        {
            ClientViewModel  clVM = ClientBox.SelectedItem as ClientViewModel;
            EditWindowClient ew   = new EditWindowClient(clVM);
            var result            = ew.ShowDialog();

            if (result == true)
            {
                clientService.Update(clVM);
                ew.Close();
                orgs                  = orgService.GetAll();
                clients               = clientService.GetAll();
                OrgBox.ItemsSource    = orgs;
                ClientBox.ItemsSource = clients;
            }
        }
Esempio n. 2
0
        private void AddClient_Click(object sender, RoutedEventArgs e)
        {
            var clVM            = new ClientViewModel();
            EditWindowClient ew = new EditWindowClient(clVM);
            var result          = ew.ShowDialog();

            if (result == true)
            {
                var org = OrgBox.SelectedItem as OrgViewModel;
                clientService.AddClientToOrg(org.OrgID, clVM);
                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;
            }
        }