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

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

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

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

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

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

        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool UpdateCount(int F_MeetingId, int count)
        {
            return dal.UpdateCount(F_MeetingId, count);
        }

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

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

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public ZXDT.CallCenter.Model.T_Call_MeetingInfo GetModel(int F_MeetingId)
        {

            return dal.GetModel(F_MeetingId);
        }

        /// <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<ZXDT.CallCenter.Model.T_Call_MeetingInfo> GetModelList(string strWhere)
        {
            DataSet ds = dal.GetList(strWhere);
            return DataTableToList(ds.Tables[0]);
        }
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<ZXDT.CallCenter.Model.T_Call_MeetingInfo> DataTableToList(DataTable dt)
        {
            List<ZXDT.CallCenter.Model.T_Call_MeetingInfo> modelList = new List<ZXDT.CallCenter.Model.T_Call_MeetingInfo>();
            int rowsCount = dt.Rows.Count;
            if (rowsCount > 0)
            {
                ZXDT.CallCenter.Model.T_Call_MeetingInfo model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new ZXDT.CallCenter.Model.T_Call_MeetingInfo();
                    if (dt.Rows[n]["F_MeetingId"] != null && dt.Rows[n]["F_MeetingId"].ToString() != "")
                    {
                        model.F_MeetingId = int.Parse(dt.Rows[n]["F_MeetingId"].ToString());
                    }
                    if (dt.Rows[n]["F_Title"] != null && dt.Rows[n]["F_Title"].ToString() != "")
                    {
                        model.F_Title = dt.Rows[n]["F_Title"].ToString();
                    }
                    if (dt.Rows[n]["F_Code"] != null && dt.Rows[n]["F_Code"].ToString() != "")
                    {
                        model.F_Code = dt.Rows[n]["F_Code"].ToString();
                    }
                    if (dt.Rows[n]["F_Remark"] != null && dt.Rows[n]["F_Remark"].ToString() != "")
                    {
                        model.F_Remark = dt.Rows[n]["F_Remark"].ToString();
                    }
                    if (dt.Rows[n]["F_Count"] != null && dt.Rows[n]["F_Count"].ToString() != "")
                    {
                        model.F_Count = int.Parse(dt.Rows[n]["F_Count"].ToString());
                    }
                    if (dt.Rows[n]["F_SJCount"] != null && dt.Rows[n]["F_SJCount"].ToString() != "")
                    {
                        model.F_SJCount = int.Parse(dt.Rows[n]["F_SJCount"].ToString());
                    }
                    if (dt.Rows[n]["F_CreateTime"] != null && dt.Rows[n]["F_CreateTime"].ToString() != "")
                    {
                        model.F_CreateTime = DateTime.Parse(dt.Rows[n]["F_CreateTime"].ToString());
                    }
                    if (dt.Rows[n]["F_StartTime"] != null && dt.Rows[n]["F_StartTime"].ToString() != "")
                    {
                        model.F_StartTime = DateTime.Parse(dt.Rows[n]["F_StartTime"].ToString());
                    }
                    if (dt.Rows[n]["F_EndTime"] != null && dt.Rows[n]["F_EndTime"].ToString() != "")
                    {
                        model.F_EndTime = DateTime.Parse(dt.Rows[n]["F_EndTime"].ToString());
                    }
                    if (dt.Rows[n]["F_CreateId"] != null && dt.Rows[n]["F_CreateId"].ToString() != "")
                    {
                        model.F_CreateId = int.Parse(dt.Rows[n]["F_CreateId"].ToString());
                    }
                    if (dt.Rows[n]["F_CreateName"] != null && dt.Rows[n]["F_CreateName"].ToString() != "")
                    {
                        model.F_CreateName = dt.Rows[n]["F_CreateName"].ToString();
                    }
                    if (dt.Rows[n]["F_Phone"] != null && dt.Rows[n]["F_Phone"].ToString() != "")
                    {
                        model.F_Phone = dt.Rows[n]["F_Phone"].ToString();
                    }
                    if (dt.Rows[n]["F_State"] != null && dt.Rows[n]["F_State"].ToString() != "")
                    {
                        model.F_State = int.Parse(dt.Rows[n]["F_State"].ToString());
                    }
                    if (dt.Rows[n]["F_Ext1"] != null && dt.Rows[n]["F_Ext1"].ToString() != "")
                    {
                        model.F_Ext1 = dt.Rows[n]["F_Ext1"].ToString();
                    }
                    if (dt.Rows[n]["F_Ext2"] != null && dt.Rows[n]["F_Ext2"].ToString() != "")
                    {
                        model.F_Ext2 = dt.Rows[n]["F_Ext2"].ToString();
                    }
                    if (dt.Rows[n]["F_Ext3"] != null && dt.Rows[n]["F_Ext3"].ToString() != "")
                    {
                        model.F_Ext3 = dt.Rows[n]["F_Ext3"].ToString();
                    }
                    if (dt.Rows[n]["F_Int1"] != null && dt.Rows[n]["F_Int1"].ToString() != "")
                    {
                        model.F_Int1 = int.Parse(dt.Rows[n]["F_Int1"].ToString());
                    }
                    if (dt.Rows[n]["F_Time1"] != null && dt.Rows[n]["F_Time1"].ToString() != "")
                    {
                        model.F_Time1 = DateTime.Parse(dt.Rows[n]["F_Time1"].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
    }
}

