public void VerifyTrainer(IVerifyUserView inForm, Trainer trainer, IPlayerRepository playerRepository, ITrainerRepository trainerRepository, ITeamRepository teamRepository) { inForm.SetTrainerValues(trainer); var result = inForm.ShowViewModal(); if (result == DialogResult.OK) { trainerRepository.Verify(trainer); _form.DisplayTrainerList(trainerRepository.GetAll(), teamRepository.GetAll()); } else if (result == DialogResult.No) { trainerRepository.Delete(trainer); } _form.DisplayRegisterRequests(playerRepository.GetAll(), trainerRepository.GetAll()); }
public void ShowTrainerOptions(IAdminView parentForm, IAdminTrainerOptionsView form, Trainer trainer, ITrainerRepository trainerRepository, ITeamRepository teamRepository) { form.SetTrainerValues(trainer, teamRepository.GetAll()); var result = form.ShowViewModal(); if (result == DialogResult.Yes) { string teamAddName = form.NameAddTeam(); teamRepository.AddTrainerToTeam(trainer, teamAddName, trainerRepository); } else if (result == DialogResult.No) { string teamRemoveName = form.NameRemoveTeam(); teamRepository.RemoveTrainerFromTeam(trainer, teamRemoveName, trainerRepository); } else if (result == DialogResult.Abort) { teamRepository.DeleteTrainer(trainer, trainerRepository); } parentForm.DisplayTrainerList(trainerRepository.GetAll(), teamRepository.GetAll()); parentForm.DisplayTeamList(teamRepository.GetAll()); }