Ejemplo n.º 1
0
        public ActionResult Correios()
        {
            var dicFormas = new Dictionary<int, string>
                                {
                                    {40010, "SEDEX"},
                                    {40045, "SEDEX a Cobrar"},
                                    {40126, "SEDEX a Cobrar"},
                                    {40215, "SEDEX 10"},
                                    {40290, "SEDEX Hoje"},
                                    {40096, "SEDEX"},
                                    {40436, "SEDEX"},
                                    {40444, "SEDEX"},
                                    {40568, "SEDEX"},
                                    {40606, "SEDEX"},
                                    {41106, "PAC"},
                                    {41068, "PAC"},
                                    {81019, "e-SEDEX"},
                                    {81027, "e-SEDEX Prioritário"},
                                    {81035, "e-SEDEX Express"},
                                    {81868, "(Grupo 1) e-SEDEX"},
                                    {81833, "(Grupo 2) e-SEDEX"},
                                    {81850, "(Grupo 3) e-SEDEX"}
                                };


            var correios = new EntregaService().GetListById(2).Select(m => m.Parametro).FirstOrDefault(m => m.Nome == "Códigos serviço Correios") ?? new Parametro();

            var formas = correios.Valor.Split(',').Select(int.Parse);

            dicFormas = dicFormas.Where(m => formas.Contains(m.Key)).ToDictionary(p => p.Key, p => p.Value);

            return View(dicFormas);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Returns a View with an existing TipoEntrega
        /// </summary>
        /// <returns></returns>
        public ActionResult Editar(int id)
        {
            var entrega = new EntregaService().GetListById(id);

            ViewBag.ListaParametros = entrega;

            return View();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Returns a partialList
        /// </summary>
        /// <param name="page"></param>
        /// <returns></returns>
        public ActionResult Listagem(int? page)
        {
            page = page ?? 1;
            var entregas = new EntregaService().GetByPage(page.Value);

            var list = new MvcList<Ecommerce_TipoEntrega>(entregas.Item1, page.Value, entregas.Item2, EnumerableExtensions.QuantityRegistersPerPage);

            return PartialView(list);
        }