Exemplo n.º 1
0
        public void Close(object obj)
        {
            var view = new AddBreakdownView();
            AddBreakdownViewModel vm = new AddBreakdownViewModel(this._workerGeneralWindowViewModel);

            vm.PersonToAdd   = _workerGeneralWindowViewModel.Person;
            view.DataContext = vm;
            _workerGeneralWindowViewModel.SelectedView = view;
        }
Exemplo n.º 2
0
        private void Add(object obj)
        {
            string message = "Dodano awarię\n";
            string titel   = "Informacja o dodaniu awarii";

            _ctx.Breakdowns.Add(new Breakdown {
                Device             = SelectedDevice,
                Type               = SelectedBreakedownType,
                RequestDate        = RequestDate,
                ReportingPerson    = PersonToAdd,
                RequestDescription = Description,
                Status             = StatusBreakdown.Zgłoszona,
                OverhaulDate       = DateTime.Now
            });
            _ctx.SaveChanges();
            var result = MessageBox.Show(message, titel);
            var view   = new AddBreakdownView();
            AddBreakdownViewModel vm = new AddBreakdownViewModel(this._workerGeneralWindowViewModel);

            vm.PersonToAdd   = _workerGeneralWindowViewModel.Person;
            view.DataContext = vm;
            _workerGeneralWindowViewModel.SelectedView = view;
        }