Example #1
0
        /// <summary>
        /// 初始化区域信息
        /// </summary>
        private void InitQuYu(int tourAreaId)
        {
            EyouSoft.BLL.NewsStructure.NewsBll bll = new EyouSoft.BLL.NewsStructure.NewsBll();
            lsNews = new List <EyouSoft.Model.NewsStructure.NewsModel>();

            queryModel            = new EyouSoft.Model.NewsStructure.SearchOrderInfo();
            queryModel.ProvinceId = tourAreaId;
            lsNews = bll.GetList(pageSize, pageIndex, ref recordCount, queryModel);

            if (lsNews != null && lsNews.Count > 0)
            {
                rptQuYu.DataSource = lsNews;
                rptQuYu.DataBind();

                BindPageDown();
                BindPageUp();
            }
            else
            {
                this.ExportPageInfoUp.Visible   = false;
                this.ExportPageInfoDown.Visible = false;
            }

            this.Page.Title = string.Format(EyouSoft.Common.PageTitle.Information_List_Title, provinceName + "-大全");
            AddMetaTag("keywords", string.Format(EyouSoft.Common.PageTitle.Information_List_Keywords, provinceName));
            AddMetaTag("description", string.Format(EyouSoft.Common.PageTitle.Information_List_Des, provinceName));
        }
Example #2
0
        /// <summary>
        /// 初始化资讯列表
        /// </summary>
        private void InitList(int typeId)
        {
            EyouSoft.BLL.NewsStructure.NewsBll bll = new EyouSoft.BLL.NewsStructure.NewsBll();
            lsNews = new List <EyouSoft.Model.NewsStructure.NewsModel>();

            //typeId=0表示是推荐资讯列表
            if (typeId == 0)
            {
                cateName         = "推荐资讯";
                queryModel       = new EyouSoft.Model.NewsStructure.SearchOrderInfo();
                queryModel.IsPic = true;
                lsNews           = bll.GetList(pageSize, pageIndex, ref recordCount, queryModel);
            }
            //不为0表示专题列表
            else
            {
                if (newTypeBll.GetCategoryById(typeId) != null)
                {
                    cateName  = ((EyouSoft.Model.NewsStructure.NewsCategory)newTypeBll.GetCategoryById(typeId)).ToString();
                    className = newTypeBll.GetNewsTypeName(typeId).ToString();
                }

                queryModel      = new EyouSoft.Model.NewsStructure.SearchOrderInfo();
                queryModel.Type = typeId;
                lsNews          = bll.GetList(pageSize, pageIndex, ref recordCount, queryModel);
            }

            if (lsNews != null && lsNews.Count > 0)
            {
                rptList.DataSource = lsNews;
                rptList.DataBind();

                BindPageDown();
                BindPageUp();
            }
            else
            {
                this.ExportPageInfoDown.Visible = false;
                this.ExportPageInfoUp.Visible   = false;
            }

            this.Page.Title = string.Format(EyouSoft.Common.PageTitle.Information_List_Title, cateName == ""?className:cateName);
            AddMetaTag("keywords", string.Format(EyouSoft.Common.PageTitle.Information_List_Keywords, cateName == ""?className:cateName));
            AddMetaTag("description", string.Format(EyouSoft.Common.PageTitle.Information_List_Des, cateName == ""?className:cateName));
        }
Example #3
0
        /// <summary>
        /// 显示全国信息
        /// </summary>
        /// <returns></returns>
        private void ShowQuanGuoNews()
        {
            int pageSize    = 1;
            int pageIndex   = 1;
            int recordCount = 0;

            EyouSoft.Model.NewsStructure.SearchOrderInfo   queryModel = null;
            EyouSoft.BLL.NewsStructure.NewsBll             bll        = new EyouSoft.BLL.NewsStructure.NewsBll();
            IList <EyouSoft.Model.NewsStructure.NewsModel> lsNews     = new List <EyouSoft.Model.NewsStructure.NewsModel>();

            queryModel            = new EyouSoft.Model.NewsStructure.SearchOrderInfo();
            queryModel.ProvinceId = 35;
            lsNews = bll.GetList(pageSize, pageIndex, ref recordCount, queryModel);
            if (lsNews != null)
            {
                if (lsNews.Count > 0)
                {
                    string url = EyouSoft.Common.URLREWRITE.Infomation.GetNewsListAreaUrl(35);
                    ShowQuanGuoHtml = string.Format("<a href='{0}' target=\"_blank\">全国</a> ", url);
                }
            }
        }
