Exemplo n.º 1
0
        public static bool Guardar(Grupos std)
        {
            bool retorno = false;

            try
            {
                CursoDb db = new CursoDb();
                db.Grupos.Add(std);
                db.SaveChanges();
                retorno = true;
            }
            catch (Exception)
            {
                throw;
            }
            return(retorno);
        }
Exemplo n.º 2
0
        public static bool Guardar(Estudiantes student)
        {
            bool retorno = false;

            try
            {
                CursoDb db = new CursoDb();
                db.Estudiante.Add(student);
                db.SaveChanges();

                retorno = true;
            }
            catch (Exception)
            {
                throw;
            }
            return(retorno);
        }
Exemplo n.º 3
0
        public static bool Eliminar(int id)
        {
            bool retorno = false;

            try
            {
                using (CursoDb db = new CursoDb())
                {
                    Grupos user = (from c in db.Grupos where c.GrupoId == id select c).FirstOrDefault();
                    db.Grupos.Remove(user);
                    db.SaveChanges();
                    retorno = true;
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(retorno);
        }