Exemple #1
0
 public int Update(M_Article model)
 {
     return this.dal.Update(model);
 }
Exemple #2
0
    protected void AddNewsBtn_Click(object sender, EventArgs e)
    {
        bool checkForm = CheckValidate();
        if (checkForm)
        {
            M_Article Articlemodel = new M_Article();
            Articlemodel.Id = ArticleId;
            #region 所有情况下
            Articlemodel.Author = txtAuthor.Text.Trim();
            if (!string.IsNullOrEmpty(Request.Form["ddlColId"]))
                Articlemodel.ColId = int.Parse(Request.Form["ddlColId"]);

            //添加时间
            if (txtAddTime.Text.Trim().Length != 0)
            {
                if (Function.IsDate(txtAddTime.Text.Trim().ToString()))
                    Articlemodel.AddTime = DateTime.Parse(txtAddTime.Text.Trim().ToString());
                else
                    Function.ShowSysMsg(0, "<li>你输入的日期格式不对</li><li><a href='javascript:window.history.back()'>返回上一步</a></li>");
            }
            else
                Articlemodel.AddTime = DateTime.Now;

            Articlemodel.ExpireTime = Convert.ToDateTime(txtExpireTime.Text.Trim());
            Articlemodel.ViewEndTime = txtViewEndTime.Text.Trim();
            Articlemodel.UpdateTime = DateTime.Now;
            Articlemodel.ShortContent = SiteBll.GetFiltering(txtShortContent.Text.Trim());
            Articlemodel.Source = txtSource.Text.Trim();
            #region 关键字

            string tagIdStr = string.Empty;
            string nameStr = txtTagNameStr.Text.Trim();
            nameStr = Regex.Replace(nameStr, @"\s+", "|", RegexOptions.IgnoreCase);
            if (nameStr.Length != 0)
            {
                if (nameStr.StartsWith("|"))
                    nameStr = nameStr.Substring(1, nameStr.Length - 1);
                if (nameStr.EndsWith("|"))
                    nameStr = nameStr.Substring(0, nameStr.Length - 1);
                B_Tag tagBll = new B_Tag();
                DataRow dr = tagBll.AddTagStr(nameStr, ChannelModel.ModelType, 0, "后台管理员");
                if (dr != null)
                {
                    tagIdStr = "|" + dr[0] + "|";
                    nameStr = "|" + dr[1] + "|";
                }
                else
                {
                    tagIdStr = "";
                    nameStr = "";
                }
            }
            Articlemodel.TagIdStr = tagIdStr;
            Articlemodel.TagNameStr = nameStr;
            #endregion
            Articlemodel.IsFocus = chkBoxIsFocus.Checked;
            Articlemodel.IsHeader = chkBoxIsHeader.Checked;
            Articlemodel.IsIrregular = chkBoxIsIrregular.Checked;
            Articlemodel.IsRecommend = chkBoxIsRecommend.Checked;
            Articlemodel.IsShowCommentLink = IsShowCommentLink.Checked;
            Articlemodel.IsSideShow = chkBoxIsSideShow.Checked;
            Articlemodel.IsTop = chkBoxIsTop.Checked;

            Articlemodel.Title = SiteBll.GetFiltering(txtTitle.Text.Trim());
            Articlemodel.LongTitle = SiteBll.GetFiltering(txtLongTitle.Text.Trim());
            Articlemodel.TitleColor = txtTitleColor.Text.Trim();
            Articlemodel.TitleFontType = Int32.Parse(ddlTitleFontType.SelectedValue.Trim());
            Articlemodel.UId = AdminModel.UserId;
            Articlemodel.UName = AdminModel.LoginName;
            Articlemodel.AdminUId = AdminModel.UserId;
            Articlemodel.AdminUName = AdminModel.AdminName;
            Articlemodel.UserType = 1;
            Articlemodel.Status = 3;
            //头条文章属性设置
            Articlemodel.HeaderFont = txtHeaderFont.Text.Trim() + "|" + ddlHeaderProPerty.SelectedValue + "|" + ddlHeaderSize.SelectedValue + "|" + txtHeaderColor.Text.Trim();
            Articlemodel.HeaderImgPath = txtHeaderImgPath.Value;
            #endregion
            if (rbOuter.Checked == true)
            {
                Articlemodel.OuterUrl = txtOuterUrl.Text.Trim();
            }
            #region 不是外部链接地址情况

                if (rbComm.Checked == true)
                {
                    Articlemodel.TitleType = 1;
                }
                else if (rbImg.Checked == true)
                {
                    Articlemodel.TitleType = 2;
                    Articlemodel.TitleImgPath = Request.Form["txtTitleImgPath"].Trim();
                }
            if (!rbOuter.Checked)
            {
                if (Request.Form["ChargeTypeRadioButtonList"] == "2")
                    Articlemodel.ChargeHourCount = Int32.Parse(txtChargeHourCount.Text.Trim());
                //重复收费方式
                if (rdBtnChargeType1.Checked)
                    Articlemodel.ChargeType = 1;
                if (rdBtnChargeType2.Checked)
                {
                    Articlemodel.ChargeType = 2;
                    Articlemodel.ChargeHourCount = Int32.Parse(txtChargeHourCount.Text.Trim());
                }
                if (rdBtnChargeType3.Checked)
                {
                    Articlemodel.ChargeType = 3;
                    Articlemodel.ChargeViewCount = Int32.Parse(txtChargeViewCount.Text.Trim());
                }
                if (rdBtnChargeType4.Checked)
                {
                    Articlemodel.ChargeType = 4;
                    Articlemodel.ChargeHourCount = Int32.Parse(txtChargeHourCount.Text.Trim());
                    Articlemodel.ChargeViewCount = Int32.Parse(txtChargeViewCount.Text.Trim());
                }
                if (rdBtnChargeType5.Checked)
                {
                    Articlemodel.ChargeType = 5;
                    Articlemodel.ChargeHourCount = Int32.Parse(txtChargeHourCount.Text.Trim());
                    Articlemodel.ChargeViewCount = Int32.Parse(txtChargeViewCount.Text.Trim());
                }
                if (rdBtnChargeType6.Checked)
                    Articlemodel.ChargeType = 6;
                B_ConvertImage convertBll = new B_ConvertImage(SiteModel.Domain, InfoModel.UploadPath);
                if (chkBoxRemoteSaveImage.Checked)
                {

                    txtContent.Value = convertBll.ConvertLocalImagePath(txtContent.Value);

                }
                else
                {
                    txtContent.Value = convertBll.ConvertImgePath(txtContent.Value);
                }
                Articlemodel.Content = SiteBll.GetFiltering(txtContent.Value);
                Articlemodel.Content = Articlemodel.Content.Replace(@"<div style=""page-break-after: always""><span style=""display: none"">&nbsp;</span></div>", "{Ky:PAGE}");
                //生成的格式
                Articlemodel.PageType = int.Parse(rdBtnPageType.SelectedValue);
                Articlemodel.IsOpened = int.Parse(rdBtnIsOpened.SelectedValue.Trim());
                if (Articlemodel.IsOpened == 0)
                {
                    string groupIdstr = string.Empty;
                    foreach (ListItem li in chkBoxGroupIdStr.Items)
                    {
                        if (li.Selected)
                        {
                            groupIdstr += li.Value + "|";
                        }
                    }
                    Articlemodel.GroupIdStr = "|" + groupIdstr;
                }
                else { Articlemodel.GroupIdStr = ""; }
                Articlemodel.HitCount = Int32.Parse(txtHitCount.Text.Trim());
                Articlemodel.IsAllowComment = chkBoxIsAllowComment.Checked;
                Articlemodel.PointCount = Int32.Parse(txtPointCount.Text.Trim());
                Articlemodel.StarLevel = ddlStarLevel.SelectedValue.Trim();
                //文章所属数据表 Articlemodel.TableName="";
                Articlemodel.TemplatePath = Request.Form["txtTemplatePath"].Trim();
                //文章所属专题
                string idStr = string.Empty;
                for (int i = 0; i < lBoxTopicIdStr.Items.Count; i++)
                {
                    if (lBoxTopicIdStr.Items[i].Selected)
                    {
                        idStr += lBoxTopicIdStr.Items[i].Value + "|";
                    }
                }
                if (idStr != "")
                    Articlemodel.SpecialIdStr = "|" + idStr;
                else
                    Articlemodel.SpecialIdStr = "";
                if (txtViewer.Text.Trim() != string.Empty)
                {
                    Articlemodel.ViewUName = "|" + txtViewer.Text.Trim() + "|";
                    if (txtViewEndTime.Text.Trim() == "")
                    {
                        litMsg.Text = "<script>alert('签收结束时间必须填写');</script>";
                        return;
                    }
                }
                else
                    Articlemodel.ViewUName = string.Empty;
            }
            #endregion

            #region 保存

            if (!CheckValidate())
            {
                return;
            }
            B_Article AddArticle = new B_Article();
            if (ArticleId > 0)
            {
                //返回文章ID
                ArticleId = AddArticle.Update(Articlemodel);
            }
            else
            {
                ArticleId = AddArticle.Add(Articlemodel);
            }
            if (chkBoxIsCreate.Checked)
            {
                DataRow dr = CreateBll.GetInfoById("kyarticle", ArticleId);
                CreateBll.CreateSingleInfo(dr);
            }
            Response.Redirect("InfoList.aspx?ChId=" + ChannelId + "&ColId=" + Articlemodel.ColId);

            #endregion  保存
        }
    }
