示例#1
0
        protected JsonData createlevel3json(string Ff_sonID)
        {
            JsonData list3Data = new JsonData();

            list3Data.SetJsonType(JsonType.Array);

            string sql_son = " Ff_ID =" + Ff_sonID + " order by Sf_sort";

            BLL.CCOM.Son_function Bsf = new BLL.CCOM.Son_function();
            var Sf_list = Bsf.GetModelList(sql_son);

            foreach (Model.CCOM.Son_function Sf in Sf_list)
            {
                BLL.CCOM.Role_permission apbll = new BLL.CCOM.Role_permission();
                var aplist = apbll.GetModelList("Sf_id =" + Sf.Sf_id + " and Role_id=" + user_info.Role_id);
                if (aplist.Count > 0)
                {
                    try
                    {
                        JsonData data = new JsonData();
                        data["id"]      = DESEncrypt.Encrypt(Sf.Sf_id.ToString());
                        data["type"]    = "S";
                        data["address"] = "/AdminMetro/" + Sf.Sf_url + "?fun_id=" + DESEncrypt.Encrypt(Sf.Sf_id.ToString()) + "";
                        data["name"]    = Sf.Sf_name;
                        list3Data.Add(data);
                        if (data["name"].ToString() == "查阅新闻")
                        {
                            this.funid_news = DESEncrypt.Encrypt(Sf.Sf_id.ToString());
                        }
                        if (data["name"].ToString() == "最新通知")
                        {
                            this.funid_notice = DESEncrypt.Encrypt(Sf.Sf_id.ToString());
                        }
                        if (data["name"].ToString() == "活动大厅")
                        {
                            this.funid_activity = DESEncrypt.Encrypt(Sf.Sf_id.ToString());
                        }
                        if (data["name"].ToString() == "投票")
                        {
                            this.funid_vote = DESEncrypt.Encrypt(Sf.Sf_id.ToString());
                        }
                    }
                    catch (Exception ex)
                    {
                        JscriptMsg("读取页面失败", "login_page.aspx", ex.Message);
                    }
                }
            }
            return(list3Data);
        }
示例#2
0
        private void ManagePage_Load(object sender, EventArgs e)
        {
            //return;

            //判断后台是否登录
            if (checkLogin && !IsAdminLogin())
            {
                Redirect(MyEnums.RediirectErrorEnum.SessionNull);
                return;
            }

            if (checkLogin && checkUserStaus && (Session[MyKeys.SESSION_ADMIN_INFO] == null || Session[MyKeys.SESSION_USER_STATUSID] == null))
            {
                //Response.Write("<script type=\"text/javascript\" src=\"/metro/js/ex-common-scripts.js\"></script><script>if(window.parent != window) getTopWindow().location.href='/adminmetro/index.aspx';"
                //   + " else window.location.href='" + siteConfig.webpath + siteConfig.webmanagepath + "/Login.aspx';</script>");
                Response.Write("<script type=\"text/javascript\" src=\"/metro/js/ex-common-scripts.js\"></script><script>if(window.parent != window) getTopWindow().location.href='/AdminMetro/index.aspx';"
                               + " else window.location.href='/AdminMetro/login_page.aspx';</script>");
                Response.End();
                return;
            }

            if (checkFunID)
            {
                if (MyRequest.GetQueryString("fun_id") != "")
                {
                    fun_id    = DESEncrypt.Decrypt(MyRequest.GetQueryString("fun_id"));
                    user_info = GetAdminInfo_CCOM(); //用户信息
                    String url = HttpContext.Current.Request.Url.AbsolutePath;
                    url = url.Replace("/AdminMetro/", "");

                    BLL.CCOM.Son_function   sfbll   = new BLL.CCOM.Son_function();
                    Model.CCOM.Son_function sfModel = sfbll.GetModel("Sf_id =" + fun_id);
                    if (sfModel.Sf_url != url)
                    {
                        InnerRedirect(MyEnums.RediirectErrorEnum.ParameterError);
                    }

                    //BLL.CCOM.Admin_permission bll = new BLL.CCOM.Admin_permission();
                    //Model.CCOM.Admin_permission model = bll.GetModel("Sf_id =" + fun_id + "and User_id =" + user_info.User_id);
                    //if (model == null)
                    //{
                    //    InnerRedirect(MyEnums.RediirectErrorEnum.NotAdmin);
                    //}
                    //else
                    //{
                    BLL.CCOM.Role rolebll = new BLL.CCOM.Role();
                    //Model.CCOM.Role roleModel = rolebll.GetModel("Role_id IN (SELECT Role_id FROM Role_permission WHERE User_id = " + user_info.User_id + ")");
                    Model.CCOM.Role roleModel = rolebll.GetModel("Role_id IN (SELECT Role_id FROM User_information WHERE User_id = " + user_info.User_id + ")");

                    if (!roleModel.Role_status)
                    {
                        BLL.CCOM.Role_permission          rpbll   = new BLL.CCOM.Role_permission();
                        List <Model.CCOM.Role_permission> rpmodel = rpbll.GetModelList("Sf_id =" + fun_id + "and Role_id =" + roleModel.Role_id);
                        if (rpmodel.Count > 0)
                        {
                            InnerRedirect(MyEnums.RediirectErrorEnum.NotAdmin);
                        }
                    }
                }
                else
                {
                    InnerRedirect(MyEnums.RediirectErrorEnum.FunIDNull);
                }
            }


            //标志首次登陆
            if (Session[MyKeys.SESSION_FIRST_LOGIN] != null)
            {
                isFirstLogin = true;
            }

            //只要有操作就重写session
            Session[MyKeys.SESSION_ADMIN_INFO] = GetAdminInfo_CCOM();
            Session.Timeout = 300;
            return;
        }
