Ejemplo n.º 1
0
 public TipoAlimento(int idTipoAlimento) {
   TipoAlimentoDB tipoDB = new TipoAlimentoDB();
   TipoAlimento aux = tipoDB.cargarTipoAlimento(idTipoAlimento);
   this.idTipoAlimento = aux.getIdTipoAlimento();
   this.nombre = aux.getNombre();
   this.descripcion = aux.getDescipcion();
   this.gramosGrasas = aux.getGramosGrasas();
   this.gramosHC = aux.getGramosHC();
   this.gramosProteinas = aux.getGramosProteinas();
 }
Ejemplo n.º 2
0
 public int eliminar() {
   TipoAlimentoDB tipoDB = new TipoAlimentoDB();
   return tipoDB.eliminarTipoAlimento(this);
 }
Ejemplo n.º 3
0
 public boolean grabar() {
   TipoAlimentoDB tipoDB = new TipoAlimentoDB();
   if (this.getIdTipoAlimento() > 0) return tipoDB.modificarTipoAlimento(this);
   else return tipoDB.grabarTipoAlimento(this);
 }