Esempio n. 1
0
        public string getHeadMenuStr3(string menuCodeList)
        {
            string PageCode = Request.Params["PageCode"];//调用方法
            var    result   = T_SYS_MENUCls.getT_SYS_MENUModel(new T_SYS_MENU_SW {
                UID = SystemCls.getUserID(), SYSFLAG = ConfigCls.getSystemFlag()
            });
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("<ul class='nav ace-nav'>");
            sb.AppendFormat("<li class='light-blue'>");
            sb.AppendFormat("<a  href='{0}' class='dropdown-toggle'>", ConfigCls.getLoginRedirectUrl());
            sb.AppendFormat("<i class='{0}' style='width:25px; {1}'></i>", "fa fa-wrench", "color:#ff0000;");
            sb.AppendFormat("{0}", "返回首页");
            sb.AppendFormat("</a>");
            sb.AppendFormat("</li>");
            foreach (var v in result)
            {
                if (menuCodeList.Contains("," + v.MENUCODE + ","))
                {
                    var subResult = v.subMenuModel;
                    foreach (var sv in subResult)
                    {
                        sb.AppendFormat("<li>");

                        sb.AppendFormat("<a href='{0}'>", sv.MENUURL);
                        sb.AppendFormat("<i class='{0}' style='width:25px; {1}'></i>", sv.MENUICO, sv.LICLASS);
                        sb.AppendFormat("{0}", sv.MENUNAME);
                        if (string.IsNullOrEmpty(sv.showCount) == false)
                        {
                            sb.AppendFormat("<span class='badge badge-important'>{0}</span>", sv.showCount);
                        }
                        sb.AppendFormat("</a>");
                        sb.AppendFormat("</li>");
                    }
                }
            }
            sb.AppendFormat("<li class='light-blue'>");
            sb.AppendFormat("<a data-toggle='dropdown' href='#' class='dropdown-toggle'>");
            sb.AppendFormat("      <img class='nav-user-photo' src='../Content/themes/assets/avatars/user.jpg' alt='Jason's Photo' />");
            sb.AppendFormat("      <span class='user-info'>");
            sb.AppendFormat("          <small>欢迎光临,</small>");
            CookieModel cookieInfo = SystemCls.getCookieInfo();

            sb.AppendFormat("          <font color='red'>{0}</font>", cookieInfo.trueName);
            sb.AppendFormat("      </span>");
            sb.AppendFormat("<i class='icon-caret-down'></i>");
            sb.AppendFormat("          </a>");
            sb.AppendFormat("<ul class='user-menu pull-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close'>");
            sb.AppendFormat("      <li class='divider'></li>");
            sb.AppendFormat("      <li>");
            sb.AppendFormat("          <a href='/System/LoginOut'>");
            sb.AppendFormat("              <i class='fa fa-power-off'></i>");
            sb.AppendFormat("              退出");
            sb.AppendFormat("          </a>");
            sb.AppendFormat("      </li>");
            sb.AppendFormat("</ul>");
            sb.AppendFormat("</li>");
            sb.AppendFormat("</ul>");
            return(sb.ToString());
        }
        //
        // GET: /Interface/

        public ActionResult SystemRedirect()
        {
            SystemCls.ClearLoginState();
            string uid = Request.Params["uid"];

            if (string.IsNullOrEmpty(uid))
            {
                ViewBag.logined = "自动登录失败";
            }
            else
            {
                T_SYSSEC_IPSUSER_Model m = T_SYSSEC_IPSUSERCls.getModel(new T_SYSSEC_IPSUSER_SW {
                    USERID = uid
                });

                CookieModel cookieM = new CookieModel();
                if (m != null)
                {
                    if (string.IsNullOrEmpty(m.USERID))
                    {
                        ViewBag.logined = "自动登录失败";
                    }
                    else
                    {
                        cookieM.UID      = m.USERID;
                        cookieM.userName = m.LOGINUSERNAME;
                        cookieM.trueName = m.USERNAME;
                        cookieM.SaveType = "true";
                        SystemCls.SaveLoginState(cookieM);
                        ViewBag.logined = "<script language=\"javascript\">window.location.href = '" + ConfigCls.getLoginRedirectUrl(m.USERID) + "';</script>";
                    }
                }
                else
                {
                    ViewBag.logined = "自动登录失败";
                }
            }
            return(View());
        }
