Exemple #1
0
        public ActionResult Farmacos(string id, FormCollection collection, int page)
        {
            int      idFarmaco       = Convert.ToInt32(id);
            int      cantidad        = int.Parse(collection[("CantidadFarmaco_" + id)]);
            Farmacos farmacoAgregado = new Farmacos
            {
                id                 = Storage.Instance.listaFarmacos[(idFarmaco - 1)].id,
                nombreFarmaco      = Storage.Instance.listaFarmacos[(idFarmaco - 1)].nombreFarmaco,
                descripcionFarmaco = Storage.Instance.listaFarmacos[(idFarmaco - 1)].descripcionFarmaco,
                casaProductora     = Storage.Instance.listaFarmacos[(idFarmaco - 1)].casaProductora,
                precio             = Storage.Instance.listaFarmacos[(idFarmaco - 1)].precio,
                existencia         = Storage.Instance.listaFarmacos[(idFarmaco - 1)].existencia,
            };

            FarmacosPedidos farmacoPedido = new FarmacosPedidos
            {
                FarmacoPedido      = farmacoAgregado,
                cantidadSolicitada = cantidad
            };

            Storage.Instance.totalACancelar += farmacoPedido.calcularTotal();
            Storage.Instance.pedidosFarmacos.Add(farmacoPedido);

            var paginacionFarmacos = new paginacionFarmacos
            {
                BlogPerPage = 35,
                farmacos    = Storage.Instance.listaFarmacos,
                CurrentPage = page
            };

            return(View(paginacionFarmacos));
        }
Exemple #2
0
        public ActionResult Farmacos(int page = 1)
        {
            var paginacionFarmacos = new paginacionFarmacos
            {
                BlogPerPage = 35,
                farmacos    = Storage.Instance.listaFarmacos,
                CurrentPage = page
            };

            return(View(paginacionFarmacos));
        }