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(); }
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(); }
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); }
public EntitiesLayer.Territory MajTerritory(EntitiesLayer.Territory te) { throw new System.NotImplementedException(); }
public void UpdateTerritory(EntitiesLayer.Territory territory) { DataAccessLayer.DALManager manager = DataAccessLayer.DALManager.Instance; manager.DALServer.UpdateTerritory(territory); }