Beispiel #1
0
        public static void AgregarDeseo(string idProducto)
        {
            var Current        = HttpContext.Current;
            var logueadoStatic = (UsuarioEntidad)Current.Session["Usuario"];
            List <ListaDeseoEntidad> listaDeseosSesion  = new List <ListaDeseoEntidad>();
            List <ProductoEntidad>   unaListaProductos  = new List <ProductoEntidad>();
            ListaDeseosCore          unaListaDeseosCore = new ListaDeseosCore();
            ListaDeseoEntidad        unaListaDeseo      = new ListaDeseoEntidad();
            ProductoCore             unProductoCore     = new ProductoCore();

            unaListaProductos = (List <ProductoEntidad>)Current.Session["ListaDeseos"];

            unaListaDeseo.CUIT          = ConfigSection.Default.Site.Cuit;
            unaListaDeseo.NombreUsuario = logueadoStatic.NombreUsuario;
            unaListaDeseo.IdProducto    = Int32.Parse(idProducto);

            var cotizacionStatic = (MonedaEmpresaEntidad)Current.Session["Cotizacion"];

            //Guardar en BD el nuevo deseo
            if (unaListaDeseosCore.ListaDeseosInsert(unaListaDeseo) > 0)
            {
                //Agregar el deseo a la sesión actual
                ProductoEntidad unProductoEntidad = new ProductoEntidad();
                // unProductoEntidad = unProductoCore.Find(unaListaDeseo.IdProducto, 1);
                unProductoEntidad = unProductoCore.Find(unaListaDeseo.IdProducto, cotizacionStatic.IdMoneda);
                unaListaProductos.Add(unProductoEntidad);
                Current.Session["ListaDeseos"] = unaListaProductos;
            }
        }
Beispiel #2
0
        public static void AgregarDeseo(string idProducto)
        {
            var Current        = HttpContext.Current;
            var logueadoStatic = (UsuarioEntidad)Current.Session["Usuario"];
            List <ListaDeseoEntidad> listaDeseosSesion  = new List <ListaDeseoEntidad>();
            List <ProductoEntidad>   unaListaProductos  = new List <ProductoEntidad>();
            ListaDeseosCore          unaListaDeseosCore = new ListaDeseosCore();
            ListaDeseoEntidad        unaListaDeseo      = new ListaDeseoEntidad();
            ProductoCore             unProductoCore     = new ProductoCore();

            unaListaProductos = (List <ProductoEntidad>)Current.Session["ListaDeseos"];

            unaListaDeseo.CUIT          = logueadoStatic.CUIT;
            unaListaDeseo.NombreUsuario = logueadoStatic.NombreUsuario;
            unaListaDeseo.IdProducto    = Int32.Parse(idProducto);
            var cotizacion = new MonedaEmpresaEntidad();

            cotizacion = (MonedaEmpresaEntidad)Current.Session["Productos"];
            //Guardar en BD el nuevo deseo
            if (unaListaDeseosCore.ListaDeseosInsert(unaListaDeseo) > 0)
            {
                //Agregar el deseo a la sesión actual
                //List<ListaDeseoEntidad> unasListaDeseoEntidad = new List<ListaDeseoEntidad>();
                //unasListaDeseoEntidad = unaListaDeseosCore.ListaDeseosSelectAllByCUIT_NombreUsuario(logueadoStatic.NombreUsuario);

                //foreach (var item in unasListaDeseoEntidad)
                //{
                ProductoEntidad unProductoEntidad = new ProductoEntidad();
                unProductoEntidad = unProductoCore.Find(unaListaDeseo.IdProducto, 1);
                unaListaProductos.Add(unProductoEntidad);
                //}
                //listaDeseosSesion.Add(unaListaDeseo);
                Current.Session["ListaDeseos"] = unaListaProductos;
                //ActualizarDeseos();
            }
        }