public bool Execute(IList <IViewModel> fields) { var teamName = fields.GetFieldValue("TeamName"); var teamDescription = fields.GetFieldValue("TeamDescription"); var loginUser = new LoginUser(); var githubUsername = loginUser.GetCurrentUserGithub(); if (!string.IsNullOrEmpty(teamName) && !string.IsNullOrEmpty(teamDescription) && !string.IsNullOrEmpty(githubUsername)) { var teamsRepo = new TeamsRepository(); var newTeamItem = teamsRepo.CreateHackathonTeam(teamName, teamDescription, githubUsername); if (newTeamItem != null) { return(true); } } return(false); }
protected void CreateTeamButton_Click(object sender, EventArgs e) { TeamsRepository repo = new TeamsRepository(); repo.CreateHackathonTeam(teamName.Text, "Awesome Team!", "SzymonAE"); }