Example #4
0
        /// <summary>
        /// 删除新闻
        /// </summary>
        /// <param name="Id"></param>
        private void DelNew(int Id)
        {
            EyouSoft.BLL.NewsStructure.NewsBll NewsBll = new EyouSoft.BLL.NewsStructure.NewsBll();
            //标题
            string Title = Utils.GetQueryStringValue("Title");

            //页数
            CurrencyPage = Utils.GetInt(Utils.GetQueryStringValue("page"), 1);
            //类别
            int ClassId = Utils.GetInt(Utils.GetQueryStringValue("ClassId"));
            //省份
            int ProId = Utils.GetInt(Utils.GetQueryStringValue("ProId"));
            //城市
            int CityId = Utils.GetInt(Utils.GetQueryStringValue("CityId"));
            //排序
            int Zhidin = Utils.GetInt(Utils.GetQueryStringValue("selZhidin"));
            //推荐
            string TueiJian = Utils.GetQueryStringValue("chkTueiJian").ToLower();

            if (NewsBll.DelNews(Id))
            {
                Utils.ShowAndRedirect("删除成功", string.Format("NewsList.aspx?Title={0}&ClassId={1}&page={2}&ProId={3}&CityId={4}&selZhidin={5}&chkTueiJian={6}", Title, ClassId, CurrencyPage, ProId, CityId, Zhidin, TueiJian));
            }
        }
Example #5
0
        /// <summary>
        /// 新闻列表初始化
        /// </summary>
        private void DataInit()
        {
            EyouSoft.Model.NewsStructure.SearchOrderInfo SearchOrderInfo = new EyouSoft.Model.NewsStructure.SearchOrderInfo();
            //标题
            string Title = Utils.GetQueryStringValue("Title");

            //页数
            CurrencyPage = Utils.GetInt(Utils.GetQueryStringValue("page"), 1);
            //类别
            int ClassId = Utils.GetInt(Utils.GetQueryStringValue("ClassId"));
            //省份
            int ProId = Utils.GetInt(Utils.GetQueryStringValue("ProId"));
            //城市
            int CityId = Utils.GetInt(Utils.GetQueryStringValue("CityId"));
            //排序
            int Zhidin = Utils.GetInt(Utils.GetQueryStringValue("selZhidin"));
            //推荐
            string TueiJian = Utils.GetQueryStringValue("chkTueiJian").ToLower();

            SearchOrderInfo.Title = Title;
            if (ClassId != 0)
            {
                SearchOrderInfo.Type = ClassId;
            }
            if (ProId != 0)
            {
                SearchOrderInfo.ProvinceId = ProId;
            }
            if (CityId != 0)
            {
                SearchOrderInfo.City = CityId;
            }
            if (TueiJian == "true")
            {
                SearchOrderInfo.IsRecPositionId = true;
            }
            if (Zhidin != 0)
            {
                SearchOrderInfo.Source = (EyouSoft.Model.NewsStructure.AfficheSource)Zhidin;
            }

            if (ProId != 0)
            {
                ProvinceAndCityList1.SetProvinceId = ProId;
            }
            if (CityId != 0)
            {
                ProvinceAndCityList1.SetCityId = CityId;
            }
            if (Zhidin != 0)
            {
                selZhidin.Items.FindByValue(Zhidin.ToString()).Selected = true;
            }
            if (ClassId != 0)
            {
                selNewClass.Items.FindByValue(ClassId.ToString()).Selected = true;
            }
            chkTueiJian.Checked = TueiJian == "true" ? true : false;
            txtNewTitle.Value   = Title;
            EyouSoft.BLL.NewsStructure.NewsBll             NewsBll = new EyouSoft.BLL.NewsStructure.NewsBll();
            IList <EyouSoft.Model.NewsStructure.NewsModel> list    = NewsBll.GetList(intPageSize, CurrencyPage, ref RecordCount, SearchOrderInfo);

            this.repList.DataSource = list;
            this.repList.DataBind();
            BindFenYe();
        }
