
// 
function Clase_BO(){
	   // productos
	   this.bodega = new Clase_Vector();
	   this.addProducto = addProducto;
	   this.getProducto = getProducto;
	   this.getNProductos = getNProductos;
	   
	   this.id_bodega = null;
	   this.nombre = null;
	   this.descripcion = null;
	   this.descripcion_en = null;
	   this.imagen = null;
	   this.enlace = null;
	   this.denominacion_bodega = null;
	   
	   
	   this.getIdBodega = getIdBodega;
	   this.setIdBodega = setIdBodega;
	   
	   this.getNombre = getNombre;
	   this.setNombre = setNombre;
	   
	   this.getDescripcion = getDescripcion;
	   this.setDescripcion = setDescripcion;
	   
	   this.getDescripcionEn = getDescripcionEn;
	   this.setDescripcionEn = setDescripcionEn;
	   
	   this.getImagen = getImagen;
	   this.setImagen = setImagen;
	   
	   this.getEnlace = getEnlace;
	   this.setEnlace = setEnlace;
	   
	   this.getDenominacionBodega = getDenominacionBodega;
	   this.setDenominacionBodega = setDenominacionBodega;
}
	
// Se recupera el numero inventario del producto i
function getProducto(i){
	var obj = new Clase_Producto();
	obj = this.bodega.getIndexValue(i);
	return obj;
}

// Añade en la colección un nuevo producto
function addProducto(id_producto,tipo, nombre_producto,variedades, crianza, grado, produccion, formato, descripcion_producto, descripcion_producto_en,maridaje,temperatura_consumo,imagen,enlace, cata, premios, envejecimiento, madurez){
	//alert("id_producto: "+id_producto+",Tipo: "+tipo+",Nombre: "+nombre_producto+", Variedades: "+variedades+",Crianza: "+crianza+",Grado: "+grado);
	var obj = new Clase_Producto();
	obj.setIdProducto(id_producto);
	obj.setTipo(tipo);
	obj.setNombreProducto(nombre_producto);
	obj.setVariedades(variedades);
	obj.setCrianza(crianza);
	obj.setGrado(grado);
	obj.setProduccion(produccion);
	obj.setFormato(formato);
	obj.setDescripcionProducto(descripcion_producto);
	obj.setDescripcionProductoEn(descripcion_producto_en);
	obj.setMaridaje(maridaje);
	obj.setTemperatura(temperatura_consumo);
	obj.setImagen(imagen);
	obj.setEnlace(enlace);
	obj.setCata(cata);
	obj.setEnvejecimiento(envejecimiento);
	obj.setPremios(premios);
	obj.setMadurez(madurez);
	this.bodega.addIndexValue(obj);
}


function getNProductos(){
	return this.bodega.getNumberElements();
}


function getIdBodega(){
	return this.id_bodega;
}
function setIdBodega(valor){
	this.id_bodega = valor;
}

function getNombre(){
	return this.nombre;
}
function setNombre(valor){
	this.nombre = valor;
}

function getDescripcion(){
	return this.descripcion;
}
function setDescripcion(valor){
	this.descripcion = valor;
}

function getDescripcionEn(){
	return this.descripcion_en;
}
function setDescripcionEn(valor){
	this.descripcion_en = valor;
}

function getImagen(){
	return this.imagen;
}
function setImagen(valor){
	this.imagen = valor;
}

function getEnlace(){
	return this.enlace;
}
function setEnlace(valor){
	this.enlace = valor;
}

function getDenominacionBodega(){
	return this.denominacion_bodega;
}
function setDenominacionBodega(valor){
	this.denominacion_bodega = valor;
}

