Exemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         int newsId = Convert.ToInt32(Context.Request.Params.Get("newsId"));
         newsModel                 = newsBll.GetModel(newsId);
         this.txtTitle.Text        = newsModel.Title;
         this.txtNTypes.Text       = newsModel.NTypes;
         this.txtContent.InnerHtml = newsModel.Content;
         this.PathDisplayer.Text   = newsModel.PhotoUrl;
         initDate = newsModel.PushTime.ToString();
         this.txtStates1.Checked = newsModel.States == 1 ? true : false;
     }
 }
Exemplo n.º 2
0
 public void GetNewsInfo()
 {
     model = bll.GetModel(_Pid);
     if (model != null)
     {
         this.ddlType.SelectedValue = model.CategoryId.ToString();                                //新闻所属类别
         this.txtTitle.Text         = model.Title;                                                //新闻标题
         this.txtSubHead.Text       = model.SubHead;                                              //新闻副标题
         this.txtUnit.Text          = model.PublicationUnit;                                      //新闻作者
         this.txtFromSouce.Text     = model.FromSource;                                           //新闻来源
         //this.txtKeyWord.Text = model.KeyWord;//新闻关键字
         this.txtReleaseDate.Text = Convert.ToDateTime(model.ReleaseDate).ToString("yyyy-MM-dd"); //发布日期
         //this.radioTopList.SelectedValue = model.IsTop.ToString();//是否置顶
         this.radioIndexCommentList.SelectedValue = model.IndexCommend.ToString();                //是否首页推荐
         this.rbtIstop.SelectedValue = model.IsTop.ToString();                                    //是否置顶
         this.rbtHot.SelectedValue   = model.HotPic.ToString();                                   //是否显示‘news’
         this.txtHotDays.Text        = model.HotDays.ToString();                                  //'news'显示天数(默认为3天)
         this.txtSort.Text           = model.Sort.ToString();                                     //排序编号,数字越小排序越靠前
         if (model.ArticleType.ToString() == "1")
         {
             this.picUpload.Visible = true;
         }
         this.fckBody.Text = model.Body;                               //新闻内容
         this.radioApproved.SelectedValue = model.Approved.ToString(); //审核状态
         //显示图片
         if (model.ImgLink != "")
         {
             ViewState["ImgLink"] = model.ImgLink;
             this.uploadimage.Src = "~" + model.ImgLink;
         }
         else
         {
             ViewState["ImgLink"] = "";
             this.uploadimage.Src = "../../../Images/nopic.jpg";
         }
     }
 }