Example #6
0
        /// <summary>
        /// 新闻数据初始化
        /// </summary>
        private void DataInit()
        {
            //新闻编号
            int NewId = Utils.GetInt(Utils.GetQueryStringValue("Id"));

            EyouSoft.BLL.NewsStructure.NewsBll     NewsBll   = new EyouSoft.BLL.NewsStructure.NewsBll();
            EyouSoft.Model.NewsStructure.NewsModel NewsModel = NewsBll.GetModel(NewId);
            BindNewsClass();
            BindAfficheSource();
            BindRecPosition();
            if (NewsModel != null)
            {
                //省份
                ProvinceAndCityList1.SetProvinceId = NewsModel.ProvinceId;
                //城市
                ProvinceAndCityList1.SetCityId = NewsModel.CityId;
                //新闻类别
                ddlNewsClass.SelectedValue = NewsModel.AfficheClass.ToString();
                //新闻标题
                txtNewsTitle.Value = NewsModel.AfficheTitle;
                //修改时间
                UpdateTime.Value = NewsModel.UpdateTime.ToString();
                //新闻推荐位置类别
                if (NewsModel.RecPositionId != null)
                {
                    foreach (EyouSoft.Model.NewsStructure.RecPosition re in NewsModel.RecPositionId)
                    {
                        try
                        {
                            chkRecPositionList.Items.FindByValue(((int)re).ToString()).Selected = true;
                        }
                        catch
                        {
                        }
                    }
                    //当推荐位置为URL跳转,跳转到的URL
                    if (chkRecPositionList.Items.FindByValue(((int)EyouSoft.Model.NewsStructure.RecPosition.URL跳转).ToString()).Selected == true)
                    {
                        drumpUr2.Value = NewsModel.GotoUrl;
                    }
                }
                //标题颜色
                selTitleColor.Value = NewsModel.TitleColor;
                #region 当前新闻的关键字
                if (NewsModel.NewsKeyWordItem != null)
                {
                    foreach (EyouSoft.Model.NewsStructure.NewsSubItem str in NewsModel.NewsKeyWordItem)
                    {
                        txtNewsKeys.Value   += str.ItemName + " ";
                        hidNewsKeysId.Value += str.ItemId + ",";
                    }
                    //新闻关键字
                    txtNewsKeys.Value   = txtNewsKeys.Value.TrimEnd(' ');
                    hidNewsKeysId.Value = hidNewsKeysId.Value.TrimEnd(',');
                }
                #endregion
                #region 当前新闻的Tags
                if (NewsModel.NewsTagItem != null)
                {
                    foreach (EyouSoft.Model.NewsStructure.NewsSubItem str in NewsModel.NewsTagItem)
                    {
                        txtNewsTags.Value   += str.ItemName + " ";
                        hidNewsTagsId.Value += str.ItemId + ",";
                    } //新闻Tag
                    txtNewsTags.Value   = txtNewsTags.Value.TrimEnd(' ');
                    hidNewsTagsId.Value = hidNewsTagsId.Value.TrimEnd(',');
                }
                #endregion
                //新闻描述
                txtNewsDesc.Value = NewsModel.AfficheDesc;
                //图片路径
                if (!string.IsNullOrEmpty(NewsModel.PicPath))
                {
                    lblImagePath.Visible     = true;
                    lblImagePath.NavigateUrl = Domain.FileSystem + NewsModel.PicPath;
                    ImagePath.Value          = NewsModel.PicPath;
                }
                //新闻来源
                txtNewsSource.Value = NewsModel.AfficheSource;
                //新闻作者
                txtNewsArticle.Value = NewsModel.AfficheAuthor;
                //新闻内容
                FCK_PlanTicketContent.Value = NewsModel.AfficheContent;
                //文章排序方式
                radSortList.SelectedValue = ((int)NewsModel.AfficheSort).ToString();
                DelLink.Checked           = true;
                downloadRemotePic.Checked = true;
                addKey.Checked            = true;
            }
            //添加时进行初始化
            else
            {
                //发布时,默认选中全国
                ProvinceAndCityList1.SetProvinceId = 35;
                addWater.Checked          = true;
                DelLink.Checked           = true;
                downloadRemotePic.Checked = true;
                addKey.Checked            = true;
                string NewSource = EyouSoft.Common.ConfigModel.ConfigClass.GetConfigString("NewsSource", MasterUserInfo.ID.ToString());
                if (!string.IsNullOrEmpty(NewSource) && NewSource.IndexOf(',') > 0)
                {
                    txtNewsSource.Value  = NewSource.Split(',')[0];
                    txtNewsArticle.Value = NewSource.Split(',')[1];
                }
            }
        }
