protected void btnChallenge_Click(object sender, EventArgs e) { var tournamentGUID = this.GetRedirectParameter("tournamentGUID", false); if (tournamentGUID != null) { using(var db = Global.GetConnection()) { //check so this participant isn't added already var participantcheck = from p in db.Ext_PrivateTournamentParticipant where p.PrivateTournamentGUID == new Guid(tournamentGUID.ToString()) && p.TeamGUID == new Guid(drpTeamsToChallenge.SelectedValue) select p; if (participantcheck.ToList().Count > 0) { lblChallengeMessage.Text = "Det laget är redan utmanat"; return; } var participant = new Ext_PrivateTournamentParticipant(); participant.TeamGUID = new Guid(drpTeamsToChallenge.SelectedValue); participant.PrivateTournamentGUID = new Guid(tournamentGUID.ToString()); participant.IsAccepted = false; db.Ext_PrivateTournamentParticipant.InsertOnSubmit(participant); db.SubmitChanges(); LoadParticipants(new Guid(tournamentGUID.ToString()),db ); } } }
partial void DeleteExt_PrivateTournamentParticipant(Ext_PrivateTournamentParticipant instance);
private void detach_Ext_PrivateTournamentParticipant(Ext_PrivateTournamentParticipant entity) { this.SendPropertyChanging(); entity.Inti_Team = null; }
partial void InsertExt_PrivateTournamentParticipant(Ext_PrivateTournamentParticipant instance);
private void attach_Ext_PrivateTournamentParticipant(Ext_PrivateTournamentParticipant entity) { this.SendPropertyChanging(); entity.Ext_PrivateTournament = this; }