Exemple #3
0
 public int Add(M_Article model)
 {
     return this.dal.Add(model);
 }
Exemple #4
0
 public M_Article GetArticle(int Id)
 {
     DataRow info = this.InfoOper.GetInfo("kyarticle", Id);
     if (info == null)
     {
         return null;
     }
     M_Article article = new M_Article();
     article.Id = int.Parse(info["Id"].ToString());
     article.ColId = int.Parse(info["ColId"].ToString());
     article.Title = info["Title"].ToString();
     article.TitleColor = info["TitleColor"].ToString();
     article.TitleFontType = int.Parse(info["TitleFontType"].ToString());
     article.TitleType = int.Parse(info["TitleType"].ToString());
     article.TitleImgPath = info["TitleImgPath"].ToString();
     article.UId = int.Parse(info["UId"].ToString());
     article.UName = info["UName"].ToString();
     article.UserType = int.Parse(info["UserType"].ToString());
     article.AdminUId = int.Parse(info["AdminUId"].ToString());
     article.AdminUName = info["AdminUName"].ToString();
     article.Status = int.Parse(info["Status"].ToString());
     article.HitCount = int.Parse(info["HitCount"].ToString());
     article.AddTime = DateTime.Parse(info["AddTime"].ToString());
     article.UpdateTime = DateTime.Parse(info["UpdateTime"].ToString());
     article.TemplatePath = info["TemplatePath"].ToString();
     article.PageType = int.Parse(info["PageType"].ToString());
     if (info["IsCreated"].ToString().ToLower() == "true")
     {
         article.IsCreated = true;
     }
     else
     {
         article.IsCreated = false;
     }
     article.UserCateId = int.Parse(info["UserCateId"].ToString());
     article.PointCount = int.Parse(info["PointCount"].ToString());
     article.ChargeType = int.Parse(info["ChargeType"].ToString());
     article.ChargeHourCount = int.Parse(info["ChargeHourCount"].ToString());
     article.ChargeViewCount = int.Parse(info["ChargeViewCount"].ToString());
     article.IsOpened = int.Parse(info["IsOpened"].ToString());
     article.GroupIdStr = info["GroupIdStr"].ToString();
     if (info["IsDeleted"].ToString().ToLower() == "true")
     {
         article.IsDeleted = true;
     }
     else
     {
         article.IsDeleted = false;
     }
     if (info["IsRecommend"].ToString().ToLower() == "true")
     {
         article.IsRecommend = true;
     }
     else
     {
         article.IsRecommend = false;
     }
     if (info["IsTop"].ToString().ToLower() == "true")
     {
         article.IsTop = true;
     }
     else
     {
         article.IsTop = false;
     }
     if (info["IsFocus"].ToString().ToLower() == "true")
     {
         article.IsFocus = true;
     }
     else
     {
         article.IsFocus = false;
     }
     if (info["IsSideShow"].ToString().ToLower() == "true")
     {
         article.IsSideShow = true;
     }
     else
     {
         article.IsSideShow = false;
     }
     article.TagIdStr = info["TagIdStr"].ToString();
     article.TagNameStr = info["TagNameStr"].ToString();
     article.SpecialIdStr = info["SpecialIdStr"].ToString();
     article.LongTitle = info["LongTitle"].ToString();
     article.Content = info["Content"].ToString();
     article.ShortContent = info["ShortContent"].ToString();
     article.OuterUrl = info["OuterUrl"].ToString();
     article.Author = info["Author"].ToString();
     article.Source = info["Source"].ToString();
     if (info["IsHeader"].ToString().ToLower() == "true")
     {
         article.IsHeader = true;
     }
     else
     {
         article.IsHeader = false;
     }
     article.HeaderFont = info["HeaderFont"].ToString();
     article.HeaderImgPath = info["HeaderImgPath"].ToString();
     article.StarLevel = info["StarLevel"].ToString();
     if (info["IsShowCommentLink"].ToString().ToLower() == "true")
     {
         article.IsShowCommentLink = true;
     }
     else
     {
         article.IsShowCommentLink = false;
     }
     if (info["IsIrregular"].ToString().ToLower() == "true")
     {
         article.IsIrregular = true;
     }
     else
     {
         article.IsIrregular = false;
     }
     article.IrregularId = int.Parse(info["IrregularId"].ToString());
     article.ViewUName = info["ViewUName"].ToString();
     article.ViewUName2 = info["ViewUName2"].ToString();
     article.ViewEndTime = info["ViewEndTime"].ToString();
     if (info["IsAllowComment"].ToString().ToLower() == "true")
     {
         article.IsAllowComment = true;
     }
     else
     {
         article.IsAllowComment = false;
     }
     article.ExpireTime = DateTime.Parse(info["ExpireTime"].ToString());
     return article;
 }
