protected void ddlSf_ID_SelectedIndexChanged(object sender, EventArgs e) { string Sf_ID = this.ddlSf_ID.SelectedItem.Value; if (Sf_ID.Equals("0")) { JscriptMsg("请选择要编辑子功能!", "", "Error"); return; } string sql = " Sf_ID = " + Sf_ID; BLL.CCOM.Son_function Bsf = new BLL.CCOM.Son_function(); Model.CCOM.Son_function Msf = Bsf.GetModel(Convert.ToInt32(Sf_ID)); this.txtTitle.Text = Msf.Sf_name; this.txtURL.Text = Msf.Sf_url; this.txtSort.Text = Msf.Sf_sort.ToString(); if (Msf.Sf_status == true) { this.optOpen.Checked = true; this.optClose.Checked = false; } else { this.optOpen.Checked = false; this.optClose.Checked = true; } }
private string DoAdd(string title, bool status, string sort, string Ff_fatherID, string url) { try { var model = new Model.CCOM.Son_function(); model.Sf_name = title; model.Sf_status = status; model.Sf_sort = Convert.ToInt32(sort); model.Ff_ID = Convert.ToInt32(Ff_fatherID); model.Sf_url = url; BLL.CCOM.Son_function Bsf = new BLL.CCOM.Son_function(); Bsf.Add(model); } catch { return("数据更新异常"); } return(""); }
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; }
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(""); } }