public static bool Guardar(GruposEstudiantes student) { bool retorno = false; try { CursoDb db = new CursoDb(); db.GrpEst.Add(student); db.SaveChanges(); retorno = true; } catch (Exception) { throw; } return(retorno); }
public static bool Eliminar(GruposEstudiantes existente) { bool resultado = false; using (var conexion = new DetallesDB()) { try { conexion.Entry(existente).State = EntityState.Deleted; conexion.SaveChanges(); resultado = true; } catch (Exception) { throw; } } return(resultado); }
public static bool Insertar(GruposEstudiantes Nuevo) { bool resultado = false; var conexion = new DetallesDB(); //using () //{ try { conexion.GrupoEstudiante.Add(Nuevo); conexion.SaveChanges(); resultado = true; } catch (Exception e) { MessageBox.Show(e.ToString()); //throw; } // } return(resultado); }