public bool Delete() { try { DALC.Team team = CommonBC.SystemLeagueEntities.Team.First(t => t.Id == Id); CommonBC.SystemLeagueEntities.Team.Remove(team); CommonBC.SystemLeagueEntities.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public bool Update() { try { DALC.Team team = CommonBC.SystemLeagueEntities.Team.First(t => t.Id == Id); team.Nombre = Nombre; team.IdLiga = IdLiga; CommonBC.SystemLeagueEntities.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public bool Read() { try { DALC.Team team = CommonBC.SystemLeagueEntities.Team.First(t => t.Id == Id); Id = team.Id; Nombre = team.Nombre; IdLiga = team.IdLiga; CommonBC.SystemLeagueEntities.Team.Add(team); return(true); } catch (Exception) { return(false); } }
//crud public bool Create() { try { DALC.Team team = new DALC.Team(); team.Id = Id; team.Nombre = Nombre; team.IdLiga = IdLiga; CommonBC.SystemLeagueEntities.Team.Add(team); CommonBC.SystemLeagueEntities.SaveChanges(); return(true); } catch (Exception) { return(false); } }