protected void Button1_Click(object sender, EventArgs e)
        {
            Factura factura = carrito.GenerarFactura();



            // set dir
            if ((DropDownListDelivery.SelectedValue == "0") || (DropDownListDelivery.SelectedValue == "1" && DropDownMetodo.SelectedValue == "0"))
            {
                factura.dir = usuario.direccion;
            }
            else if (DropDownListDelivery.SelectedValue == "1")
            {
                factura.dir = TextFacDir.Text;
            }
            else
            {
                factura.dir = TextOtherAdress.Text;
            }
            // set paymode

            if (DropDownMetodo.SelectedValue == "0")
            {
                factura.modoDePago = 'E';
            }
            else
            {
                factura.modoDePago = 'T';
            }
            factura.codigoUsuario = usuario.code;
            factura.fecha         = DateTime.Now;
            if (factura.modoDePago == 'E')
            {
                factura.pago = false;
            }
            else
            {
                factura.pago = true;
            }
            factura.estadoEntrega = 0;
            facturaBusiness.GenerarCompra(factura);
            if (CheckBoxCredito.Checked == true)
            {
                usuarioBusiness.creditTransaction(-availableCredits, usuario.code);
            }
            Session["chart"] = new Carrito();
            Response.Redirect("OrdenHecha.aspx");
        }