using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Models;
using LoveBLL;


namespace LoveWeb
{
    public partial class index1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //ControlHelper.AddStyleSheet(this.Page, "css/index11.css");    
            if (!IsPostBack)
            {
                NewsBind();
                ArtiBind();
                InviBind();
            }
        }
        public void InviBind()
        {
            PagedDataSource pds = new PagedDataSource();
            pds.DataSource = InvitationManager.GetInviPart();
            DataList3.DataSource = pds;
            DataList3.DataBind();

        }
        public void NewsBind()
        {
            PagedDataSource pds = new PagedDataSource();
            pds.DataSource = NewsManager.GetPartNews();
            DataList1.DataSource = pds;
            DataList1.DataBind();

        }

        public void ArtiBind()
        {
            PagedDataSource pds = new PagedDataSource();
            pds.DataSource = ArticleManager.GetArticlePart();
            DataList2.DataSource = pds;
            DataList2.DataBind();

        }

        public static string GetPartString(string news_contents, int num)
        {
            return NewsManager.GetPartString(news_contents, num);
        }
    }
}