Example #7
0
        /// <summary>
        /// 新闻修改
        /// </summary>
        private void DataSave()
        {
            #region 实例化
            //分页标示符
            string FengYeSign = string.Empty;
            switch (Request.Browser.Browser)
            {
            case "Firefox":
                FengYeSign = "<div style=\"page-break-after: always;\"><span style=\"display: none;\">&nbsp;</span></div>";
                break;

            case "IE":
                FengYeSign = "<div style=\"page-break-after: always\"><span style=\"display: none\">&nbsp;</span></div>";
                break;

            default:
                FengYeSign = "<div style=\"page-break-after: always;\"><span style=\"display: none;\">&nbsp;</span></div>";
                break;
            }
            //选中的关键字
            string[] NewsKeys1 = txtNewsKeys.Value.Split(' ');
            //填写的关键字
            string[] NewsKeys2 = txtNewsKey.Value.Split(' ');
            //选中的Tags
            string[] NewsTags1 = txtNewsTags.Value.Split(' ');
            //填写的Tags
            string[] NewsTags2 = txtNewsTag.Value.Split(' ');
            //新闻业务类
            EyouSoft.BLL.NewsStructure.NewsBll NewsBll = new EyouSoft.BLL.NewsStructure.NewsBll();
            //新闻综合实体
            EyouSoft.Model.NewsStructure.NewsModel NewsModel = new EyouSoft.Model.NewsStructure.NewsModel();
            //新闻关键字
            IList <EyouSoft.Model.NewsStructure.NewsSubItem> NewsKeyWordItem = new List <EyouSoft.Model.NewsStructure.NewsSubItem>();
            //Tag关联实体
            IList <EyouSoft.Model.NewsStructure.NewsSubItem> NewsTagItem = new List <EyouSoft.Model.NewsStructure.NewsSubItem>();
            //新闻内容分页列表实体
            IList <EyouSoft.Model.NewsStructure.NewsContent> NewsContentList = new List <EyouSoft.Model.NewsStructure.NewsContent>();
            //新闻的推荐位置
            IList <EyouSoft.Model.NewsStructure.RecPosition> RecPositionList = new List <EyouSoft.Model.NewsStructure.RecPosition>();
            #endregion

            #region 新闻基础信息

            //新闻编号
            int NewId = Utils.GetInt(Utils.GetQueryStringValue("Id"));
            //新闻主键编号
            NewsModel.Id = NewId;
            //新闻作者
            NewsModel.AfficheAuthor = txtNewsArticle.Value.Trim();
            //新闻描述
            NewsModel.AfficheDesc = txtNewsDesc.Value;
            //新闻的排序方式
            NewsModel.AfficheSort = (EyouSoft.Model.NewsStructure.AfficheSource)(Utils.GetInt(radSortList.SelectedValue));
            //新闻来源
            NewsModel.AfficheSource = txtNewsSource.Value;
            //新闻所属城市编号
            if (Utils.GetInt(CityId.Value) != 0)
            {
                NewsModel.CityId = Utils.GetInt(CityId.Value);
            }
            //新闻所属城市名称
            NewsModel.CityName = CityText.Value == "请选择" ? "" : CityText.Value;
            //新闻所属省份编号
            if (Utils.GetInt(ProvinceId.Value) != 0)
            {
                NewsModel.ProvinceId = Utils.GetInt(ProvinceId.Value);
            }
            //新闻所属省份名称
            NewsModel.ProvinceName = ProvinceText.Value == "请选择" ? "" : ProvinceText.Value;
            //新闻类别编号
            NewsModel.AfficheClass = Utils.GetInt(ddlNewsClass.SelectedValue);
            //新闻类别名称
            NewsModel.ClassName = ddlNewsClass.SelectedItem.Text;
            //新闻标题
            NewsModel.AfficheTitle = txtNewsTitle.Value;
            //操作人编号
            NewsModel.OperatorID = MasterUserInfo.ID;
            //操作人姓名
            NewsModel.OperatorName = MasterUserInfo.ContactName;
            //新闻图片路径
            NewsModel.PicPath = Utils.GetFormValue("SingleFileUpload1$hidFileName");
            if (string.IsNullOrEmpty(NewsModel.PicPath))
            {
                NewsModel.PicPath = ImagePath.Value;
            }
            else
            {
                NewsModel.PicPath = NewsModel.PicPath;
            }
            //新闻标题颜色代码
            NewsModel.TitleColor = selTitleColor.Value == "请选择" ? "" : selTitleColor.Value;
            //新闻内容
            Content = FCK_PlanTicketContent.Value;
            //添加时间
            NewsModel.IssueTime = System.DateTime.Now;
            if (DelLink.Checked)
            {
                DelSiteOutLink();
            }
            if (downloadRemotePic.Checked)
            {
                DownSource();
            }
            if (addKey.Checked)
            {
                ContentAddKeys();
            }
            NewsModel.AfficheContent = Content;

            #endregion

            #region 新闻推荐位置类别
            NewsModel.GotoUrl = "";
            foreach (ListItem item in chkRecPositionList.Items)
            {
                if (item.Selected)
                {
                    //当推荐位置为URL跳转,跳转到的URL
                    if ((EyouSoft.Model.NewsStructure.RecPosition)(Utils.GetInt(item.Value)) == EyouSoft.Model.NewsStructure.RecPosition.URL跳转)
                    {
                        if (!drumpUr2.Value.ToLower().StartsWith("http://"))
                        {
                            drumpUr2.Value = "http://" + drumpUr2.Value;
                        }
                        NewsModel.GotoUrl = drumpUr2.Value == "请输入跳转的网址" ? "" : drumpUr2.Value;
                    }
                    RecPositionList.Add((EyouSoft.Model.NewsStructure.RecPosition)(Utils.GetInt(item.Value)));
                }
            }
            NewsModel.RecPositionId = RecPositionList;
            #endregion

            #region 新闻关键字,Tag关联实体
            //选中的关键字
            for (int i = 0; i < NewsKeys1.Length; i++)
            {
                if (NewsKeys1[i] != "")
                {
                    EyouSoft.Model.NewsStructure.NewsSubItem NewsSubItem = new EyouSoft.Model.NewsStructure.NewsSubItem();
                    NewsSubItem.ItemId   = Utils.GetInt(hidNewsKeysId.Value.Split(',')[i]);
                    NewsSubItem.ItemName = NewsKeys1[i];
                    NewsSubItem.ItemType = EyouSoft.Model.NewsStructure.ItemCategory.KeyWord;
                    NewsKeyWordItem.Add(NewsSubItem);
                }
            }
            //填写的关键字
            if (chkSaveKeys.Checked)
            {
                for (int i = 0; i < NewsKeys2.Length; i++)
                {
                    //该填写的关键字是否选过
                    bool isZxist = false;
                    foreach (var item in NewsKeyWordItem)
                    {
                        if (NewsKeys2[i] == item.ItemName)
                        {
                            isZxist = true;
                            break;
                        }
                    }
                    if (NewsKeys2[i] != "" && NewsKeys2[i] != "多个用空格隔开" && !isZxist)
                    {
                        EyouSoft.Model.NewsStructure.NewsSubItem NewsSubItem = new EyouSoft.Model.NewsStructure.NewsSubItem();
                        NewsSubItem.ItemId   = 0;
                        NewsSubItem.ItemName = NewsKeys2[i];
                        NewsSubItem.ItemType = EyouSoft.Model.NewsStructure.ItemCategory.KeyWord;
                        NewsKeyWordItem.Add(NewsSubItem);
                    }
                }
            }
            //选中的Tags
            for (int i = 0; i < NewsTags1.Length; i++)
            {
                if (NewsTags1[i] != "")
                {
                    EyouSoft.Model.NewsStructure.NewsSubItem NewsSubItem = new EyouSoft.Model.NewsStructure.NewsSubItem();
                    NewsSubItem.ItemId   = Utils.GetInt(hidNewsTagsId.Value.Split(',')[i]);
                    NewsSubItem.ItemName = NewsTags1[i];
                    NewsSubItem.ItemType = EyouSoft.Model.NewsStructure.ItemCategory.Tag;
                    NewsTagItem.Add(NewsSubItem);
                }
            }
            //填写的Tags
            if (chkSaveTags.Checked)
            {
                for (int i = 0; i < NewsTags2.Length; i++)
                {
                    //该填写的Tag是否选过
                    bool isZxist = false;
                    foreach (var item in NewsTagItem)
                    {
                        if (NewsTags2[i] == item.ItemName)
                        {
                            isZxist = true;
                            break;
                        }
                    }
                    if (NewsTags2[i] != "" && NewsTags2[i] != "多个用空格隔开" && !isZxist)
                    {
                        EyouSoft.Model.NewsStructure.NewsSubItem NewsSubItem = new EyouSoft.Model.NewsStructure.NewsSubItem();
                        NewsSubItem.ItemId   = 0;
                        NewsSubItem.ItemName = NewsTags2[i];
                        NewsSubItem.ItemType = EyouSoft.Model.NewsStructure.ItemCategory.Tag;
                        NewsTagItem.Add(NewsSubItem);
                    }
                }
            }
            NewsModel.NewsTagItem     = NewsTagItem;
            NewsModel.NewsKeyWordItem = NewsKeyWordItem;
            #endregion

            #region 新闻的排序方式
            NewsModel.AfficheSort = (EyouSoft.Model.NewsStructure.AfficheSource)(Utils.GetInt(radSortList.SelectedValue));
            switch (NewsModel.AfficheSort)
            {
            case EyouSoft.Model.NewsStructure.AfficheSource.置顶半年:
                NewsModel.UpdateTime = DateTime.Now.AddMonths(6);
                break;

            case EyouSoft.Model.NewsStructure.AfficheSource.置顶三个月:
                NewsModel.UpdateTime = DateTime.Now.AddMonths(3);
                break;

            case EyouSoft.Model.NewsStructure.AfficheSource.置顶一个月:
                NewsModel.UpdateTime = DateTime.Now.AddMonths(1);
                break;

            case EyouSoft.Model.NewsStructure.AfficheSource.置顶一年:
                NewsModel.UpdateTime = DateTime.Now.AddMonths(12);
                break;

            case EyouSoft.Model.NewsStructure.AfficheSource.置顶一周:
                NewsModel.UpdateTime = DateTime.Now.AddDays(7);
                break;

            default: break;
            }
            #endregion

            #region 新闻内容分页实体
            string[] AfficheContent = System.Text.RegularExpressions.Regex.Split(NewsModel.AfficheContent, FengYeSign, System.Text.RegularExpressions.RegexOptions.IgnoreCase);
            for (int i = 0; i < AfficheContent.Length; i++)
            {
                EyouSoft.Model.NewsStructure.NewsContent NewsContent = new EyouSoft.Model.NewsStructure.NewsContent();
                if (!string.IsNullOrEmpty(AfficheContent[i]))
                {
                    NewsContent.Content   = AfficheContent[i];
                    NewsContent.PageIndex = i + 1;
                    NewsContentList.Add(NewsContent);
                }
            }
            NewsModel.AffichePageNum = NewsContentList.Count;
            NewsModel.NewsContent    = NewsContentList;
            #endregion

            #region 保存
            //没有新闻ID,则添加
            if (NewId == 0)
            {
                switch (NewsModel.AfficheSort)
                {
                case EyouSoft.Model.NewsStructure.AfficheSource.默认排序:
                    NewsModel.UpdateTime = DateTime.Now;
                    break;

                case EyouSoft.Model.NewsStructure.AfficheSource.置顶半年:
                    NewsModel.UpdateTime = DateTime.Now.AddMonths(6);
                    break;

                case EyouSoft.Model.NewsStructure.AfficheSource.置顶三个月:
                    NewsModel.UpdateTime = DateTime.Now.AddMonths(3);
                    break;

                case EyouSoft.Model.NewsStructure.AfficheSource.置顶一个月:
                    NewsModel.UpdateTime = DateTime.Now.AddMonths(1);
                    break;

                case EyouSoft.Model.NewsStructure.AfficheSource.置顶一年:
                    NewsModel.UpdateTime = DateTime.Now.AddMonths(12);
                    break;

                case EyouSoft.Model.NewsStructure.AfficheSource.置顶一周:
                    NewsModel.UpdateTime = DateTime.Now.AddDays(7);
                    break;

                default: break;
                }
                NewsModel.ModifyTime = DateTime.Now;
                NewsModel.IssueTime  = DateTime.Now;
                if (NewsBll.AddNews(NewsModel))
                {
                    this.btnSave.Visible = true;
                    SaveInit();
                    MessageBox.ResponseScript(this, "if(!confirm('添加成功,是否继续发布 !')){ window.location.href='NewsList.aspx'}");
                }
            }
            //有新闻ID,则修改
            else if (NewId > 0)
            {
                NewsModel.UpdateTime = Utils.GetDateTime(UpdateTime.Value);
                NewsModel.ModifyTime = NewsModel.UpdateTime;
                switch (NewsModel.AfficheSort)
                {
                case EyouSoft.Model.NewsStructure.AfficheSource.默认排序:
                    NewsModel.UpdateTime = NewsModel.UpdateTime;
                    break;

                case EyouSoft.Model.NewsStructure.AfficheSource.置顶半年:
                    NewsModel.UpdateTime = NewsModel.UpdateTime.AddMonths(6);
                    break;

                case EyouSoft.Model.NewsStructure.AfficheSource.置顶三个月:
                    NewsModel.UpdateTime = NewsModel.UpdateTime.AddMonths(3);
                    break;

                case EyouSoft.Model.NewsStructure.AfficheSource.置顶一个月:
                    NewsModel.UpdateTime = NewsModel.UpdateTime.AddMonths(1);
                    break;

                case EyouSoft.Model.NewsStructure.AfficheSource.置顶一年:
                    NewsModel.UpdateTime = NewsModel.UpdateTime.AddMonths(12);
                    break;

                case EyouSoft.Model.NewsStructure.AfficheSource.置顶一周:
                    NewsModel.UpdateTime = NewsModel.UpdateTime.AddDays(7);
                    break;

                default: break;
                }
                if (NewsBll.UpdateNews(NewsModel))
                {
                    this.btnSave.Visible = true;
                    MessageBox.ShowAndRedirect(this, "修改成功", "NewsList.aspx");
                }
            }
            #endregion
        }