Beispiel #1
0
    protected void SubmitButton_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            if (!StringHelper.IsNumber(FatherId.Value))
            {
                FatherId.Value = "0";
            }
            if (!StringHelper.IsNumber(Sort.Value))
            {
                Sort.Value = "1";
            }

            onePage.Title     = MyTitle.Value;
            onePage.PageTitle = PageTitle.Value;
            if (!String.IsNullOrEmpty(Keywords.Value))
            {
                onePage.Keywords = Keywords.Value.Replace(",", ",");
            }
            else
            {
                onePage.Keywords = Keywords.Value;
            }
            onePage.Descn    = Descn.Value;
            onePage.UrlAlias = UrlAlias.Value;
            if (onePage.Mode == 0)
            {
                onePage.Content = MyContent.Value;
            }
            else
            {
                onePage.Content = null;
            }
            onePage.FatherId = Convert.ToInt32(FatherId.Value);
            onePage.ISort    = Convert.ToInt32(Sort.Value);

            if (onePage.Pkid > 0)
            {
                //更改
                bll_onePage.Update(onePage);
                bll_urlRoute.Update();
                WebUtility.ShowAlertMessage("保存成功!", "onePageManage.aspx" + param);
            }
            else
            {
                //增加
                onePage.Enabled    = true;
                onePage.CreateTime = DateTime.Now.ToString();
                bll_onePage.Insert(onePage);
                bll_urlRoute.Update();
                WebUtility.ShowAlertMessage("新增成功!", Request.RawUrl);
            }
        }
    }
Beispiel #2
0
    protected void SubmitButton_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            if (!StringHelper.IsNumber(FatherId.Value))
            {
                WebUtility.ShowAlertMessage("请填写父版块ID!", null);
            }

            forumMenu.Title      = MyTitle.Value;
            forumMenu.Descn      = Descn.Value;
            forumMenu.Moderators = Moderators.Value;
            forumMenu.PageTitle  = PageTitle.Value;
            if (!String.IsNullOrEmpty(Keywords.Value))
            {
                forumMenu.Keywords = Keywords.Value.Replace(",", ",");
            }
            else
            {
                forumMenu.Keywords = Keywords.Value;
            }
            forumMenu.Pic      = Pic.Value;
            forumMenu.UrlAlias = UrlAlias.Value;
            forumMenu.IsReco   = IsReco.Checked;

            if (forumMenu.Pkid > 0)
            {
                //更改
                int result = bll_forumMenu.Update(forumMenu, FatherId.Value, Request.Form["sort"]);

                if (result == 101)
                {
                    WebUtility.ShowAlertMessage("没有找到相关父版块!", null);
                }
                else if (result == 102)
                {
                    WebUtility.ShowAlertMessage("所选父版块为最终版块,无法添加子版块,请重新选择父版块!", null);
                }
                else if (result == 103)
                {
                    WebUtility.ShowAlertMessage("没有找到显示位置!", null);
                }

                bll_urlRoute.Update();
                WebUtility.ShowAlertMessage("保存成功!", "menuManage.aspx" + param);
            }
            else
            {
                //增加
                forumMenu.FatherId = Convert.ToInt32(FatherId.Value);
                int result = bll_forumMenu.Insert(forumMenu);

                if (result == 101)
                {
                    WebUtility.ShowAlertMessage("没有找到相关父版块!", null);
                }
                else if (result == 102)
                {
                    WebUtility.ShowAlertMessage("所选父版块为最终版块,无法添加子版块,请重新选择父版块!", null);
                }

                result = bll_forumMenu.Update(forumMenu, FatherId.Value, Request.Form["sort"]);
                if (result == 103)
                {
                    WebUtility.ShowAlertMessage("没有找到显示位置!", null);
                }

                bll_urlRoute.Update();
                WebUtility.ShowAlertMessage("新增成功!", Request.RawUrl);
            }
        }
    }