private void Update_Click(object sender, RoutedEventArgs e)
 {
     Member.FirstName   = firstName.Text;
     Member.LastName    = lastName.Text;
     Member.Address     = address.Text;
     Member.PhoneNumber = phoneNumber.Text;
     Member.Email       = email.Text;
     Member.Gender      = EnumDescription.GetValueFromDescription <Gender>(gender.Text);
     Member.Level       = new LevelRepository().GetLevel(level.Text);
     new MemberRepository().UpdateMember(Member);
     MessageBox.Show($"Oplysningerne for {Member.FirstName} {Member.LastName} er opdateret.", "Opdateret");
     Window.GetWindow(this).Close();
 }
Example #2
0
 private void Create_Click(object sender, RoutedEventArgs e)
 {
     new MemberRepository().InsertMember(
         new Member()
     {
         FirstName   = firstName.Text,
         LastName    = lastName.Text,
         Address     = address.Text,
         PhoneNumber = phoneNumber.Text,
         Email       = email.Text,
         BirthDate   = DateTime.Parse($"{birthYear.Text}-{birthMonth.Text}-{birthDay.Text}"),
         Gender      = EnumDescription.GetValueFromDescription <Gender>(gender.Text),
         Level       = new LevelRepository().GetLevel(level.Text)
     });
     Window.GetWindow(this).Close();
 }