Ejemplo n.º 1
0
        //
        // GET: /Home/

        public ActionResult Index()
        {
            string configData = SysVisitor.Instance.CurrentUser.ConfigJson;

            string          themePath = Server.MapPath("~/Content/theme/navtype/");
            NVelocityHelper vel       = new NVelocityHelper(themePath);

            vel.Put("username", SysVisitor.Instance.CurrentUser.TrueName);
            string navHTML = "Accordion.html";

            if (!string.IsNullOrEmpty(configData))
            {
                ConfigModel sysconfig = JSONhelper.ConvertToObject <ConfigModel>(configData);
                if (sysconfig != null)
                {
                    switch (sysconfig.ShowType)
                    {
                    case "menubutton":
                        navHTML = "menubutton.html";
                        break;

                    case "tree":
                        navHTML = "tree.html";
                        break;

                    case "menuAccordion":
                    case "menuAccordion2":
                    case "menuAccordionTree":
                        navHTML = "topandleft.html";
                        break;

                    default:
                        navHTML = "Accordion.html";
                        break;
                    }
                }
            }

            ViewBag.NavContent = vel.FileToString(navHTML);

            //============APP用户总数================
            ViewBag.AppCount = 0;// DriverUserDal.Instance.GetAppCount();

            //============订单签收总数================
            ViewBag.SignCount = 0;// SignDal.Instance.GetCount("");


            //系统更新日志
            int pdateLogCount;

            ViewBag.UpdateLogList  = SYS_UPDATELOGBLL.Instance.GetPageWithRecordCount(1, 3, out pdateLogCount);
            ViewBag.UpdateLogCount = pdateLogCount;

            return(View());
        }
Ejemplo n.º 2
0
        private string GetContent()
        {
            string content    = "";
            string configData = CurrentUser.ConfigJson;

            string          themePath = Server.MapPath("~/content/theme/navtype/");
            NVelocityHelper vel       = new NVelocityHelper(themePath);

            vel.Put("welcome", Lang.welcome);
            vel.Put("username", CurrentUser.UserTrueName);
            vel.Put("update_pwd", Lang.update_pwd);
            vel.Put("logout", Lang.logout);
            vel.Put("system_name", Lang.system_name);
            vel.Put("nav_menu", Lang.nav_menu);
            string navHTML = "Accordion.html";

            if (!string.IsNullOrEmpty(configData))
            {
                ConfigModel sysconfig = Newtonsoft.Json.JsonConvert.DeserializeObject <ConfigModel>(configData);
                if (sysconfig != null)
                {
                    switch (sysconfig.ShowType)
                    {
                    case "menubutton":
                        navHTML = "menubutton.html";
                        break;

                    case "tree":
                        navHTML = "tree.html";
                        break;

                    case "menuAccordion":
                    case "menuAccordion2":
                    case "menuAccordionTree":
                        navHTML = "topandleft.html";
                        break;

                    default:
                        navHTML = "Accordion.html";
                        break;
                    }
                }
            }

            content = vel.FileToString(navHTML);
            return(content);
        }
Ejemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string configData = SysVisitor.Instance.CurrentUser.ConfigJson;

            string          themePath = Server.MapPath("theme/navtype/");
            NVelocityHelper vel       = new NVelocityHelper(themePath);

            vel.Put("username", UserName);
            string navHTML = "Accordion.html";

            if (!string.IsNullOrEmpty(configData))
            {
                ConfigModel sysconfig = JSONhelper.ConvertToObject <ConfigModel>(configData);
                if (sysconfig != null)
                {
                    switch (sysconfig.ShowType)
                    {
                    case "menubutton":
                        navHTML = "menubutton.html";
                        break;

                    case "tree":
                        navHTML = "tree.html";
                        break;

                    case "menuAccordion":
                    case "menuAccordion2":
                    case "menuAccordionTree":
                        navHTML = "topandleft.html";
                        break;

                    default:
                        navHTML = "Accordion.html";
                        break;
                    }
                }
            }

            NavContent = vel.FileToString(navHTML);
        }