Exemplo n.º 1
0
        private void ChairUpdate()
        {
            ListBoxChair.ItemsSource = unitOfWork.Chairs
                                       .Find(item => item.FacultyId == LocalFaculty.FacultyId)
                                       .Select(item => new WebLibrary.Entities.Chair(item, unitOfWork, new HIndex()));

            ChairBox.ItemsSource   = unitOfWork.Chairs.GetAll().ToList();
            ChairBox.SelectedIndex = 0;
            ChairBox.RaiseEvent(new RoutedEventArgs(ComboBox.SelectedEvent));

            ResearcherUpdate();
        }
Exemplo n.º 2
0
        private void ResearcherChairDeleteButtonOnClick(object sender, RoutedEventArgs e)
        {
            Button button = sender as Button;

            var researcherToDelete = unitOfWork.Researchers.Get((int)button.Tag);

            string message = "Ви впевнені що хочете видалити дані про викладача "
                             + researcherToDelete.LastName + " "
                             + researcherToDelete.FirstName
                             + " " + researcherToDelete.MiddleName + "?";

            DialogWindow dialogWindow = new DialogWindow(message);
            bool?        dialogResult = dialogWindow.ShowDialog();

            if (dialogResult != true)
            {
                return;
            }

            unitOfWork.Researchers.Delete(researcherToDelete.ResearcherId);
            unitOfWork.Save();

            ChairBox.RaiseEvent(new RoutedEventArgs(ComboBox.SelectedEvent));
        }