Пример #1
0
 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);
     }
 }
Пример #2
0
 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);
     }
 }
Пример #3
0
 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);
     }
 }
Пример #4
0
        //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);
            }
        }