Exemple #5
0
 public int Update(M_Article model)
 {
     return this.Add(model);
 }
Exemple #6
0
 public int Add(M_Article model)
 {
     SqlParameter[] commandParameters = new SqlParameter[] {
         new SqlParameter("@Id", SqlDbType.Int, 4), new SqlParameter("@ColId", SqlDbType.Int, 4), new SqlParameter("@Title", SqlDbType.NVarChar), new SqlParameter("@TitleColor", SqlDbType.NVarChar), new SqlParameter("@TitleFontType", SqlDbType.Int, 4), new SqlParameter("@TitleType", SqlDbType.Int, 4), new SqlParameter("@TitleImgPath", SqlDbType.VarChar, 255), new SqlParameter("@UId", SqlDbType.Int, 4), new SqlParameter("@UName", SqlDbType.NVarChar), new SqlParameter("@UserType", SqlDbType.Int, 4), new SqlParameter("@AdminUId", SqlDbType.Int, 4), new SqlParameter("@AdminUName", SqlDbType.NVarChar), new SqlParameter("@Status", SqlDbType.Int, 4), new SqlParameter("@HitCount", SqlDbType.Int, 4), new SqlParameter("@AddTime", SqlDbType.DateTime), new SqlParameter("@UpdateTime", SqlDbType.DateTime),
         new SqlParameter("@TemplatePath", SqlDbType.VarChar, 255), new SqlParameter("@PageType", SqlDbType.Int, 4), new SqlParameter("@IsCreated", SqlDbType.Bit, 1), new SqlParameter("@UserCateId", SqlDbType.Int, 4), new SqlParameter("@PointCount", SqlDbType.Int, 4), new SqlParameter("@ChargeType", SqlDbType.Int, 4), new SqlParameter("@ChargeHourCount", SqlDbType.Int, 4), new SqlParameter("@ChargeViewCount", SqlDbType.Int, 4), new SqlParameter("@IsOpened", SqlDbType.Int, 4), new SqlParameter("@GroupIdStr", SqlDbType.VarChar, 200), new SqlParameter("@IsDeleted", SqlDbType.Bit, 1), new SqlParameter("@IsRecommend", SqlDbType.Bit, 1), new SqlParameter("@IsTop", SqlDbType.Bit, 1), new SqlParameter("@IsFocus", SqlDbType.Bit, 1), new SqlParameter("@IsSideShow", SqlDbType.Bit, 1), new SqlParameter("@TagIdStr", SqlDbType.VarChar, 300),
         new SqlParameter("@TagNameStr", SqlDbType.NVarChar), new SqlParameter("@SpecialIdStr", SqlDbType.VarChar, 200), new SqlParameter("@LongTitle", SqlDbType.NVarChar), new SqlParameter("@Content", SqlDbType.NText), new SqlParameter("@ShortContent", SqlDbType.NVarChar), new SqlParameter("@OuterUrl", SqlDbType.VarChar, 255), new SqlParameter("@Author", SqlDbType.NVarChar), new SqlParameter("@Source", SqlDbType.NVarChar), new SqlParameter("@IsHeader", SqlDbType.Bit, 1), new SqlParameter("@HeaderFont", SqlDbType.NVarChar), new SqlParameter("@HeaderImgPath", SqlDbType.VarChar, 255), new SqlParameter("@StarLevel", SqlDbType.NVarChar), new SqlParameter("@IsShowCommentLink", SqlDbType.Bit, 1), new SqlParameter("@IsIrregular", SqlDbType.Bit, 1), new SqlParameter("@IrregularId", SqlDbType.Int, 4), new SqlParameter("@ViewUName", SqlDbType.NText),
         new SqlParameter("@ViewUName2", SqlDbType.NText), new SqlParameter("@ViewEndTime", SqlDbType.NVarChar), new SqlParameter("@IsAllowComment", SqlDbType.Bit, 1), new SqlParameter("@ExpireTime", SqlDbType.DateTime)
      };
     commandParameters[0].Value = model.Id;
     commandParameters[1].Value = model.ColId;
     commandParameters[2].Value = model.Title;
     commandParameters[3].Value = model.TitleColor;
     commandParameters[4].Value = model.TitleFontType;
     commandParameters[5].Value = model.TitleType;
     commandParameters[6].Value = model.TitleImgPath;
     commandParameters[7].Value = model.UId;
     commandParameters[8].Value = model.UName;
     commandParameters[9].Value = model.UserType;
     commandParameters[10].Value = model.AdminUId;
     commandParameters[11].Value = model.AdminUName;
     commandParameters[12].Value = model.Status;
     commandParameters[13].Value = model.HitCount;
     commandParameters[14].Value = model.AddTime;
     commandParameters[15].Value = model.UpdateTime;
     commandParameters[16].Value = model.TemplatePath;
     commandParameters[17].Value = model.PageType;
     commandParameters[18].Value = model.IsCreated;
     commandParameters[19].Value = model.UserCateId;
     commandParameters[20].Value = model.PointCount;
     commandParameters[21].Value = model.ChargeType;
     commandParameters[22].Value = model.ChargeHourCount;
     commandParameters[23].Value = model.ChargeViewCount;
     commandParameters[24].Value = model.IsOpened;
     commandParameters[25].Value = model.GroupIdStr;
     commandParameters[26].Value = model.IsDeleted;
     commandParameters[27].Value = model.IsRecommend;
     commandParameters[28].Value = model.IsTop;
     commandParameters[29].Value = model.IsFocus;
     commandParameters[30].Value = model.IsSideShow;
     commandParameters[31].Value = model.TagIdStr;
     commandParameters[32].Value = model.TagNameStr;
     commandParameters[33].Value = model.SpecialIdStr;
     commandParameters[34].Value = model.LongTitle;
     commandParameters[35].Value = model.Content;
     commandParameters[36].Value = model.ShortContent;
     commandParameters[37].Value = model.OuterUrl;
     commandParameters[38].Value = model.Author;
     commandParameters[39].Value = model.Source;
     commandParameters[40].Value = model.IsHeader;
     commandParameters[41].Value = model.HeaderFont;
     commandParameters[42].Value = model.HeaderImgPath;
     commandParameters[43].Value = model.StarLevel;
     commandParameters[44].Value = model.IsShowCommentLink;
     commandParameters[45].Value = model.IsIrregular;
     commandParameters[46].Value = model.IrregularId;
     commandParameters[47].Value = model.ViewUName;
     commandParameters[48].Value = model.ViewUName2;
     commandParameters[49].Value = model.ViewEndTime;
     commandParameters[50].Value = model.IsAllowComment;
     commandParameters[51].Value = model.ExpireTime;
     commandParameters[0].Direction = ParameterDirection.InputOutput;
     SqlHelper.ExecuteNonQuery(SqlHelper.ConnectionStringKy, CommandType.StoredProcedure, "up_Article_Set", commandParameters);
     return int.Parse(commandParameters[0].Value.ToString());
 }
