public ActionResult AgregarInventario(string tipodir)
        {
            List <estante> produEsta = new List <estante>();
            estante        esta      = null;

            if (TempData.ContainsKey("NotificationMessage"))
            {
                ViewBag.NotificationMessage = TempData["NotificationMessage"];
            }

            ViewBag.DetalleCarrito = Carrito.Instancia.Items;
            ViewBag.idProveedores  = listaproveedor();
            ViewBag.idTienda       = listaTiendas();

            foreach (var producto in Carrito.Instancia.Items)
            {
                foreach (var estante in producto.Producto.productoEstante)
                {
                    esta = serviseEstante.obtenerEstantePorID(estante.idEstante);

                    if (!produEsta.Where(x => x.id == esta.id).Any())
                    {
                        produEsta.Add(serviseEstante.obtenerEstantePorID(estante.idEstante));
                    }
                }
            }

            ViewBag.idEstante = listaEstantePersonal(produEsta);

            return(View());
        }
Exemple #2
0
 public venta(float total, List <producto> productos, estante ubicacion)
 {
     generarNumero();
     this.serie     = "v0032";
     this.total     = total;
     this.ubicacion = ubicacion;
     this.productos = productos;
 }
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            estante estante = await db.estante.FindAsync(id);

            db.estante.Remove(estante);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
        public async Task <ActionResult> Edit([Bind(Include = "id_estante,n_estante,id_categoria")] estante estante)
        {
            if (ModelState.IsValid)
            {
                db.Entry(estante).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewBag.id_categoria = new SelectList(db.Categoria, "id_categoria", "Nombre_categoria", estante.id_categoria);
            return(View(estante));
        }
        // GET: estantes/Details/5
        public async Task <ActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            estante estante = await db.estante.FindAsync(id);

            if (estante == null)
            {
                return(HttpNotFound());
            }
            return(View(estante));
        }
        // GET: estantes/Edit/5
        public async Task <ActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            estante estante = await db.estante.FindAsync(id);

            if (estante == null)
            {
                return(HttpNotFound());
            }
            ViewBag.id_categoria = new SelectList(db.Categoria, "id_categoria", "Nombre_categoria", estante.id_categoria);
            return(View(estante));
        }