Пример #1
0
    public void BindData()
    {
        NewsInfo newsInfo = NewsInfo.Read(int.Parse(base.Request["id"]));

        this.lb_newsTitle.Text   = newsInfo.Title;
        this.lb_newsDate.Text    = newsInfo.AddDate.ToString();
        this.lb_newsContent.Text = newsInfo.Conent;
        NewsSortInfo newsSortInfo = NewsSortInfo.Read(newsInfo.SortId);

        this.lb_newscate.Text = newsSortInfo.SortName;
    }
Пример #2
0
    public static List <NewsSortInfo> ReadList(string whereStr)
    {
        List <NewsSortInfo> list        = new List <NewsSortInfo>();
        Database            database    = new Database();
        DataView            defaultView = database.RunProc("select * from NewsSort " + whereStr).Tables[0].DefaultView;

        for (int i = 0; i < defaultView.Count; i++)
        {
            list.Add(NewsSortInfo.Read(int.Parse(defaultView[i]["id"].ToString())));
        }
        database.Dispose();
        return(list);
    }