Exemple #7
0
    protected void btnAddCateSave_Click(object sender, EventArgs e)
    {
        bool checkForm = CheckValidate();
        if (checkForm)
        {
            if (Id > 0)
            {
                ArticleModel = ArticleBll.GetArticle(Id);
            }
            ArticleModel.Id = Id;
            ArticleModel.ShortContent = SiteBll.GetFiltering(txtShortContent.Text.Trim());
            ArticleModel.ColId = Int32.Parse(Request.Form["ddlColId"].ToString());
            ArticleModel.Title = txtTitle.Text.Trim();
            ArticleModel.LongTitle = txtTitle.Text.Trim();
            ArticleModel.UserCateId = Convert.ToInt32(ddlUserCate.SelectedValue.Trim());
            #region 关键字
            string tagIdStr = string.Empty;
            string nameStr = txtTagNameStr.Text.Trim();
            if (nameStr.Length != 0)
            {
                if (nameStr.StartsWith("|"))
                    nameStr = nameStr.Substring(1, nameStr.Length - 1);
                if (nameStr.EndsWith("|"))
                    nameStr = nameStr.Substring(0, nameStr.Length - 1);
                B_Tag tagBll = new B_Tag();
                DataRow dr = tagBll.AddTagStr(nameStr, ChannelModel.ModelType, UserBll.GetCookie().UserID, UserBll.GetCookie().LogName);
                if (dr != null)
                {
                    tagIdStr = "|" + dr[0] + "|";
                    nameStr = "|" + dr[1] + "|";
                }
                else
                {
                    tagIdStr = "";
                    nameStr = "";
                }
            }
            ArticleModel.TagIdStr = tagIdStr;
            ArticleModel.TagNameStr = nameStr;
            #endregion
            //保存状态Status
            if (((Button)sender).ID == "btnSaveCaoGao")
            {
                ArticleModel.Status = -1;
            }
            else if (((Button)sender).ID == "btnAddCateSave")
            {
                if (ChannelModel != null)
                {
                    if (ChannelModel.VerifyType == 0)
                    {
                        ArticleModel.Status = 3;
                    }
                }
                else
                {
                    ArticleModel.Status = 0;
                }
            }
            ArticleModel.Author = txtAuthor.Text.Trim();
            ArticleModel.Source = txtSource.Text.Trim();
            ArticleModel.ShortContent = SiteBll.GetFiltering(txtShortContent.Text.Trim());
            //录入者ID ,通过传值得到
            ArticleModel.UId = UserModel.UserID;
            //录入者用户名,通过传值得到
            ArticleModel.UName = UserModel.LogName;
            ArticleModel.UserType = 0;
            ArticleModel.TitleType = 1;

            ArticleModel.Content = SiteBll.GetFiltering(txtContent.Value);
            ArticleModel.Content = ArticleModel.Content.Replace(@"<div style=""page-break-after: always""><span style=""display: none"">&nbsp;</span></div>", "{Ky:PAGE}");
            ArticleModel.PointCount = Convert.ToInt32(txtPoint.Text.Trim());
            ArticleModel.AddTime = DateTime.Now;
            ArticleModel.UpdateTime = DateTime.Now;
            ArticleModel.ExpireTime = Convert.ToDateTime("9999-01-01");
            ArticleModel.ViewEndTime = DateTime.Now.AddDays(10).ToString();
            ArticleModel.IsOpened = Convert.ToInt32(hfIsOpened.Value);
            #region 继承栏目相关设置
            if (Id <= 0)
            {
                if (!string.IsNullOrEmpty(Request.Form["ddlColId"]) && Request.Form["ddlColId"] != "-1")
                {
                    ColumnModel = ColumnBll.GetColumn(int.Parse(Request.Form["ddlColId"].ToString()));
                    ArticleModel.TemplatePath = ColumnModel.InfoTemplatePath;
                    ArticleModel.PageType = ColumnModel.InfoPageType;
                    ArticleModel.ChargeType = ColumnModel.ChargeType;
                    ArticleModel.ChargeHourCount = ColumnModel.ChargeHourCount;
                    ArticleModel.ChargeViewCount = ColumnModel.ChargeViewCount;
                    ArticleModel.IsAllowComment = ColumnModel.IsAllowComment;
                }
                // ArticleModel.HitCount = 0;
            }
            #endregion
            //保存
            if (Id > 0)
                ArticleBll.Update(ArticleModel);
            else
            {
                ArticleBll.Add(ArticleModel);
                    #region 增加积分
                //如果频道不需要审核,添加积分
                if (ChannelModel.VerifyType == 0)
                {
                    if (UserModel == null)
                        return;
                    if (UserGroupBll == null)
                        return;
                    string scale = UserGroupBll.Power_UserGroup("Contribute", 0, UserGroupModel.GroupPower);
                    int score = int.Parse(scale) * ColumnModel.ScoreReward;
                    B_Money moneyBll = new B_Money();
                    moneyBll.Integral(score, UserModel.UserID);
                }
                    #endregion
            }
            Response.Redirect("InfoList.aspx?ChId=" + ChId + "&ColId=" + ArticleModel.ColId);
        }
    }
