public static void modificarCantidad(int idRefaccion, int Cantidad) { RefaccionEntity refaccion = getRefaccionPorID(idRefaccion); EntityTransaction entityTransaction = ConexionBD.getEm().getTransaction(); entityTransaction.begin(); refaccion.setIdRefaccion(idRefaccion); refaccion.setCantidad(Cantidad); entityTransaction.commit(); }
public static void modificarMarca(int idRefaccion, String marca) { RefaccionEntity refaccion = getRefaccionPorID(idRefaccion); EntityTransaction entityTransaction = ConexionBD.getEm().getTransaction(); entityTransaction.begin(); refaccion.setIdRefaccion(idRefaccion); refaccion.setMarca(marca); entityTransaction.commit(); }
public static void modificarPrecio(int idRefaccion, BigDecimal Precio) { RefaccionEntity refaccion = getRefaccionPorID(idRefaccion); EntityTransaction entityTransaction = ConexionBD.getEm().getTransaction(); entityTransaction.begin(); refaccion.setIdRefaccion(idRefaccion); refaccion.setPrecio(Precio); entityTransaction.commit(); }
public static RefaccionEntity crearRefaccion( int IDRefaccion, String Marca, BigDecimal Precio, int Cantidad) { RefaccionEntity refaccion = new RefaccionEntity(); refaccion.setIdRefaccion(IDRefaccion); refaccion.setMarca(Marca); refaccion.setPrecio(Precio); refaccion.setCantidad(Cantidad); ConexionBD.getEm().persist(refaccion); return refaccion; }