Пример #1
0
        public int?PersonUpdateTransaction(Person person)
        {
            int?personID = null;

            try
            {
                using (NetballEntities context = new NetballEntities())
                {
                    context.Entry(person).State = EntityState.Modified;
                    context.SaveChanges();
                    personID = person.PersonID;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(personID);
        }
Пример #2
0
        /// <summary>
        /// Insert a GamePlayer object in GamePlayer table returning GamePlayerID if successful.
        /// GamePlayerID = null if failed.
        /// </summary>
        /// <param name="GamePlayer"></param>
        /// <returns></returns>
        public int?GamePlayerAdd(GamePlayer gameplayer)
        {
            int?gameplayerID = null;

            try
            {
                using (NetballEntities context = new NetballEntities())
                {
                    context.Entry(gameplayer).State = EntityState.Added;
                    context.SaveChanges();
                    gameplayerID = gameplayer.GamePlayerID;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(gameplayerID);
        }
Пример #3
0
        public int?GameTeamUpdateTransaction(GameTeam gameteam)
        {
            int?gameteamID = null;

            try
            {
                using (NetballEntities context = new NetballEntities())
                {
                    context.Entry(gameteam).State = EntityState.Modified;
                    context.SaveChanges();
                    gameteamID = gameteam.GameTeamID;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(gameteamID);
        }
Пример #4
0
        /// <summary>
        /// Insert a Court object in Court table returning CourtID if successful.
        /// CourtID = null if failed.
        /// </summary>
        /// <param name="Court"></param>
        /// <returns></returns>
        public int?CourtAdd(Court court)
        {
            int?courtID = null;

            try
            {
                using (NetballEntities context = new NetballEntities())
                {
                    context.Entry(court).State = EntityState.Added;
                    context.SaveChanges();
                    courtID = court.CourtID;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(courtID);
        }
Пример #5
0
        /// <summary>
        /// Insert a Division object in Division table returning DivisionID if successful.
        /// DivisionID = null if failed.
        /// </summary>
        /// <param name="Division"></param>
        /// <returns></returns>
        public int?DivisionAdd(Division division)
        {
            int?divisionID = null;

            try
            {
                using (NetballEntities context = new NetballEntities())
                {
                    context.Entry(division).State = EntityState.Added;
                    context.SaveChanges();
                    divisionID = division.DivisionID;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(divisionID);
        }
Пример #6
0
        public int?CoachUpdateTransaction(Coach coach)
        {
            int?coachID = null;

            try
            {
                using (NetballEntities context = new NetballEntities())
                {
                    context.Entry(coach).State = EntityState.Modified;
                    context.SaveChanges();
                    coachID = coach.CoachID;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(coachID);
        }