Exemplo n.º 1
0
        public static void AddEventToDb(int eventTypeId, int teamId, int matchId, int value, sakilaEntities4 db)
        {
            var newEv = new matchevent();

            newEv.EventTypeID = eventTypeId;
            newEv.TeamID      = teamId;
            newEv.eventvalue  = value;
            newEv.MatchID     = matchId;

            db.matchevent.Add(newEv);
            db.SaveChanges();
        }
Exemplo n.º 2
0
        public static void AddOffsidesDetailsToDb(DataObjects.MatchDetails match, sakilaEntities4 db, int homeTeamID, int awayTeamID)
        {
            //2
            var homeEv = new matchevent();

            homeEv.EventTypeID = 2;
            homeEv.TeamID      = homeTeamID;
            homeEv.eventvalue  = match.HomeTeam.Offsides;
            homeEv.MatchID     = match.MatchID;

            var awayEv = new matchevent();

            awayEv.EventTypeID = 2;
            awayEv.TeamID      = awayTeamID;
            awayEv.eventvalue  = match.AwayTeam.Offsides;
            awayEv.MatchID     = match.MatchID;

            db.matchevent.Add(homeEv);
            db.matchevent.Add(awayEv);
            db.SaveChanges();
        }
Exemplo n.º 3
0
        public static void AddShotsDetailsToDb(DataObjects.MatchDetails match, sakilaEntities4 db, int homeTeamID, int awayTeamID)
        {
            var homeEv = new matchevent();

            homeEv.EventTypeID = 5;
            homeEv.TeamID      = homeTeamID;
            homeEv.eventvalue  = match.HomeTeam.OnTarget;
            homeEv.MatchID     = match.MatchID;

            var awayEv = new matchevent();

            awayEv.EventTypeID = 5;
            awayEv.TeamID      = awayTeamID;
            awayEv.eventvalue  = match.AwayTeam.OnTarget;
            awayEv.MatchID     = match.MatchID;

            var homeEv2 = new matchevent();

            homeEv2.EventTypeID = 6;
            homeEv2.TeamID      = homeTeamID;
            homeEv2.eventvalue  = match.HomeTeam.OffTarget;
            homeEv2.MatchID     = match.MatchID;

            var awayEv2 = new matchevent();

            awayEv2.EventTypeID = 6;
            awayEv2.TeamID      = awayTeamID;
            awayEv2.eventvalue  = match.AwayTeam.OffTarget;
            awayEv2.MatchID     = match.MatchID;

            db.matchevent.Add(homeEv);
            db.matchevent.Add(homeEv2);
            db.matchevent.Add(homeEv);
            db.matchevent.Add(awayEv2);
            db.SaveChanges();
        }