Esempio n. 1
0
        public ActionResult Index()
        {
            if (Session["USER_DATA"] != null)
            {
                Dictionary <String, Object> user_data = (Dictionary <String, Object>)Session["USER_DATA"];
                if (!bool.Parse(user_data["IsAuth"].ToString()))
                {
                    return(Redirect("~/Home/Index/"));
                }
                else
                if (!user_data["RolName"].ToString().Equals("Administrador"))
                {
                    return(Redirect("~/Home/Index/"));
                }
            }
            else
            {
                return(Redirect("~/Home/Index/"));
            }

            ViewBag.Tarifas = Tarifas.GetTarifasList();
            return(View());
        }
        public ActionResult Update(String envioId)
        {
            if (Session["USER_DATA"] != null)
            {
                Dictionary <String, Object> user_data = (Dictionary <String, Object>)Session["USER_DATA"];
                if (!bool.Parse(user_data["IsAuth"].ToString()))
                {
                    return(Redirect("~/Home/Index/"));
                }
                else
                if (!user_data["RolName"].ToString().Equals("Operador"))
                {
                    return(Redirect("~/Home/Index/"));
                }
            }
            else
            {
                return(Redirect("~/Home/Index/"));
            }

            ViewBag.Paquete = Paquetes.GetEnvioInfoById(int.Parse(envioId));
            ViewBag.Tarifas = Tarifas.GetTarifasList();
            ViewBag.Estados = Paquetes.GetListEstadosPack();

            ArrayList deliveyUsers = Usuarios.GetDeliveryUser();

            if (deliveyUsers.Count != 0)
            {
                ViewBag.Mensajeros = deliveyUsers;
            }
            else
            {
                ViewBag.Mensajeros = new ArrayList();
            }

            return(View());
        }