コード例 #1
0
ファイル: GruposBll.cs プロジェクト: Yinet97/Detail
        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);
        }
コード例 #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);
        }
コード例 #3
0
ファイル: GruposBll.cs プロジェクト: Yinet97/Detail
        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);
        }