private void ExecuteSave(object param) { try { if (editDepartment != null) { editDepartment.DepartmentHead = DepartmentHead; editDepartment.FoundationYear = FoundationYear; editDepartment.Name = Name; editDepartment.Website = Website; ServiceDataProvider.EditDepartment(editDepartment); eventAggregator.GetEvent <DepartmentEvent>().Publish(editDepartment); } else { Department newDepartment = new Department() { Name = Name, FoundationYear = FoundationYear, DepartmentHead = DepartmentHead, Website = website }; ServiceDataProvider.AddDepartment(newDepartment); } } catch (Exception e) { e.Message.ToString(); } finally { view.Close(); } }