예제 #1
0
        private e.Team CreateEntityFromTeam(Team t)
        {
            if (t == null)
            {
                return(null);
            }

            e.Team result = e.Team.CreateTeam(t.Id, t.Name, t.Password, t.CreateDate, t.Score, t.IsAdmin);

            return(result);
        }
예제 #2
0
        public Team UpdateTeam(Team team)
        {
            e.Team toUpdate = (from t in _m.Team
                               where t.Id == team.Id
                               select t).First();

            toUpdate.Members  = team.Members;
            toUpdate.Name     = team.Name;
            toUpdate.Password = team.Password;
            toUpdate.IsAdmin  = team.IsAdmin;
            toUpdate.Score    = team.Score;

            _m.SaveChanges();
            _m.Refresh(System.Data.Objects.RefreshMode.StoreWins, toUpdate);

            return(team);
        }
예제 #3
0
        public Team SaveTeam(Team team)
        {
            e.Team toSave = new e.Team()
            {
                IsAdmin    = team.IsAdmin,
                Members    = team.Members,
                Name       = team.Name,
                Password   = team.Password,
                Score      = team.Score,
                CreateDate = DateTime.Now
            };

            _m.AddToTeam(toSave);
            _m.SaveChanges();

            team.Id = toSave.Id;

            return(team);
        }
예제 #4
0
        private Team CreateTeamFromEntity(e.Team eTeam)
        {
            if (eTeam == null)
            {
                return(null);
            }
            Team result = new Team()
            {
                Id         = eTeam.Id,
                CreateDate = eTeam.CreateDate,
                IsAdmin    = eTeam.IsAdmin,
                Name       = eTeam.Name,
                Members    = eTeam.Members,
                Password   = eTeam.Password,
                Score      = eTeam.Score
            };

            return(result);
        }
예제 #5
0
        public Team SaveTeam(Team team)
        {
            e.Team toSave = new e.Team()
            {
                IsAdmin    = team.IsAdmin,
                Members    = team.Members,
                Name       = team.Name,
                Password   = team.Password,
                Score      = team.Score,
                CreateDate = DateTime.Now
            };

            _m.AddToTeam(toSave);
            _m.SaveChanges();
            // _m.Refresh(System.Data.Objects.RefreshMode.StoreWins, toSave);

            team.Id = toSave.Id;

            return(team);
        }
예제 #6
0
        private e.Team CreateEntityFromTeam(Team t)
        {
            if (t == null)
            {
                return(null);
            }

            e.Team result = e.Team.CreateTeam(t.Id, t.Name, t.Password, t.CreateDate, t.Score, t.IsAdmin);

            //e.Team result = new e.Team()
            //{
            //    Id = t.Id,
            //    CreateDate = t.CreateDate,
            //    IsAdmin = t.IsAdmin,
            //    Members = t.Members,
            //    Name = t.Name,
            //    Password = t.Password,
            //    Score = t.Score
            //};

            return(result);
        }
예제 #7
0
        private Team CreateTeamFromEntity(e.Team eTeam)
        {
            if (eTeam == null)
            {
                return null;
            }
            Team result = new Team()
            {
                Id = eTeam.Id,
                CreateDate = eTeam.CreateDate,
                IsAdmin = eTeam.IsAdmin,
                Name = eTeam.Name,
                Members = eTeam.Members,
                Password = eTeam.Password,
                Score = eTeam.Score
            };

            return result;
        }
예제 #8
0
        private e.Team CreateEntityFromTeam(Team t)
        {
            if (t == null)
            {
                return null;
            }

            e.Team result = e.Team.CreateTeam(t.Id, t.Name, t.Password, t.CreateDate, t.Score, t.IsAdmin);

            //e.Team result = new e.Team()
            //{
            //    Id = t.Id,
            //    CreateDate = t.CreateDate,
            //    IsAdmin = t.IsAdmin,
            //    Members = t.Members,
            //    Name = t.Name,
            //    Password = t.Password,
            //    Score = t.Score
            //};

            return result;
        }
예제 #9
0
        public Team UpdateTeam(Team team)
        {
            e.Team toUpdate = (from t in _m.Team
                               where t.Id == team.Id
                               select t).First();

            toUpdate.Members = team.Members;
            toUpdate.Name = team.Name;
            toUpdate.Password = team.Password;
            toUpdate.IsAdmin = team.IsAdmin;
            toUpdate.Score = team.Score;

            _m.SaveChanges();
            _m.Refresh(System.Data.Objects.RefreshMode.StoreWins, toUpdate);

            return team;
        }
예제 #10
0
        public Team SaveTeam(Team team)
        {
            e.Team toSave = new e.Team()
            {
                IsAdmin = team.IsAdmin,
                Members = team.Members,
                Name = team.Name,
                Password = team.Password,
                Score = team.Score,
                CreateDate = DateTime.Now
            };

            _m.AddToTeam(toSave);
            _m.SaveChanges();
            // _m.Refresh(System.Data.Objects.RefreshMode.StoreWins, toSave);

            team.Id = toSave.Id;

            return team;
        }
예제 #11
0
        private e.Team CreateEntityFromTeam(Team t)
        {
            if (t == null)
            {
                return null;
            }

            e.Team result = e.Team.CreateTeam(t.Id, t.Name, t.Password, t.CreateDate, t.Score, t.IsAdmin);

            return result;
        }
예제 #12
0
        public Team SaveTeam(Team team)
        {
            e.Team toSave = new e.Team()
            {
                IsAdmin = team.IsAdmin,
                Members = team.Members,
                Name = team.Name,
                Password = team.Password,
                Score = team.Score,
                CreateDate = DateTime.Now
            };

            _m.AddToTeam(toSave);
            _m.SaveChanges();

            team.Id = toSave.Id;

            return team;
        }