public bool Execute(IList <IViewModel> fields) { var teamJoinCode = fields.GetFieldValue("TeamJoinCode"); var loginUser = new LoginUser(); var loggedInProfile = loginUser.GetCurrentUserProfile(); var githubUsername = loginUser.GetCurrentUserGithub(); if (!string.IsNullOrEmpty(teamJoinCode) && !string.IsNullOrEmpty(githubUsername)) { var teamsRepo = new TeamsRepository(); var teamMember = teamsRepo.JoinHackathonTeam(loggedInProfile.FullName, "", loggedInProfile.Email, githubUsername, teamJoinCode); if (teamMember != null) { return(true); } } return(false); }
protected void btnJoin_Click(object sender, EventArgs e) { TeamsRepository repo = new TeamsRepository(); repo.JoinHackathonTeam("Test", "test", "*****@*****.**", txtGituser.Text, txtTeamName.Text); }