public void BajaPlayer(Players p) { c = new GameModelContainer(); var a = c.PlayerSet.Where(k => k.Id == p.Id).Single(); c.PlayerSet.Remove(a); c.SaveChanges(); }
public void Comprar(int id, double fichas) { c = new GameModelContainer(); var original = c.PlayerSet.Find(id); if (original != null) { original.Fichas += fichas; original.Efectivo -= fichas; c.SaveChanges(); } }
public void Guardar(int id, int fichas, Boolean victoria) { c = new GameModelContainer(); var original = c.PlayerSet.Find(id); if (original != null) { original.Fichas += fichas; original.Jugadas++; if (victoria) { original.Victorias++; } c.SaveChanges(); } }
public void AltaPlayer(Players p) { c = new GameModelContainer(); c.PlayerSet.Add(p); c.SaveChanges(); }