Esempio n. 1
0
        public void UpdateTerritory(EntitiesLayer.Territory territory)
        {
            DataAccessLayer.ThronesTournamentEntities bdd = new ThronesTournamentEntities();
            Territory objEntity = bdd.Territories.FirstOrDefault(t => t.Id == territory.ID);

            objEntity.owner = territory.ID_House;
            objEntity.type  = territory.ID_Type;

            bdd.SaveChanges();
        }
Esempio n. 2
0
        public void AddTerritory(EntitiesLayer.Territory territory)
        {
            DataAccessLayer.ThronesTournamentEntities bdd = new ThronesTournamentEntities();

            var newTerritory = new Territory();

            newTerritory.owner = territory.ID_House;
            newTerritory.type  = territory.ID_Type;

            bdd.Territories.Add(newTerritory);

            bdd.SaveChanges();
        }
Esempio n. 3
0
        private EntitiesLayer.Territory ConvertToTerritory(Territory element)
        {
            EntitiesLayer.Territory territory = new EntitiesLayer.Territory();

            if (element != null)
            {
                territory.ID       = element.Id;
                territory.ID_Type  = element.type;
                territory.ID_House = element.owner;
            }
            else
            {
                territory = null;
            }

            return(territory);
        }
Esempio n. 4
0
 public EntitiesLayer.Territory MajTerritory(EntitiesLayer.Territory te)
 {
     throw new System.NotImplementedException();
 }
Esempio n. 5
0
        public void UpdateTerritory(EntitiesLayer.Territory territory)
        {
            DataAccessLayer.DALManager manager = DataAccessLayer.DALManager.Instance;

            manager.DALServer.UpdateTerritory(territory);
        }