Пример #1
0
        protected void SubmitButton_Click(object sender, EventArgs e)
        {
            ArticleInfo article = new ArticleInfo();

            article.Id       = RequestHelper.GetQueryString <int>("ID");
            article.Title    = Title.Text;
            article.ClassId  = ArticleClassBLL.ReadFullParentId(Convert.ToInt32(ClassID.Text));
            article.IsTop    = Convert.ToInt32(IsTop.Text);
            article.Author   = Author.Text;
            article.Resource = Resource.Text;
            article.Keywords = Keywords.Text;
            article.Url      = Url.Text;
            article.Photo    = Photo.Text;
            article.Summary  = Summary.Text;
            article.Content  = Content.Value.FilterBadwords();
            article.Date     = RequestHelper.DateNow;

            #region 新增
            article.Content1       = Content1.Value.FilterBadwords();
            article.Mobilecontent1 = MobileContent1.Value.FilterBadwords();
            article.Content2       = Content2.Value.FilterBadwords();
            article.Mobilecontent2 = MobileContent2.Value.FilterBadwords();

            #endregion

            article.OrderId   = Convert.ToInt32(OrderID.Text);
            article.ViewCount = 0;
            article.LoveCount = 0;
            article.RealDate  = Convert.ToDateTime(RealDate.Text);
            article.FilePath  = FilePath.Text;
            article.ParentId  = 0;
            article.AddCol1   = 0;
            article.AddCol2   = MobileContent.Value.FilterBadwords();

            string alertMessage = ShopLanguage.ReadLanguage("AddOK");
            if (article.Id == int.MinValue)
            {
                CheckAdminPower("AddArticle", PowerCheckType.Single);
                int id = ArticleBLL.Add(article);
                AdminLogBLL.Add(ShopLanguage.ReadLanguage("AddRecord"), ShopLanguage.ReadLanguage("Article"), id);
            }
            else
            {
                CheckAdminPower("UpdateArticle", PowerCheckType.Single);
                ArticleBLL.Update(article);
                AdminLogBLL.Add(ShopLanguage.ReadLanguage("UpdateRecord"), ShopLanguage.ReadLanguage("Article"), article.Id);
                alertMessage = ShopLanguage.ReadLanguage("UpdateOK");
            }
            ScriptHelper.Alert(alertMessage, RequestHelper.RawUrl);
        }