using System;
using System.Data;
using System.Collections.Generic;
using ZXDT.CallCenter.Model;
namespace ZXDT.CallCenter.BLL
{
	/// <summary>
	/// T_Good_TransInfo
	/// </summary>
	public partial class T_Good_TransInfo
	{
		private readonly ZXDT.CallCenter.DAL.T_Good_TransInfo dal=new ZXDT.CallCenter.DAL.T_Good_TransInfo();
		public T_Good_TransInfo()
		{}
		#region  BasicMethod

		
		/// <summary>
		/// 增加一条数据
		/// </summary>
		public int  Add(ZXDT.CallCenter.Model.T_Good_TransInfo model)
		{
			return dal.Add(model);
		}

		/// <summary>
		/// 更新一条数据
		/// </summary>
		public bool Update(ZXDT.CallCenter.Model.T_Good_TransInfo model)
		{
			return dal.Update(model);
		}

		/// <summary>
		/// 删除一条数据
		/// </summary>
		public bool Delete(int id)
		{
			
			return dal.Delete(id);
		}
		/// <summary>
		/// 删除一条数据
		/// </summary>
		public bool DeleteList(string idlist )
		{
			return dal.DeleteList(idlist );
		}

		/// <summary>
		/// 得到一个对象实体
		/// </summary>
		public ZXDT.CallCenter.Model.T_Good_TransInfo GetModel(int id)
		{
			
			return dal.GetModel(id);
		}

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<ZXDT.CallCenter.Model.T_Good_TransInfo> GetModelList(string strWhere)
        {
            DataSet ds = dal.GetList(strWhere);
            return DataTableToList(ds.Tables[0]);
        }
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<ZXDT.CallCenter.Model.T_Good_TransInfo> DataTableToList(DataTable dt)
        {
            List<ZXDT.CallCenter.Model.T_Good_TransInfo> modelList = new List<ZXDT.CallCenter.Model.T_Good_TransInfo>();
            int rowsCount = dt.Rows.Count;
            if (rowsCount > 0)
            {
                ZXDT.CallCenter.Model.T_Good_TransInfo model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = dal.DataRowToModel(dt.Rows[n]);
                    if (model != null)
                    {
                        modelList.Add(model);
                    }
                }
            }
            return modelList;
        }
		#endregion  BasicMethod
		
	}
}

