Ejemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        WebUtility.AdminLoginAuth();

        systemMenu = bll_systemMenu.GetModel(Request.QueryString["pkid"]);
        if (systemMenu == null)
        {
            systemMenu = new SystemMenuModel();
        }

        if (!Page.IsPostBack)
        {
            BindInfo();
        }
    }
Ejemplo n.º 2
0
    /// <summary>
    /// 执行操作的方法
    /// </summary>
    private void Action()
    {
        string cmd = Request["cmd"];

        if (String.IsNullOrEmpty(cmd))
        {
            return;
        }
        string ids = Request.QueryString["ids"];

        if (cmd == "moveup")
        {
            bll_systemMenu.MoveUp(ids);
        }
        else if (cmd == "movedown")
        {
            bll_systemMenu.MoveDown(ids);
        }
        else if (cmd == "onoff")
        {
            bll_systemMenu.UpdateStatus(ids, "onoff");
        }
        else if (cmd == "enab")
        {
            bll_systemMenu.UpdateStatus(ids, "enab");
        }
        else if (cmd == "del")
        {
            bll_systemMenu.Delete(ids);
        }
        else if (cmd == "updateall")
        {
            foreach (string key in Request.Form.AllKeys)
            {
                if (key.StartsWith("title"))
                {
                    string title = Request.Form[key];
                    string url   = Request.Form[key.Replace("title", "url")];
                    if (String.IsNullOrEmpty(title))
                    {
                        continue;
                    }

                    if (key.IndexOf("#") > 0)
                    {
                        string fid = Request.Form[key.Replace("title", "fid")];
                        if (!StringHelper.IsNumber(fid))
                        {
                            continue;
                        }

                        SystemMenuModel systemMenu = new SystemMenuModel();
                        systemMenu.Title    = title;
                        systemMenu.Url      = url;
                        systemMenu.FatherId = Convert.ToInt32(fid);
                        bll_systemMenu.Insert(systemMenu);
                    }
                    else
                    {
                        string          id         = key.Replace("title", "");
                        SystemMenuModel systemMenu = bll_systemMenu.GetModel(id);
                        if (systemMenu == null)
                        {
                            continue;
                        }
                        systemMenu.Title = title;
                        systemMenu.Url   = url;
                        bll_systemMenu.Update(systemMenu);
                    }
                }
            }

            WebUtility.ShowAlertMessage("全部保存成功!", Request.RawUrl);
        }

        Response.Redirect(Request.Url.AbsolutePath);
    }