//Eliminar admin public static void DeleteAdmin(ADMINS admin) { ORM.bd.ADMINS.Remove(admin); try { ORM.bd.SaveChanges(); } catch (DbUpdateException ex) { SqlException sqlEx = (SqlException)ex.InnerException.InnerException; } }
//Agregar nuaevos admins public static void InsertAdmin(String nom, String password, String correu) { ADMINS admin = new ADMINS(); admin.nombre = nom; admin.password = password; admin.correu = correu; ORM.bd.ADMINS.Add(admin); try { ORM.bd.SaveChanges(); } catch (Exception) { //Mirar practica control de errores } }