Example #1
0
 private void FindByPassport_Completed(object sender, EventArgs e)
 {
     if (context.Donors.Count != 0)
     {
         // Нашли донора.
         donor = context.Donors.ElementAt(0);
     }
     else
     {
         // Не нашли донора - спрашиваем о добавлении.
         ConfirmDialog addDonorDialog = new ConfirmDialog("Нет записи с такими данными. Добавить нового донора?", donor);
         addDonorDialog.Title = "Не найдено";
         addDonorDialog.Show();
         addDonorDialog.Closed += (s, e1) => {
             if ((s as ChildWindow).DialogResult == true)
             {
                 // Добавить нового донора.
                 DonorForm form = new DonorForm(donor);
                 form.Show();
                 form.Closed += form_Closed;
             }
         };
     };
     gridDonor.DataContext = donor;
 }
Example #2
0
 private void HyperlinkButton_AddDonor(object sender, RoutedEventArgs e)
 {
     DonorForm winEdit = new DonorForm();
     winEdit.Title = "Добавление данных";
     winEdit.Show();
     winEdit.Closed += AddItem;
 }
Example #3
0
        private void HyperlinkButton_EditDonor(object sender, RoutedEventArgs e)
        {
            Donor EditDonor = Donor_List.SelectedItem as Donor;

            if (EditDonor != null)
            {
                DonorForm winEdit = new DonorForm(EditDonor);
                winEdit.Title = "Редактирование данных";
                winEdit.Show();
                winEdit.Closed += EditItem;
            }
        }