コード例 #1
0
        private void UpdateOrg_Click(object sender, RoutedEventArgs e)
        {
            OrgViewModel  orVM   = OrgBox.SelectedItem as OrgViewModel;
            EditWindowOrg ew     = new EditWindowOrg(orVM);
            var           result = ew.ShowDialog();

            if (result == true)
            {
                orgService.Update(orVM);
                ew.Close();
                orgs = orgService.GetAll();
                OrgBox.ItemsSource = orgs;
            }
        }
コード例 #2
0
        private void AddOrg_Click(object sender, RoutedEventArgs e)
        {
            var           orVM   = new OrgViewModel();
            EditWindowOrg ew     = new EditWindowOrg(orVM);
            var           result = ew.ShowDialog();

            if (result == true)
            {
                orgService.Create(orVM);
                ew.Close();
                orgs = orgService.GetAll();
                OrgBox.ItemsSource    = orgs;
                clients               = clientService.GetAll();
                ClientBox.ItemsSource = clients;
                orders = orderService.GetAll();
                OrderBox.ItemsSource    = orders;
                payments                = paymentService.GetAll();
                PaymentGrid.ItemsSource = payments;
            }
        }