private bool DoAdd() { bool result = true; BLL.ArticleBll bll = new BLL.ArticleBll(); Entity.Article model = new Entity.Article(); model.ChannelID = this.channel_id; model.Title = txtTitle.Text.Trim(); model.LinkURL = txtLinkUrl.Text.Trim(); model.ImageURL = txtImgUrl.Text.Trim(); model.SortID = int.Parse(txtSortId.Text.Trim()); model.ClickCount = int.Parse(txtClick.Text.Trim()); model.Content = txtContent.Value; model.IsRecommend = 0; model.IsHot = 0; if (cblItem.Items[0].Selected == true) { model.IsRecommend = 1; } if (bll.Add(model) < 1) { result = false; } return result; }
private bool DoAdd() { bool result = true; BLL.ArticleBll bll = new BLL.ArticleBll(); Entity.Article model = new Article(); ; model.ChannelID = this.channel_id; model.Title = txtTitle.Text.Trim(); // model.ChannelID = int.Parse(ddlCategoryId.SelectedValue); model.LinkURL = txtLinkUrl.Text.Trim(); model.ImageURL = txtImgUrl.Text.Trim(); model.Author = txtAuthor.Text.Trim(); model.From = txtForm.Text.Trim(); //自动提取摘要 if (txtZhaiyao.Text.Trim() != string.Empty) { model.Summary = Utils.DropHTML(txtZhaiyao.Text, 250); } else { model.Summary = Utils.DropHTML(txtContent.Value, 250); } //model.seo_title = txtSeoTitle.Text.Trim(); //model.seo_keywords = txtSeoKeywords.Text.Trim(); //model.seo_description = txtSeoDescription.Text.Trim(); //model.sort_id = int.Parse(txtSortId.Text.Trim()); model.ClickCount = int.Parse(txtClick.Text.Trim()); model.Content = txtContent.Value; model.IsRecommend = 0; model.IsHot = 0; if (cblItem.Items[0].Selected == true) { model.IsRecommend = 1; } if (cblItem.Items[1].Selected == true) { model.IsHot = 1; } if (bll.Add(model) < 1) { result = false; } return result; }