//Metoda pro cetni z databaze pro Hlavni budovu public void Connect_hl(int id) { using (Game_dataEntities context = new Game_dataEntities()) { Hlavni_budova hl = context.Hlavni_budova.FirstOrDefault(r => r.Id == id); Bd = new Hlavni_budov(hl.Id, hl.Cena, hl.Info, hl.Nazev); } }
public Profil(string jmeno, Hlavni_budov Hl) : base(jmeno) { hl = Hl; }
public Profil(string jmeno, int id) : base(jmeno) { cn.Connect_hl(id); hl = cn.Bd; }
//Konstruktory public Connect() { this.Bd = bd; }