private void ExecuteSave(object param) { try { if (editProf != null) { editProf.NameAndSurname = NameAndSurname; editProf.IsAdmin = IsAdmin; editProf.Phone = Phone; editProf.Address = Address; editProf.BirthDate = BirthDate; editProf.BirthPlace = BirthPlace; editProf.Education = Education; editProf.Username = Username; editProf.Password = Password; ServiceDataProvider.EditProfessor(editProf); eventAggregator.GetEvent <ProfessorEvent>().Publish(editProf); } else { Professor p = new Professor() { NameAndSurname = NameAndSurname, IsAdmin = IsAdmin, Address = Address, Phone = Phone, BirthDate = BirthDate, BirthPlace = BirthPlace, Education = Education, Username = Username, Password = Password }; ServiceDataProvider.AddProfessor(p); } } catch (Exception e) { e.Message.ToString(); } finally { view.Close(); } }