Esempio n. 3
0
        public string getHeadMenuStr1(string menuCodeList)
        {
            //string str=SystemCls.getT_SYS_DEFINEMENU(new T_SYS_MENU_SW { UID =SystemCls.getUserID(), SYSFLAG = ConfigCls.getSystemFlag() });;
            string loadFunc = Request.Params["loadFunc"]; //调用方法
            string Method   = Request.Params["Method"];   //调用方法
            string TID      = Request.Params["TID"];      //调用方法
            string PageCode = Request.Params["PageCode"]; //调用方法
            var    result   = T_SYS_MENUCls.getT_SYS_MENUModel(new T_SYS_MENU_SW {
                UID = SystemCls.getUserID(), SYSFLAG = ConfigCls.getSystemFlag()
            });
            StringBuilder sb     = new StringBuilder();
            bool          blnMp3 = false;

            sb.AppendFormat("<ul class='nav ace-nav'>");
            sb.AppendFormat("<li class='light-blue'>");
            sb.AppendFormat("<a href='{0}' class='dropdown-toggle'>", ConfigCls.getLoginRedirectUrl());
            sb.AppendFormat("<i class='{0}' style='width:25px; {1}'></i>", "fa fa-wrench", "color:#ff0000;");
            sb.AppendFormat("{0}", "返回首页");
            sb.AppendFormat("</a>");
            sb.AppendFormat("</li>");
            foreach (var v in result)
            {
                if (menuCodeList.Contains("," + v.MENUCODE + ","))
                {
                    sb.AppendFormat("<li class='light-blue'>");
                    sb.AppendFormat("<a data-toggle='dropdown' href='#' class='dropdown-toggle'>");
                    sb.AppendFormat("<i class='{0}' style='width:25px; {1}'></i>", v.MENUICO, v.LICLASS);
                    sb.AppendFormat("{0}", v.MENUNAME);
                    sb.AppendFormat("<span class='badge badge-important'>{0}</span>", v.showCount);
                    sb.AppendFormat("<i class='icon-caret-down'></i>");
                    sb.AppendFormat("</a>");
                    sb.AppendFormat("<ul class='user-menu pull-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close'>");
                    var subResult = v.subMenuModel;
                    foreach (var sv in subResult)
                    {
                        sb.AppendFormat("<li>");
                        string codelist = ",001,002,003,";
                        //string a = sv.MENUCODE.Substring(0, 3);
                        if (string.IsNullOrEmpty(loadFunc) == false && codelist.Contains("," + sv.MENUCODE.Substring(0, 3) + ",") && codelist.Contains("," + PageCode.Substring(0, 3) + ","))
                        {
                            string func = "";
                            if (sv.MENUCODE == "001002")
                            {
                                func = "GetDmFun()";//点名管理
                            }
                            else if (sv.MENUCODE == "001004")
                            {
                                func = "getAlarm(\"0\")";//报警管理
                            }
                            else if (sv.MENUCODE == "001005")
                            {
                                func = "GetElecFun()";//电量管理
                            }
                            else if (sv.MENUCODE == "001003")
                            {
                                func = "getHot(\"0\")";                    //热点管理
                            }
                            else if (sv.MENUCODE.Substring(0, 3) == "002") //上报
                            {
                                func = "getReport(\"" + sv.TID + "\",\"0\",\"" + sv.MENUNAME + "\")";
                            }
                            else if (sv.MENUCODE.Substring(0, 3) == "003")//采集
                            {
                                func = "getCollect(\"" + sv.TID + "\",\"0\",\"" + sv.MENUNAME + "\")";
                            }
                            else
                            {
                                func = "getLonLat(\"\")";
                            }

                            sb.AppendFormat("<a href='#' onclick='({0})'>", func);
                            sb.AppendFormat("<i class='{0}' style='width:25px; {1}'></i>", sv.MENUICO, sv.LICLASS);
                            sb.AppendFormat("{0}", sv.MENUNAME);
                            if (string.IsNullOrEmpty(sv.showCount) == false)
                            {
                                sb.AppendFormat("<span class='badge badge-important'>{0}</span>", sv.showCount);
                            }
                            sb.AppendFormat("</a>");
                        }
                        else
                        {
                            sb.AppendFormat("<a href='{0}'>", sv.MENUURL);
                            sb.AppendFormat("<i class='{0}' style='width:25px; {1}'></i>", sv.MENUICO, sv.LICLASS);
                            sb.AppendFormat("{0}", sv.MENUNAME);
                            if (string.IsNullOrEmpty(sv.showCount) == false)
                            {
                                sb.AppendFormat("<span class='badge badge-important'>{0}</span>", sv.showCount);
                            }
                            sb.AppendFormat("</a>");
                        }
                        sb.AppendFormat("</li>");
                        if (string.IsNullOrEmpty(sv.showCount) == false)
                        {
                            blnMp3 = true;
                        }
                    }
                    sb.AppendFormat("      <li class='divider'></li>");
                    sb.AppendFormat("</ul>");
                    sb.AppendFormat("</li>");
                }
            }
            sb.AppendFormat("<li class='light-blue'>");
            sb.AppendFormat("<a data-toggle='dropdown' href='#' class='dropdown-toggle'>");
            sb.AppendFormat("      <img class='nav-user-photo' src='../Content/themes/assets/avatars/user.jpg' alt='Jason's Photo' />");
            sb.AppendFormat("      <span class='user-info'>");
            sb.AppendFormat("          <small>欢迎光临,</small>");
            CookieModel cookieInfo = SystemCls.getCookieInfo();

            sb.AppendFormat("          <font color='red'>{0}</font>", cookieInfo.trueName);
            sb.AppendFormat("      </span>");
            sb.AppendFormat("<i class='icon-caret-down'></i>");
            sb.AppendFormat("</a>");
            sb.AppendFormat("<ul class='user-menu pull-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close'>");
            foreach (var v in result)
            {
                string codeStr = ",006,007,";
                if (codeStr.Contains("," + v.MENUCODE + ","))
                {
                    sb.AppendFormat("      <li class='divider'></li>");
                    var subResult = v.subMenuModel;
                    foreach (var sv in subResult)
                    {
                        sb.AppendFormat("<li>");
                        sb.AppendFormat("<a href='{0}'>", sv.MENUURL);
                        sb.AppendFormat("<i class='{0}' style='width:25px; {1}'></i>", sv.MENUICO, sv.LICLASS);
                        sb.AppendFormat("{0}", sv.MENUNAME);
                        sb.AppendFormat("<span class='badge badge-important'>{0}</span>", sv.showCount);
                        sb.AppendFormat("</a>");
                        sb.AppendFormat("</li>");
                    }
                }
            }
            sb.AppendFormat("      <li class='divider'></li>");
            sb.AppendFormat("      <li>");
            sb.AppendFormat("          <a href='/System/LoginOut'>");
            sb.AppendFormat("              <i class='fa fa-power-off'></i>");
            sb.AppendFormat("              退出");
            sb.AppendFormat("          </a>");
            sb.AppendFormat("      </li>");
            sb.AppendFormat("</ul>");
            sb.AppendFormat("</li>");
            sb.AppendFormat("</ul>");
            if (blnMp3 == true)
            {
                sb.AppendFormat("    <audio autoplay='autoplay'>        <source src='/Content/albram.mp3' type='audio/mpeg'>    </audio>");
            }
            string str = sb.ToString();

            str = str.Replace("<i class='", "<i class='fa-1x ");
            return(str);
        }