Пример #1
0
    protected List <ArticleModel> articleList2   = new List <ArticleModel>(); //考试心得
    protected void Page_Load(object sender, EventArgs e)
    {
        ad          = bll_adFixed.GetModel(1);
        ad1         = bll_adFixed.GetModel(46);
        ad2         = bll_adFixed.GetModel(47);
        ad6         = bll_adFixed.GetModel(5);
        ad7         = bll_adFixed.GetModel(23);
        ad8         = bll_adFixed.GetModel(24);
        ad9         = bll_adFixed.GetModel(25);
        ad10        = bll_adFixed.GetModel(90);
        ad11        = bll_adFixed.GetModel(91);
        ad12        = bll_adFixed.GetModel(92);
        pageSection = bll_pageSection.GetModel(4);

        siteMenu = bll_siteMenu.GetModel(kind);

        List <string> fieldList = new List <string>();

        fieldList.Add(SiteMenuModel.PKID);
        fieldList.Add(SiteMenuModel.TITLE);
        fieldList.Add(SiteMenuModel.URL);
        fieldList.Add(SiteMenuModel.TARGET);
        fieldList.Add(SiteMenuModel.RELATION);
        fieldList.Add(SiteMenuModel.RELATIONID);
        fieldList.Add(SiteMenuModel.HASCHILD);

        List <SqlWhere> sqlWhereList = new List <SqlWhere>();

        sqlWhereList.Add(new SqlWhere(SiteMenuModel.ENABLED, SqlWhere.Oper.Equal, true));
        sqlWhereList.Add(new SqlWhere(SiteMenuModel.FATHERID, SqlWhere.Oper.Equal, kind));
        SiteMenuList = bll_siteMenu.GetList(1, 0, fieldList, sqlWhereList, null);

        // 考试资讯
        fieldList.Clear();
        fieldList.Add(ArticleModel.PKID);
        fieldList.Add(ArticleModel.TITLE);
        fieldList.Add(ArticleModel.PIC);
        fieldList.Add(ArticleModel.ISHEAD);
        fieldList.Add(ArticleModel.FILES);
        fieldList.Add(ArticleModel.PUBDATE);
        fieldList.Add(ArticleModel.CREATETIME);
        sqlWhereList.Clear();
        sqlWhereList.Add(new SqlWhere(ArticleModel.ENABLED, SqlWhere.Oper.Equal, true));
        sqlWhereList.Add(new SqlWhere(ArticleModel.CATEGORYID, SqlWhere.Oper.Equal, "16"));
        articleList2 = bll_article.GetList(1, 5, fieldList, sqlWhereList, null);
    }
Пример #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        WebUtility.AdminLoginAuth();
        if (!bll_admin.RuleAuth("全局_导航菜单"))
        {
            WebUtility.ShowError(WebUtility.ERROR101);
        }

        siteMenu = bll_siteMenu.GetModel(Request.QueryString["pkid"]);
        if (siteMenu == null)
        {
            WebUtility.ShowError(WebUtility.ERROR102);
        }

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

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

        if (cmd == "moveup")
        {
            bll_siteMenu.MoveUp(ids);
        }
        else if (cmd == "movedown")
        {
            bll_siteMenu.MoveDown(ids);
        }
        else if (cmd == "enab")
        {
            bll_siteMenu.UpdateStatus(ids, "enab");
        }
        else if (cmd == "del")
        {
            bll_siteMenu.Delete(ids, true);
        }
        else if (cmd == "updateall")
        {
            foreach (string key in Request.Form.AllKeys)
            {
                if (key.StartsWith("title"))
                {
                    string title    = Request.Form[key];
                    string maxlevel = Request.Form[key.Replace("title", "maxlevel")];
                    if (String.IsNullOrEmpty(title))
                    {
                        continue;
                    }
                    if (!StringHelper.IsNumber(maxlevel))
                    {
                        maxlevel = "1";
                    }

                    if (key.IndexOf("#") > 0)
                    {
                        SiteMenuModel siteMenu = new SiteMenuModel();
                        siteMenu.Title    = title;
                        siteMenu.FatherId = 0;
                        siteMenu.MaxLevel = Convert.ToInt32(maxlevel);
                        if (siteMenu.MaxLevel < 1)
                        {
                            siteMenu.MaxLevel = 1;
                        }
                        bll_siteMenu.Insert(siteMenu);
                    }
                    else
                    {
                        string        id       = key.Replace("title", "");
                        SiteMenuModel siteMenu = bll_siteMenu.GetModel(id);
                        if (siteMenu == null)
                        {
                            continue;
                        }
                        siteMenu.Title    = title;
                        siteMenu.MaxLevel = Convert.ToInt32(maxlevel);
                        if (siteMenu.MaxLevel < 1)
                        {
                            siteMenu.MaxLevel = 1;
                        }
                        bll_siteMenu.Update(siteMenu);
                    }
                }
            }

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

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