示例#3
0
        protected string createleftinneritem(Model.CCOM.Father_function Ff, JsonData listData)
        {
            string str = "";

            str += "<li class=\"sub-menu\">";
            str += "<a href=\"javascript:;\" class=\"\">";
            //   string icon = xn.Attributes["icon"].Value == "" ? "icon-file-alt" : xn.Attributes["icon"].Value;


            //string level1name = xn.Attributes["cff_name"].Value;
            string level1name = Ff.Ff_name;

            /*
             * if ((MyEnums.UserStatus)Session[MyKeys.SESSION_USER_TABLE] ==
             *  MyEnums.UserStatus.App_Universities_SchoolUser)
             * {
             *  if (xn.Attributes["stuview_name"].Value != "")
             *      level1name = xn.Attributes["stuview_name"].Value;
             * }
             */

            str += "<span>" + level1name + "</span>";
            str += "</a>";
            str += " <ul class=\"sub\">";

            string sql_Ff = " Ff_fatherID = " + Ff.Ff_id + " order by Ff_sort";

            BLL.CCOM.Father_function Bff = new BLL.CCOM.Father_function();
            var Ff_listSon = Bff.GetModelList(sql_Ff);

            bool hasSon = false;

            foreach (var Ff_son in Ff_listSon)
            {
                try
                {
                    string sql_son = " Ff_ID =" + Ff_son.Ff_id;
                    BLL.CCOM.Son_function    Bsf   = new BLL.CCOM.Son_function();
                    BLL.CCOM.Role_permission apbll = new BLL.CCOM.Role_permission();
                    var aplist = apbll.GetModelList("Sf_id in (select Sf_id from Son_function where Ff_ID = " + Ff_son.Ff_id + ") and Role_id=" + user_info.Role_id);
                    if (aplist.Count > 0)
                    {
                        JsonData data = new JsonData();
                        data["id"]        = DESEncrypt.Encrypt(Ff_son.Ff_id.ToString());
                        data["type"]      = "F";
                        data["address"]   = "";
                        data["name"]      = Ff_son.Ff_name;
                        data["functions"] = createlevel3json(Ff_son.Ff_id.ToString());
                        listData.Add(data);
                        hasSon = true;
                        Model.CCOM.Son_function Sf1 = Bsf.GetModel(aplist[0].Sf_id);
                        string cff_name             = Ff_son.Ff_name;
                        str += "<li data-id=\"" + DESEncrypt.Encrypt(Ff_son.Ff_id.ToString()) + "\"><a onclick=\"SetTopContent('" + DESEncrypt.Encrypt(Sf1.Sf_id.ToString()) + "')\" target=\"sysMain\" class=\"\" href=\"/AdminMetro/" + Sf1.Sf_url +
                               "?fun_id=" +
                               DESEncrypt.Encrypt(Sf1.Sf_id.ToString()) + "\">" +
                               cff_name +
                               "</a></li>";
                    }
                }
                catch (Exception ex)
                {
                    JscriptMsg("读取页面失败", "login_page.aspx", ex.Message);
                }
            }
            str += " </ul></li>";
            if (hasSon)
            {
                return(str);
            }
            else
            {
                return("");
            }
        }