private void rptlistBind()
 {
     Model.PageData <Model.Article> data = new DAL.Article().GetList(9, 1, "ClassID=" + classid + " and IsDelete=0 and IsPass=1", "Sort asc");
     rptlist.DataSource = data.DataSoure;
     rptlist.DataBind();
     hiddCount.Value = data.Count.ToString();
 }
    private void newsBind()
    {
        Model.Article model = new BLL.Article().GetModelBystrWhere("ID=" + id + " and IsDelete=0 and IsPass=1 ");
        if (model == null)
        {
            MessageBox.ShowRedirect("参数错误!", "/cn/news");
        }
        lit_Contents.Text = model.Contents;
        lit_AddTime.Text  = model.AddTime.Value.ToString("yyyy-MM-dd");
        lit_Sources.Text  = model.Sources;
        lit_Title.Text    = model.Title;
        lit_list.Text     = "<a href='Default.aspx?classid=" + model.ClassID.Value + "'>返回列表</a>";
        if (!String.IsNullOrEmpty(model.PageTitle))
        {
            this.Title = model.PageTitle;
        }
        if (!String.IsNullOrEmpty(model.Matedescription))
        {
            base.MateDescription = model.Matedescription;
        }
        if (!String.IsNullOrEmpty(model.Matekeyword))
        {
            base.MetaKeywords = model.Matekeyword;
        }
        NewsTypeBind(model);
        NewsTypeBind(model);
        List <Model.Article> nextlist = new DAL.Article().GetList(1, "ClassID=" + model.ClassID.Value + " and IsDelete=0 and IsPass=1 and ID >" + model.ID.Value + " and Sort>=" + model.Sort.Value, "Sort asc");

        if (nextlist != null && nextlist.Count > 0)
        {
            lit_NextNews.Text = "<span><a href=\"detail.aspx?id=" + nextlist[0].ID.Value + "\">下一页</a></span>";
        }
        List <Model.Article> prelist = new DAL.Article().GetList(1, "ClassID=" + model.ClassID.Value + " and IsDelete=0 and IsPass=1 and ID <" + model.ID.Value + " and Sort<=" + model.Sort.Value, "Sort asc");

        if (prelist != null && prelist.Count > 0)
        {
            lit_PreNews.Text = "<span><a href=\"detail.aspx?id=" + prelist[0].ID.Value + "\">上一页</a></span> &nbsp;&nbsp;&nbsp;&nbsp;";
        }
    }
 /// <summary>
 /// Create a new Article object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="employeId">Initial value of the EmployeId property.</param>
 /// <param name="titre">Initial value of the Titre property.</param>
 /// <param name="date">Initial value of the Date property.</param>
 /// <param name="contenu">Initial value of the Contenu property.</param>
 /// <param name="photo">Initial value of the Photo property.</param>
 public static Article CreateArticle(global::System.Int32 id, global::System.Int32 employeId, global::System.String titre, global::System.DateTime date, global::System.String contenu, global::System.Byte[] photo)
 {
     Article article = new Article();
     article.Id = id;
     article.EmployeId = employeId;
     article.Titre = titre;
     article.Date = date;
     article.Contenu = contenu;
     article.Photo = photo;
     return article;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the Articles EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToArticles(Article article)
 {
     base.AddObject("Articles", article);
 }
Exemplo n.º 5
0
 public Article()
 {
     d_Article = new DAL.Article();
 }