using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace HySoft.BaseCallCenter.BLL
{
    /// <summary>
    /// T_Sys_TempItems
    /// </summary>
    public partial class T_Sys_TempItems
    {
        private readonly HySoft.BaseCallCenter.DAL.T_Sys_TempItems dal = new HySoft.BaseCallCenter.DAL.T_Sys_TempItems();
        public T_Sys_TempItems()
        { }
        #region  Method
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool Exists(int F_Id)
        {
            return dal.Exists(F_Id);
        }

        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(HySoft.BaseCallCenter.Model.T_Sys_TempItems model)
        {
            return dal.Add(model);
        }

        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(HySoft.BaseCallCenter.Model.T_Sys_TempItems model)
        {
            return dal.Update(model);
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool Delete(int F_Id)
        {

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

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public HySoft.BaseCallCenter.Model.T_Sys_TempItems GetModel(int F_Id)
        {

            return dal.GetModel(F_Id);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            return dal.GetList(strWhere);
        }
        /// <summary>
        /// 获得前几行数据
        /// </summary>
        public DataSet GetList(int Top, string strWhere, string filedOrder)
        {
            return dal.GetList(Top, strWhere, filedOrder);
        }
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<HySoft.BaseCallCenter.Model.T_Sys_TempItems> GetModelList(string strWhere)
        {
            DataSet ds = dal.GetList(strWhere);
            return DataTableToList(ds.Tables[0]);
        }
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<HySoft.BaseCallCenter.Model.T_Sys_TempItems> DataTableToList(DataTable dt)
        {
            List<HySoft.BaseCallCenter.Model.T_Sys_TempItems> modelList = new List<HySoft.BaseCallCenter.Model.T_Sys_TempItems>();
            int rowsCount = dt.Rows.Count;
            if (rowsCount > 0)
            {
                HySoft.BaseCallCenter.Model.T_Sys_TempItems model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new HySoft.BaseCallCenter.Model.T_Sys_TempItems();
                    if (dt.Rows[n]["F_Id"] != null && dt.Rows[n]["F_Id"].ToString() != "")
                    {
                        model.F_Id = int.Parse(dt.Rows[n]["F_Id"].ToString());
                    }
                    if (dt.Rows[n]["F_TempName"] != null && dt.Rows[n]["F_TempName"].ToString() != "")
                    {
                        model.F_TempName = dt.Rows[n]["F_TempName"].ToString();
                    }
                    if (dt.Rows[n]["F_UserId"] != null && dt.Rows[n]["F_UserId"].ToString() != "")
                    {
                        model.F_UserId = int.Parse(dt.Rows[n]["F_UserId"].ToString());
                    }
                    if (dt.Rows[n]["ExpandIntField1"] != null && dt.Rows[n]["ExpandIntField1"].ToString() != "")
                    {
                        model.ExpandIntField1 = int.Parse(dt.Rows[n]["ExpandIntField1"].ToString());
                    }
                    if (dt.Rows[n]["ExpandIntField2"] != null && dt.Rows[n]["ExpandIntField2"].ToString() != "")
                    {
                        model.ExpandIntField2 = int.Parse(dt.Rows[n]["ExpandIntField2"].ToString());
                    }
                    if (dt.Rows[n]["ExpandIntField3"] != null && dt.Rows[n]["ExpandIntField3"].ToString() != "")
                    {
                        model.ExpandIntField3 = int.Parse(dt.Rows[n]["ExpandIntField3"].ToString());
                    }
                    if (dt.Rows[n]["ExpandIntField4"] != null && dt.Rows[n]["ExpandIntField4"].ToString() != "")
                    {
                        model.ExpandIntField4 = int.Parse(dt.Rows[n]["ExpandIntField4"].ToString());
                    }
                    if (dt.Rows[n]["ExpandIntField5"] != null && dt.Rows[n]["ExpandIntField5"].ToString() != "")
                    {
                        model.ExpandIntField5 = int.Parse(dt.Rows[n]["ExpandIntField5"].ToString());
                    }
                    if (dt.Rows[n]["ExpandIntField6"] != null && dt.Rows[n]["ExpandIntField6"].ToString() != "")
                    {
                        model.ExpandIntField6 = int.Parse(dt.Rows[n]["ExpandIntField6"].ToString());
                    }
                    if (dt.Rows[n]["ExpandDecField1"] != null && dt.Rows[n]["ExpandDecField1"].ToString() != "")
                    {
                        model.ExpandDecField1 = decimal.Parse(dt.Rows[n]["ExpandDecField1"].ToString());
                    }
                    if (dt.Rows[n]["ExpandDecField2"] != null && dt.Rows[n]["ExpandDecField2"].ToString() != "")
                    {
                        model.ExpandDecField2 = decimal.Parse(dt.Rows[n]["ExpandDecField2"].ToString());
                    }
                    if (dt.Rows[n]["ExpandDecField3"] != null && dt.Rows[n]["ExpandDecField3"].ToString() != "")
                    {
                        model.ExpandDecField3 = decimal.Parse(dt.Rows[n]["ExpandDecField3"].ToString());
                    }
                    if (dt.Rows[n]["ExpandDecField4"] != null && dt.Rows[n]["ExpandDecField4"].ToString() != "")
                    {
                        model.ExpandDecField4 = decimal.Parse(dt.Rows[n]["ExpandDecField4"].ToString());
                    }
                    if (dt.Rows[n]["ExpandDecField5"] != null && dt.Rows[n]["ExpandDecField5"].ToString() != "")
                    {
                        model.ExpandDecField5 = decimal.Parse(dt.Rows[n]["ExpandDecField5"].ToString());
                    }
                    if (dt.Rows[n]["ExpandDecField6"] != null && dt.Rows[n]["ExpandDecField6"].ToString() != "")
                    {
                        model.ExpandDecField6 = decimal.Parse(dt.Rows[n]["ExpandDecField6"].ToString());
                    }
                    if (dt.Rows[n]["ExpandDatField1"] != null && dt.Rows[n]["ExpandDatField1"].ToString() != "")
                    {
                        model.ExpandDatField1 = DateTime.Parse(dt.Rows[n]["ExpandDatField1"].ToString());
                    }
                    if (dt.Rows[n]["ExpandDatField2"] != null && dt.Rows[n]["ExpandDatField2"].ToString() != "")
                    {
                        model.ExpandDatField2 = DateTime.Parse(dt.Rows[n]["ExpandDatField2"].ToString());
                    }
                    if (dt.Rows[n]["ExpandDatField3"] != null && dt.Rows[n]["ExpandDatField3"].ToString() != "")
                    {
                        model.ExpandDatField3 = DateTime.Parse(dt.Rows[n]["ExpandDatField3"].ToString());
                    }
                    if (dt.Rows[n]["ExpandDatField4"] != null && dt.Rows[n]["ExpandDatField4"].ToString() != "")
                    {
                        model.ExpandDatField4 = DateTime.Parse(dt.Rows[n]["ExpandDatField4"].ToString());
                    }
                    if (dt.Rows[n]["ExpandDatField5"] != null && dt.Rows[n]["ExpandDatField5"].ToString() != "")
                    {
                        model.ExpandDatField5 = DateTime.Parse(dt.Rows[n]["ExpandDatField5"].ToString());
                    }
                    if (dt.Rows[n]["ExpandDatField6"] != null && dt.Rows[n]["ExpandDatField6"].ToString() != "")
                    {
                        model.ExpandDatField6 = DateTime.Parse(dt.Rows[n]["ExpandDatField6"].ToString());
                    }
                    if (dt.Rows[n]["ExpandVchField1"] != null && dt.Rows[n]["ExpandVchField1"].ToString() != "")
                    {
                        model.ExpandVchField1 = dt.Rows[n]["ExpandVchField1"].ToString();
                    }
                    if (dt.Rows[n]["ExpandVchField2"] != null && dt.Rows[n]["ExpandVchField2"].ToString() != "")
                    {
                        model.ExpandVchField2 = dt.Rows[n]["ExpandVchField2"].ToString();
                    }
                    if (dt.Rows[n]["ExpandVchField3"] != null && dt.Rows[n]["ExpandVchField3"].ToString() != "")
                    {
                        model.ExpandVchField3 = dt.Rows[n]["ExpandVchField3"].ToString();
                    }
                    if (dt.Rows[n]["ExpandVchField4"] != null && dt.Rows[n]["ExpandVchField4"].ToString() != "")
                    {
                        model.ExpandVchField4 = dt.Rows[n]["ExpandVchField4"].ToString();
                    }
                    if (dt.Rows[n]["ExpandVchField5"] != null && dt.Rows[n]["ExpandVchField5"].ToString() != "")
                    {
                        model.ExpandVchField5 = dt.Rows[n]["ExpandVchField5"].ToString();
                    }
                    if (dt.Rows[n]["ExpandVchField6"] != null && dt.Rows[n]["ExpandVchField6"].ToString() != "")
                    {
                        model.ExpandVchField6 = dt.Rows[n]["ExpandVchField6"].ToString();
                    }
                    if (dt.Rows[n]["ExpandVchField7"] != null && dt.Rows[n]["ExpandVchField7"].ToString() != "")
                    {
                        model.ExpandVchField7 = dt.Rows[n]["ExpandVchField7"].ToString();
                    }
                    if (dt.Rows[n]["ExpandVchField8"] != null && dt.Rows[n]["ExpandVchField8"].ToString() != "")
                    {
                        model.ExpandVchField8 = dt.Rows[n]["ExpandVchField8"].ToString();
                    }
                    if (dt.Rows[n]["ExpandVchField9"] != null && dt.Rows[n]["ExpandVchField9"].ToString() != "")
                    {
                        model.ExpandVchField9 = dt.Rows[n]["ExpandVchField9"].ToString();
                    }
                    if (dt.Rows[n]["ExpandVchField10"] != null && dt.Rows[n]["ExpandVchField10"].ToString() != "")
                    {
                        model.ExpandVchField10 = dt.Rows[n]["ExpandVchField10"].ToString();
                    }
                    if (dt.Rows[n]["ExpandVchField11"] != null && dt.Rows[n]["ExpandVchField11"].ToString() != "")
                    {
                        model.ExpandVchField11 = dt.Rows[n]["ExpandVchField11"].ToString();
                    }
                    if (dt.Rows[n]["ExpandVchField12"] != null && dt.Rows[n]["ExpandVchField12"].ToString() != "")
                    {
                        model.ExpandVchField12 = dt.Rows[n]["ExpandVchField12"].ToString();
                    }
                    if (dt.Rows[n]["ExpandVchField13"] != null && dt.Rows[n]["ExpandVchField13"].ToString() != "")
                    {
                        model.ExpandVchField13 = dt.Rows[n]["ExpandVchField13"].ToString();
                    }
                    if (dt.Rows[n]["ExpandVchField14"] != null && dt.Rows[n]["ExpandVchField14"].ToString() != "")
                    {
                        model.ExpandVchField14 = dt.Rows[n]["ExpandVchField14"].ToString();
                    }
                    if (dt.Rows[n]["ExpandVchField15"] != null && dt.Rows[n]["ExpandVchField15"].ToString() != "")
                    {
                        model.ExpandVchField15 = dt.Rows[n]["ExpandVchField15"].ToString();
                    }
                    if (dt.Rows[n]["ExpandSintField1"] != null && dt.Rows[n]["ExpandSintField1"].ToString() != "")
                    {
                        model.ExpandSintField1 = int.Parse(dt.Rows[n]["ExpandSintField1"].ToString());
                    }
                    if (dt.Rows[n]["ExpandSintField2"] != null && dt.Rows[n]["ExpandSintField2"].ToString() != "")
                    {
                        model.ExpandSintField2 = int.Parse(dt.Rows[n]["ExpandSintField2"].ToString());
                    }
                    if (dt.Rows[n]["ExpandSintField3"] != null && dt.Rows[n]["ExpandSintField3"].ToString() != "")
                    {
                        model.ExpandSintField3 = int.Parse(dt.Rows[n]["ExpandSintField3"].ToString());
                    }
                    if (dt.Rows[n]["ExpandSintField4"] != null && dt.Rows[n]["ExpandSintField4"].ToString() != "")
                    {
                        model.ExpandSintField4 = int.Parse(dt.Rows[n]["ExpandSintField4"].ToString());
                    }
                    if (dt.Rows[n]["ExpandSintField5"] != null && dt.Rows[n]["ExpandSintField5"].ToString() != "")
                    {
                        model.ExpandSintField5 = int.Parse(dt.Rows[n]["ExpandSintField5"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return modelList;
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetAllList()
        {
            return GetList("");
        }

        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        public int GetRecordCount(string strWhere)
        {
            return dal.GetRecordCount(strWhere);
        }
        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
        {
            return dal.GetListByPage(strWhere, orderby, startIndex, endIndex);
        }
        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
        //{
        //return dal.GetList(PageSize,PageIndex,strWhere);
        //}

        #endregion  Method
    }
}

