Esempio n. 1
0
        public void UpdateCharacter(EntitiesLayer.Character ch)
        {
            DataAccessLayer.ThronesTournamentEntities bdd = new ThronesTournamentEntities();
            Character objEntity = bdd.Characters.FirstOrDefault(c => c.Id == ch.ID);

            objEntity.lastName  = ch.LastName;
            objEntity.firstName = ch.FirstName;
            objEntity.pv        = ch.PV;
            objEntity.bravoury  = ch.Bravoury;
            objEntity.crazyness = ch.Crazyness;

            bdd.SaveChanges();
        }
Esempio n. 2
0
        public void AddCharacter(EntitiesLayer.Character character)
        {
            DataAccessLayer.ThronesTournamentEntities bdd = new ThronesTournamentEntities();

            var newChar = new Character();

            newChar.lastName   = character.LastName;
            newChar.firstName  = character.FirstName;
            newChar.bravoury   = character.Bravoury;
            newChar.crazyness  = character.Crazyness;
            newChar.house_char = character.ID_House;
            newChar.pv         = character.PV;

            bdd.Characters.Add(newChar);

            bdd.SaveChanges();
        }
Esempio n. 3
0
        private EntitiesLayer.Character ConvertToCharacter(Character element)
        {
            EntitiesLayer.Character c = new EntitiesLayer.Character();

            if (element != null)
            {
                c.ID        = element.Id;
                c.Bravoury  = element.bravoury;
                c.Crazyness = element.crazyness;
                c.FirstName = element.firstName;
                c.LastName  = element.lastName;
                c.ID_House  = (int)element.house_char;
                c.PV        = element.pv;
            }
            else
            {
                c = null;
            }

            return(c);
        }
Esempio n. 4
0
 public EntitiesLayer.Character MajCharacter(EntitiesLayer.Character ch)
 {
     throw new System.NotImplementedException();
 }
Esempio n. 5
0
 private EntitiesLayer.Character GetCharacter(DataAccessLayer.Characters chr)
 {
     EntitiesLayer.Character ch = new EntitiesLayer.Character(chr.firstname, chr.lastname, chr.pv.Value, chr.bravoury.Value, chr.crazyness.Value);
     return(ch);
 }
Esempio n. 6
0
 public void AddRelation(Character Character, RelationType Relation)
 {
     Relations.Add(new Relation(Character, Relation));
 }
Esempio n. 7
0
        public void AddCharacter(EntitiesLayer.Character character)
        {
            DataAccessLayer.DALManager manager = DataAccessLayer.DALManager.Instance;

            manager.DALServer.AddCharacter(character);
        }
Esempio n. 8
0
 public Territory(TerritoryType TerritoryType, Character Owner)
 {
     this.TerritoryType = TerritoryType;
     this.Owner         = Owner;
 }