Exemple #8
0
    private void ShowInfo(int articleId)
    {
        ArticleModel = ArticleBll.GetArticle(articleId);
        hfIsOpened.Value = ArticleModel.IsOpened.ToString();
        if (ArticleModel == null)
            Function.ShowMsg(0, "<li>所选" + ChannelModel.TypeName + "不存在或已经被删除</li><li><a href='javascript:history.back()'>返回上一级</a></li>");
        if (ArticleModel.Status == 1 || ArticleModel.Status == 2 || ArticleModel.Status == 3)
            Function.ShowMsg(0, "<li>你没有修改此稿件的权限</li><li><a href='javascript:history.back()'>返回上一级</a></li>");
        txtTitle.Text = ArticleModel.Title.Trim();
        txtAuthor.Text = ArticleModel.Author.Trim();
        txtSource.Text = ArticleModel.Source.Trim();
        string tagNameStr = ArticleModel.TagNameStr;
        if (tagNameStr != string.Empty && tagNameStr.StartsWith("|") && tagNameStr.EndsWith("|"))
        {
            tagNameStr = tagNameStr.Substring(0, tagNameStr.Length - 1);
            tagNameStr = tagNameStr.Substring(1, tagNameStr.Length - 1);
        }
        txtTagNameStr.Text = tagNameStr;
        ddlUserCate.SelectedValue = ArticleModel.UserCateId.ToString();
        txtShortContent.Text = ArticleModel.ShortContent.Trim();
        B_ConvertImage convertBll = new B_ConvertImage(SiteModel.Domain, InfoModel.UploadPath);
        txtContent.Value = convertBll.ConvertContent(ArticleModel.Content);
        txtContent.Value = txtContent.Value.Replace("{Ky:PAGE}", @"<div style=""page-break-after: always""><span style=""display: none"">&nbsp;</span></div>");

        txtPoint.Text = ArticleModel.PointCount.ToString().Trim();
        btnAddCateSave.Visible = false;
        btnSaveCaoGao.Visible = false;
        btnUpdate.Visible = true;
    }