using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient; 
namespace DAL
{
    public class geyan
    {
        public bool insert(MODEL.geyan geyan)
        {
            string sql = "insert into T_Geyan values (@a_theme,@a_content,@a_time)";
            List<SqlParameter> lists = new List<SqlParameter>();
            lists.Add(new SqlParameter("@a_theme", geyan.a_theme));
            //lists.Add(new SqlParameter("@a_content", geyan.a_content));
            lists.Add(new SqlParameter("@a_time", geyan.a_time));
            return DBUtility.SQLHelper.Execute(sql, lists);
        }
        public bool delete(string a_ID)
        {
            string sql = "delete from T_Geyan where a_ID=@a_ID";
            List<SqlParameter> lists = new List<SqlParameter>();
            lists.Add(new SqlParameter("@a_ID", a_ID));
            return DBUtility.SQLHelper.Execute(sql, lists);
        }
        public DataTable select(string strWhere)
        {
            string sql = "select * from T_Geyan";
            if (strWhere != "")
            {
                sql += " where " + strWhere;
            }
            return DBUtility.SQLHelper.GetDataTable(sql);
        }
    }
}
