using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.DataSetExtensions;
using System.Xml;
using System.Xml.Linq;
using System.Data.SqlClient;
namespace DAL
{
    public class news
    {
        public bool insert(MODEL.news New)
        {
            string sql = "insert into T_News values (@n_theme,@n_time,@n_content,@n_picture)";
            List<SqlParameter> lists = new List<SqlParameter>();
            lists.Add(new SqlParameter("@n_theme", New.n_theme));
            lists.Add(new SqlParameter("@n_time", New.n_time));
            lists.Add(new SqlParameter("@n_content", New.n_content));
            lists.Add(new SqlParameter("@n_picture", New.n_picture));
            return DBUtility.SQLHelper.Execute(sql, lists);
        }
        public bool delete(string n_noticid)
        {
            string sql = "delete from T_News where n_noticid=@n_noticid";
            List<SqlParameter> lists = new List<SqlParameter>();
            lists.Add(new SqlParameter("@n_noticid", n_noticid));
            return DBUtility.SQLHelper.Execute(sql, lists);
        }
        public DataTable select(string strWhere)
        {
            string sql = "select * from T_News";
            if (strWhere != "")
            {
                sql += " where " + strWhere;
            }
            return DBUtility.SQLHelper.GetDataTable(sql);
        }
    }
}
