private void ExecuteSave(object param) { try { if (editSP != null) { editSP.Name = Name; editSP.DepartmentId = DepartmentId; editSP.SelffinancedPlaces = SelffinancedPlaces; editSP.BudgetPlaces = BudgetPlaces; editSP.Tuition = Tuition; ServiceDataProvider.EditStudyProgram(editSP); eventArgs.GetEvent <StudyProgramEvent>().Publish(editSP); } else { StudyProgram newStudyProgram = new StudyProgram() { Name = Name, DepartmentId = DepartmentId, SelffinancedPlaces = SelffinancedPlaces, BudgetPlaces = BudgetPlaces, Tuition = Tuition }; ServiceDataProvider.AddStudyProgram(newStudyProgram); } } catch (Exception e) { e.Message.ToString(); } finally { view.Close(); } }