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

        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(ZXDT.CallCenter.Model.T_Wo_WorkOrderBase model)
        {
            return dal.Add(model);
        }
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int AddWbgd(ZXDT.CallCenter.Model.T_Wo_WorkOrderBase model)
        {
            return dal.AddWbgd(model);
        }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(ZXDT.CallCenter.Model.T_Wo_WorkOrderBase model)
        {
            return dal.Update(model);
        }

        /// <summary>
        /// 更新来电内容
        /// </summary>
        public bool Update1(ZXDT.CallCenter.Model.T_Wo_WorkOrderBase model)
        {
            return dal.Update1(model);
        }

        /// <summary>
        /// 更新定责人员
        /// </summary>
        public bool UpdateDZuser(ZXDT.CallCenter.Model.T_Wo_WorkOrderBase model)
        {
            return dal.UpdateDZuser(model);
        }

        /// <summary>
        /// 更新定责事件分类
        /// </summary>
        public bool UpdateDZClass(ZXDT.CallCenter.Model.T_Wo_WorkOrderBase model)
        {
            return dal.UpdateDZClass(model);
        }

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

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

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

            return dal.GetModel(F_WORKORDERID);
        }

        /// <summary>
        /// 得到一个对象实体，从缓存中
        /// </summary>
        //public ZXDT.CallCenter.Model.T_Wo_WorkOrderBase GetModelByCache(int F_WORKORDERID)
        //{

        //    string CacheKey = "T_Wo_WorkOrderBaseModel-" + F_WORKORDERID;
        //    object objModel = Maticsoft.Common.DataCache.GetCache(CacheKey);
        //    if (objModel == null)
        //    {
        //        try
        //        {
        //            objModel = dal.GetModel(F_WORKORDERID);
        //            if (objModel != null)
        //            {
        //                int ModelCache = Maticsoft.Common.ConfigHelper.GetConfigInt("ModelCache");
        //                Maticsoft.Common.DataCache.SetCache(CacheKey, objModel, DateTime.Now.AddMinutes(ModelCache), TimeSpan.Zero);
        //            }
        //        }
        //        catch{}
        //    }
        //    return (ZXDT.CallCenter.Model.T_Wo_WorkOrderBase)objModel;
        //}

        /// <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_Wo_WorkOrderBase> GetModelList(string strWhere)
        {
            DataSet ds = dal.GetList(strWhere);
            return DataTableToList(ds.Tables[0]);
        }
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<ZXDT.CallCenter.Model.T_Wo_WorkOrderBase> DataTableToList(DataTable dt)
        {
            List<ZXDT.CallCenter.Model.T_Wo_WorkOrderBase> modelList = new List<ZXDT.CallCenter.Model.T_Wo_WorkOrderBase>();
            int rowsCount = dt.Rows.Count;
            if (rowsCount > 0)
            {
                ZXDT.CallCenter.Model.T_Wo_WorkOrderBase model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new ZXDT.CallCenter.Model.T_Wo_WorkOrderBase();
                    if (dt.Rows[n]["F_WORKORDERID"] != null && dt.Rows[n]["F_WORKORDERID"].ToString() != "")
                    {
                        model.F_WORKORDERID = int.Parse(dt.Rows[n]["F_WORKORDERID"].ToString());
                    }
                    if (dt.Rows[n]["F_WORKORDERTYPEID"] != null && dt.Rows[n]["F_WORKORDERTYPEID"].ToString() != "")
                    {
                        model.F_WORKORDERTYPEID = int.Parse(dt.Rows[n]["F_WORKORDERTYPEID"].ToString());
                    }
                    if (dt.Rows[n]["F_WORKORDERSTATEID"] != null && dt.Rows[n]["F_WORKORDERSTATEID"].ToString() != "")
                    {
                        model.F_WORKORDERSTATEID = int.Parse(dt.Rows[n]["F_WORKORDERSTATEID"].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_WORKORDERNAME"] != null && dt.Rows[n]["F_WORKORDERNAME"].ToString() != "")
                    {
                        model.F_WORKORDERNAME = dt.Rows[n]["F_WORKORDERNAME"].ToString();
                    }
                    if (dt.Rows[n]["F_NUMBER"] != null && dt.Rows[n]["F_NUMBER"].ToString() != "")
                    {
                        model.F_NUMBER = dt.Rows[n]["F_NUMBER"].ToString();
                    }
                    if (dt.Rows[n]["F_CUSTOMERNAME"] != null && dt.Rows[n]["F_CUSTOMERNAME"].ToString() != "")
                    {
                        model.F_CUSTOMERNAME = dt.Rows[n]["F_CUSTOMERNAME"].ToString();
                    }
                    if (dt.Rows[n]["F_CUSTOMERTELEPHONE"] != null && dt.Rows[n]["F_CUSTOMERTELEPHONE"].ToString() != "")
                    {
                        model.F_CUSTOMERTELEPHONE = dt.Rows[n]["F_CUSTOMERTELEPHONE"].ToString();
                    }
                    if (dt.Rows[n]["F_LINKMAN"] != null && dt.Rows[n]["F_LINKMAN"].ToString() != "")
                    {
                        model.F_LINKMAN = dt.Rows[n]["F_LINKMAN"].ToString();
                    }
                    if (dt.Rows[n]["F_LINKMANTELEPHONE"] != null && dt.Rows[n]["F_LINKMANTELEPHONE"].ToString() != "")
                    {
                        model.F_LINKMANTELEPHONE = dt.Rows[n]["F_LINKMANTELEPHONE"].ToString();
                    }
                    if (dt.Rows[n]["F_ADSLACCOUNT"] != null && dt.Rows[n]["F_ADSLACCOUNT"].ToString() != "")
                    {
                        model.F_ADSLACCOUNT = dt.Rows[n]["F_ADSLACCOUNT"].ToString();
                    }
                    if (dt.Rows[n]["F_BANDWIDTH"] != null && dt.Rows[n]["F_BANDWIDTH"].ToString() != "")
                    {
                        model.F_BANDWIDTH = dt.Rows[n]["F_BANDWIDTH"].ToString();
                    }
                    if (dt.Rows[n]["F_STANDARDADDRESS"] != null && dt.Rows[n]["F_STANDARDADDRESS"].ToString() != "")
                    {
                        model.F_STANDARDADDRESS = dt.Rows[n]["F_STANDARDADDRESS"].ToString();
                    }
                    if (dt.Rows[n]["F_INSTALLADDRESS"] != null && dt.Rows[n]["F_INSTALLADDRESS"].ToString() != "")
                    {
                        model.F_INSTALLADDRESS = dt.Rows[n]["F_INSTALLADDRESS"].ToString();
                    }
                    if (dt.Rows[n]["F_KSHADDRESSCODE"] != null && dt.Rows[n]["F_KSHADDRESSCODE"].ToString() != "")
                    {
                        model.F_KSHADDRESSCODE = dt.Rows[n]["F_KSHADDRESSCODE"].ToString();
                    }
                    if (dt.Rows[n]["F_PROVINCE"] != null && dt.Rows[n]["F_PROVINCE"].ToString() != "")
                    {
                        model.F_PROVINCE = dt.Rows[n]["F_PROVINCE"].ToString();
                    }
                    if (dt.Rows[n]["F_CITY"] != null && dt.Rows[n]["F_CITY"].ToString() != "")
                    {
                        model.F_CITY = dt.Rows[n]["F_CITY"].ToString();
                    }
                    if (dt.Rows[n]["F_AREA"] != null && dt.Rows[n]["F_AREA"].ToString() != "")
                    {
                        model.F_AREA = dt.Rows[n]["F_AREA"].ToString();
                    }
                    if (dt.Rows[n]["F_ROAD"] != null && dt.Rows[n]["F_ROAD"].ToString() != "")
                    {
                        model.F_ROAD = dt.Rows[n]["F_ROAD"].ToString();
                    }
                    if (dt.Rows[n]["F_HOUSING"] != null && dt.Rows[n]["F_HOUSING"].ToString() != "")
                    {
                        model.F_HOUSING = dt.Rows[n]["F_HOUSING"].ToString();
                    }
                    if (dt.Rows[n]["F_WORKORDERFROM"] != null && dt.Rows[n]["F_WORKORDERFROM"].ToString() != "")
                    {
                        model.F_WORKORDERFROM = dt.Rows[n]["F_WORKORDERFROM"].ToString();
                    }
                    if (dt.Rows[n]["F_WORKORDERLEVELID"] != null && dt.Rows[n]["F_WORKORDERLEVELID"].ToString() != "")
                    {
                        model.F_WORKORDERLEVELID = int.Parse(dt.Rows[n]["F_WORKORDERLEVELID"].ToString());
                    }
                    if (dt.Rows[n]["F_FILEFLAG"] != null && dt.Rows[n]["F_FILEFLAG"].ToString() != "")
                    {
                        model.F_FILEFLAG = int.Parse(dt.Rows[n]["F_FILEFLAG"].ToString());
                    }
                    if (dt.Rows[n]["F_CONTENT"] != null && dt.Rows[n]["F_CONTENT"].ToString() != "")
                    {
                        model.F_CONTENT = dt.Rows[n]["F_CONTENT"].ToString();
                    }
                    if (dt.Rows[n]["F_CREATEBY"] != null && dt.Rows[n]["F_CREATEBY"].ToString() != "")
                    {
                        model.F_CREATEBY = int.Parse(dt.Rows[n]["F_CREATEBY"].ToString());
                    }
                    if (dt.Rows[n]["F_CREATEDATE"] != null && dt.Rows[n]["F_CREATEDATE"].ToString() != "")
                    {
                        model.F_CREATEDATE = DateTime.Parse(dt.Rows[n]["F_CREATEDATE"].ToString());
                    }
                    if (dt.Rows[n]["F_DEPTCODE"] != null && dt.Rows[n]["F_DEPTCODE"].ToString() != "")
                    {
                        model.F_DEPTCODE = dt.Rows[n]["F_DEPTCODE"].ToString();
                    }
                    if (dt.Rows[n]["F_EMPCODE"] != null && dt.Rows[n]["F_EMPCODE"].ToString() != "")
                    {
                        model.F_EMPCODE = dt.Rows[n]["F_EMPCODE"].ToString();
                    }
                    if (dt.Rows[n]["F_DEPTID"] != null && dt.Rows[n]["F_DEPTID"].ToString() != "")
                    {
                        model.F_DEPTID = int.Parse(dt.Rows[n]["F_DEPTID"].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]["F_USERNAME"] != null && dt.Rows[n]["F_USERNAME"].ToString() != "")
                    {
                        model.F_USERNAME = dt.Rows[n]["F_USERNAME"].ToString();
                    }
                    if (dt.Rows[n]["F_RETURNVISITFLAG"] != null && dt.Rows[n]["F_RETURNVISITFLAG"].ToString() != "")
                    {
                        model.F_RETURNVISITFLAG = int.Parse(dt.Rows[n]["F_RETURNVISITFLAG"].ToString());
                    }
                    if (dt.Rows[n]["F_RETURNVISITSTATE"] != null && dt.Rows[n]["F_RETURNVISITSTATE"].ToString() != "")
                    {
                        model.F_RETURNVISITSTATE = int.Parse(dt.Rows[n]["F_RETURNVISITSTATE"].ToString());
                    }
                    if (dt.Rows[n]["F_RETURNVISITRESULT"] != null && dt.Rows[n]["F_RETURNVISITRESULT"].ToString() != "")
                    {
                        model.F_RETURNVISITRESULT = int.Parse(dt.Rows[n]["F_RETURNVISITRESULT"].ToString());
                    }
                    if (dt.Rows[n]["F_RETURNVISITCONTENT"] != null && dt.Rows[n]["F_RETURNVISITCONTENT"].ToString() != "")
                    {
                        model.F_RETURNVISITCONTENT = dt.Rows[n]["F_RETURNVISITCONTENT"].ToString();
                    }
                    if (dt.Rows[n]["F_DELETEFLAG"] != null && dt.Rows[n]["F_DELETEFLAG"].ToString() != "")
                    {
                        model.F_DELETEFLAG = int.Parse(dt.Rows[n]["F_DELETEFLAG"].ToString());
                    }
                    if (dt.Rows[n]["F_ALLUSETIMES"] != null && dt.Rows[n]["F_ALLUSETIMES"].ToString() != "")
                    {
                        model.F_ALLUSETIMES = int.Parse(dt.Rows[n]["F_ALLUSETIMES"].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_REMAINDERTIME"] != null && dt.Rows[n]["F_REMAINDERTIME"].ToString() != "")
                    {
                        model.F_REMAINDERTIME = DateTime.Parse(dt.Rows[n]["F_REMAINDERTIME"].ToString());
                    }
                    if (dt.Rows[n]["F_REMAINDERENDTIME"] != null && dt.Rows[n]["F_REMAINDERENDTIME"].ToString() != "")
                    {
                        model.F_REMAINDERENDTIME = DateTime.Parse(dt.Rows[n]["F_REMAINDERENDTIME"].ToString());
                    }
                    if (dt.Rows[n]["F_SUBSCRIBETIME1"] != null && dt.Rows[n]["F_SUBSCRIBETIME1"].ToString() != "")
                    {
                        model.F_SUBSCRIBETIME1 = DateTime.Parse(dt.Rows[n]["F_SUBSCRIBETIME1"].ToString());
                    }
                    if (dt.Rows[n]["F_SUBSCRIBETIME2"] != null && dt.Rows[n]["F_SUBSCRIBETIME2"].ToString() != "")
                    {
                        model.F_SUBSCRIBETIME2 = DateTime.Parse(dt.Rows[n]["F_SUBSCRIBETIME2"].ToString());
                    }
                    if (dt.Rows[n]["F_ACCEPTTIMELIMIT"] != null && dt.Rows[n]["F_ACCEPTTIMELIMIT"].ToString() != "")
                    {
                        model.F_ACCEPTTIMELIMIT = DateTime.Parse(dt.Rows[n]["F_ACCEPTTIMELIMIT"].ToString());
                    }
                    if (dt.Rows[n]["F_ASKFINISHTIME"] != null && dt.Rows[n]["F_ASKFINISHTIME"].ToString() != "")
                    {
                        model.F_ASKFINISHTIME = DateTime.Parse(dt.Rows[n]["F_ASKFINISHTIME"].ToString());
                    }
                    if (dt.Rows[n]["F_OVERTIMES"] != null && dt.Rows[n]["F_OVERTIMES"].ToString() != "")
                    {
                        model.F_OVERTIMES = int.Parse(dt.Rows[n]["F_OVERTIMES"].ToString());
                    }
                    if (dt.Rows[n]["F_FORMID"] != null && dt.Rows[n]["F_FORMID"].ToString() != "")
                    {
                        model.F_FORMID = int.Parse(dt.Rows[n]["F_FORMID"].ToString());
                    }
                    if (dt.Rows[n]["F_HASTENCOUNTS"] != null && dt.Rows[n]["F_HASTENCOUNTS"].ToString() != "")
                    {
                        model.F_HASTENCOUNTS = int.Parse(dt.Rows[n]["F_HASTENCOUNTS"].ToString());
                    }
                    if (dt.Rows[n]["F_RANGEID"] != null && dt.Rows[n]["F_RANGEID"].ToString() != "")
                    {
                        model.F_RANGEID = decimal.Parse(dt.Rows[n]["F_RANGEID"].ToString());
                    }
                    if (dt.Rows[n]["F_RANGEX"] != null && dt.Rows[n]["F_RANGEX"].ToString() != "")
                    {
                        model.F_RANGEX = decimal.Parse(dt.Rows[n]["F_RANGEX"].ToString());
                    }
                    if (dt.Rows[n]["F_RANGEY"] != null && dt.Rows[n]["F_RANGEY"].ToString() != "")
                    {
                        model.F_RANGEY = decimal.Parse(dt.Rows[n]["F_RANGEY"].ToString());
                    }
                    if (dt.Rows[n]["F_INSTANCEID"] != null && dt.Rows[n]["F_INSTANCEID"].ToString() != "")
                    {
                        model.F_INSTANCEID = int.Parse(dt.Rows[n]["F_INSTANCEID"].ToString());
                    }
                    if (dt.Rows[n]["F_CUSTOMERID"] != null && dt.Rows[n]["F_CUSTOMERID"].ToString() != "")
                    {
                        model.F_CUSTOMERID = int.Parse(dt.Rows[n]["F_CUSTOMERID"].ToString());
                    }
                    if (dt.Rows[n]["F_REPAIRMANID"] != null && dt.Rows[n]["F_REPAIRMANID"].ToString() != "")
                    {
                        model.F_REPAIRMANID = int.Parse(dt.Rows[n]["F_REPAIRMANID"].ToString());
                    }
                    if (dt.Rows[n]["F_REPAIRMANNAME"] != null && dt.Rows[n]["F_REPAIRMANNAME"].ToString() != "")
                    {
                        model.F_REPAIRMANNAME = dt.Rows[n]["F_REPAIRMANNAME"].ToString();
                    }
                    if (dt.Rows[n]["F_REPAIRMANPHONE"] != null && dt.Rows[n]["F_REPAIRMANPHONE"].ToString() != "")
                    {
                        model.F_REPAIRMANPHONE = dt.Rows[n]["F_REPAIRMANPHONE"].ToString();
                    }
                    if (dt.Rows[n]["F_REPAIRREQUEST"] != null && dt.Rows[n]["F_REPAIRREQUEST"].ToString() != "")
                    {
                        model.F_REPAIRREQUEST = dt.Rows[n]["F_REPAIRREQUEST"].ToString();
                    }
                    if (dt.Rows[n]["F_REPAIRCLOSEMANID"] != null && dt.Rows[n]["F_REPAIRCLOSEMANID"].ToString() != "")
                    {
                        model.F_REPAIRCLOSEMANID = int.Parse(dt.Rows[n]["F_REPAIRCLOSEMANID"].ToString());
                    }
                    if (dt.Rows[n]["F_REPAIRCLOSEMANNAME"] != null && dt.Rows[n]["F_REPAIRCLOSEMANNAME"].ToString() != "")
                    {
                        model.F_REPAIRCLOSEMANNAME = dt.Rows[n]["F_REPAIRCLOSEMANNAME"].ToString();
                    }
                    if (dt.Rows[n]["F_REPAIRCLOSEREASONS"] != null && dt.Rows[n]["F_REPAIRCLOSEREASONS"].ToString() != "")
                    {
                        model.F_REPAIRCLOSEREASONS = dt.Rows[n]["F_REPAIRCLOSEREASONS"].ToString();
                    }
                    if (dt.Rows[n]["F_REPAIRCLOSEREPTID"] != null && dt.Rows[n]["F_REPAIRCLOSEREPTID"].ToString() != "")
                    {
                        model.F_REPAIRCLOSEREPTID = int.Parse(dt.Rows[n]["F_REPAIRCLOSEREPTID"].ToString());
                    }
                    if (dt.Rows[n]["F_REPAIRCLOSEREPT"] != null && dt.Rows[n]["F_REPAIRCLOSEREPT"].ToString() != "")
                    {
                        model.F_REPAIRCLOSEREPT = dt.Rows[n]["F_REPAIRCLOSEREPT"].ToString();
                    }
                    if (dt.Rows[n]["F_REPAIRLEVEL"] != null && dt.Rows[n]["F_REPAIRLEVEL"].ToString() != "")
                    {
                        model.F_REPAIRLEVEL = int.Parse(dt.Rows[n]["F_REPAIRLEVEL"].ToString());
                    }
                    if (dt.Rows[n]["F_REPAIRLEVELNAME"] != null && dt.Rows[n]["F_REPAIRLEVELNAME"].ToString() != "")
                    {
                        model.F_REPAIRLEVELNAME = dt.Rows[n]["F_REPAIRLEVELNAME"].ToString();
                    }
                    if (dt.Rows[n]["F_SENTORDERTIME"] != null && dt.Rows[n]["F_SENTORDERTIME"].ToString() != "")
                    {
                        model.F_SENTORDERTIME = DateTime.Parse(dt.Rows[n]["F_SENTORDERTIME"].ToString());
                    }
                    if (dt.Rows[n]["F_USERPHONE"] != null && dt.Rows[n]["F_USERPHONE"].ToString() != "")
                    {
                        model.F_USERPHONE = dt.Rows[n]["F_USERPHONE"].ToString();
                    }
                    if (dt.Rows[n]["F_RETURNVISITTIME"] != null && dt.Rows[n]["F_RETURNVISITTIME"].ToString() != "")
                    {
                        model.F_RETURNVISITTIME = DateTime.Parse(dt.Rows[n]["F_RETURNVISITTIME"].ToString());
                    }
                    if (dt.Rows[n]["F_REQUESTSERVICETIME"] != null && dt.Rows[n]["F_REQUESTSERVICETIME"].ToString() != "")
                    {
                        model.F_REQUESTSERVICETIME = DateTime.Parse(dt.Rows[n]["F_REQUESTSERVICETIME"].ToString());
                    }
                    if (dt.Rows[n]["F_SERVICETYPE"] != null && dt.Rows[n]["F_SERVICETYPE"].ToString() != "")
                    {
                        model.F_SERVICETYPE = dt.Rows[n]["F_SERVICETYPE"].ToString();
                    }
                    if (dt.Rows[n]["F_DECLARATIONTIME"] != null && dt.Rows[n]["F_DECLARATIONTIME"].ToString() != "")
                    {
                        model.F_DECLARATIONTIME = decimal.Parse(dt.Rows[n]["F_DECLARATIONTIME"].ToString());
                    }
                    if (dt.Rows[n]["F_SERVICENATURE"] != null && dt.Rows[n]["F_SERVICENATURE"].ToString() != "")
                    {
                        model.F_SERVICENATURE = dt.Rows[n]["F_SERVICENATURE"].ToString();
                    }
                    if (dt.Rows[n]["F_SERVICEWAY"] != null && dt.Rows[n]["F_SERVICEWAY"].ToString() != "")
                    {
                        model.F_SERVICEWAY = dt.Rows[n]["F_SERVICEWAY"].ToString();
                    }
                    if (dt.Rows[n]["F_RETURNVISITMAN"] != null && dt.Rows[n]["F_RETURNVISITMAN"].ToString() != "")
                    {
                        model.F_RETURNVISITMAN = dt.Rows[n]["F_RETURNVISITMAN"].ToString();
                    }
                    if (dt.Rows[n]["F_RETURNVISITID"] != null && dt.Rows[n]["F_RETURNVISITID"].ToString() != "")
                    {
                        model.F_RETURNVISITID = int.Parse(dt.Rows[n]["F_RETURNVISITID"].ToString());
                    }
                    if (dt.Rows[n]["F_RETURNVISITOPINION"] != null && dt.Rows[n]["F_RETURNVISITOPINION"].ToString() != "")
                    {
                        model.F_RETURNVISITOPINION = dt.Rows[n]["F_RETURNVISITOPINION"].ToString();
                    }
                    if (dt.Rows[n]["F_RETURNVISITPROBLEM"] != null && dt.Rows[n]["F_RETURNVISITPROBLEM"].ToString() != "")
                    {
                        model.F_RETURNVISITPROBLEM = dt.Rows[n]["F_RETURNVISITPROBLEM"].ToString();
                    }


                    if (dt.Rows[n]["F_CustomerNatureID"] != null && dt.Rows[n]["F_CustomerNatureID"].ToString() != "")
                    {
                        model.F_CustomerNatureID = int.Parse(dt.Rows[n]["F_CustomerNatureID"].ToString());
                    }
                    if (dt.Rows[n]["F_CustomerNature"] != null && dt.Rows[n]["F_CustomerNature"].ToString() != "")
                    {
                        model.F_CustomerNature = dt.Rows[n]["F_CustomerNature"].ToString();
                    }
                    if (dt.Rows[n]["F_SystemType"] != null && dt.Rows[n]["F_SystemType"].ToString() != "")
                    {
                        model.F_SystemType = dt.Rows[n]["F_SystemType"].ToString();
                    }
                    if (dt.Rows[n]["F_ChargeDept"] != null && dt.Rows[n]["F_ChargeDept"].ToString() != "")
                    {
                        model.F_ChargeDept = dt.Rows[n]["F_ChargeDept"].ToString();
                    }
                    if (dt.Rows[n]["F_QualityGuaranteeEndTime"] != null && dt.Rows[n]["F_QualityGuaranteeEndTime"].ToString() != "")
                    {
                        model.F_QualityGuaranteeEndTime = DateTime.Parse(dt.Rows[n]["F_QualityGuaranteeEndTime"].ToString());
                    }
                    if (dt.Rows[n]["F_SystemStartTime"] != null && dt.Rows[n]["F_SystemStartTime"].ToString() != "")
                    {
                        model.F_SystemStartTime = DateTime.Parse(dt.Rows[n]["F_SystemStartTime"].ToString());
                    }
                    if (dt.Rows[n]["F_CustomerClass"] != null && dt.Rows[n]["F_CustomerClass"].ToString() != "")
                    {
                        model.F_CustomerClass = dt.Rows[n]["F_CustomerClass"].ToString();
                    }
                    if (dt.Rows[n]["F_AfterSaleName"] != null && dt.Rows[n]["F_AfterSaleName"].ToString() != "")
                    {
                        model.F_AfterSaleName = dt.Rows[n]["F_AfterSaleName"].ToString();
                    }
                    if (dt.Rows[n]["F_ServiceDept"] != null && dt.Rows[n]["F_ServiceDept"].ToString() != "")
                    {
                        model.F_ServiceDept = dt.Rows[n]["F_ServiceDept"].ToString();
                    }


                    if (dt.Rows[n]["F_Name"] != null && dt.Rows[n]["F_Name"].ToString() != "")
                    {
                        model.F_Name = dt.Rows[n]["F_Name"].ToString();
                    }

                    if (dt.Rows[n]["F_TypeName"] != null && dt.Rows[n]["F_TypeName"].ToString() != "")
                    {
                        model.F_TypeName = dt.Rows[n]["F_TypeName"].ToString();
                    }

                    if (dt.Rows[n]["F_UserAccountName"] != null && dt.Rows[n]["F_UserAccountName"].ToString() != "")
                    {
                        model.F_UserAccountName = dt.Rows[n]["F_UserAccountName"].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

        #region  编辑工单信息
        /// <summary>
        /// 编辑工单信息
        /// </summary>
        /// <param name="model">工单实体</param>
        /// <returns></returns>
        public bool UpdateWorkOrderInfoModel(ZXDT.CallCenter.Model.T_Wo_WorkOrderBase model)
        {
            return dal.UpdateWorkOrderInfoModel(model);
        }

        public string GetOrderNumber(int ordertype)
        {
            return dal.GetOrderNumber(ordertype);
        }
        /// <summary>
        /// 修改转办信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool EditMyOrderInfo(ZXDT.CallCenter.Model.T_Wo_WorkOrderBase model)
        {
            return dal.EditMyOrderInfo(model);
        }

        /// <summary>
        /// 处理信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool SubmitOrder(Model.T_Wo_WorkOrderHistory model)
        {
            return dal.SubmitOrder(model);
        }
        public bool SubmitOrder(Model.T_Wo_WorkOrderHistory model, int? workorderid, string F_username)
        {
            return dal.SubmitOrder(model, workorderid,F_username);
        }
        /// <summary>
        /// 全媒体客服处理回访
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool SubmitOrderHF(Model.T_Wo_WorkOrderBase model)
        {
            return dal.SubmitOrderHF(model);
        }
        /// <summary>
        /// 关闭转办信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool CloseMyOrderInfo(ZXDT.CallCenter.Model.T_Wo_WorkOrderBase model)
        {
            return dal.CloseMyOrderInfo(model);
        }
        /// <summary>
        ///  编辑历史工单信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool UpdateHistoryWorkOrderInfoModel(ZXDT.CallCenter.Model.T_Wo_WorkOrderBase model)
        {
            return dal.UpdateHistoryWorkOrderInfoModel(model);
        }
        #endregion  ExtensionMethod
    
        #region 工单撤回
        public bool ResetWorkOrder(int workOrderId,int  byid,string byname,int bmid, string bmmc,string reason)
        {
            return dal.ResetWorkOrder(workOrderId, byid, byname, bmid, bmmc, reason);
        }
        #endregion

        //待处理驳回
        public bool OverruleWorkOrder(int workOrderId, int byid, string byname, int bmid, string bmmc,string opinion)
        {
            return dal.OverruleWorkOrder(workOrderId, byid, byname, bmid, bmmc, opinion);
        }

        //待回访驳回
        public bool OverruleDHFWorkOrder(int workOrderId, int byid, string byname, int bmid, string bmmc, string opinion)
        {
            return dal.OverruleDHFWorkOrder(workOrderId, byid, byname, bmid, bmmc, opinion);
        }



        //待定责驳回
        public bool OverruleDDZWorkOrder(int workOrderId, int byid, string byname, int bmid, string bmmc,string opinion)
        {
            return dal.OverruleDDZWorkOrder(workOrderId, byid, byname, bmid, bmmc, opinion);
        }

        //撤回已处理且待回访工单
        public bool CheHuiYCLWorkOrder(int workOrderId, int byid, string byname, int bmid, string bmmc,string reason)
        {
            return dal.CheHuiYCLWorkOrder(workOrderId, byid, byname, bmid, bmmc, reason);
        }

        //撤回已回访是待定责工单
        public bool CheHuiDDZWorkOrder(int workOrderId, int byid, string byname, int bmid, string bmmc,string reason)
        {
            return dal.CheHuiDDZWorkOrder(workOrderId, byid, byname, bmid, bmmc, reason);
        }

        public DataSet GetFiveList()
        {
            return dal.GetFiveList();

        }


        public DataTable GetHistoryDayMax()
        {
            return dal.GetHistoryDayMax();
        }
        public DataTable GetHistoryDayLongTel()
        {
            return dal.GetHistoryDayLongTel();
        }

        public DataTable GetDataFluctuation()
        {
            return dal.GetDataFluctuation();
        }

        public int GetTodayCount()
        {
            return dal.GetTodayCount();            
        }
        public DataTable GetAverageAcceptAmount()
        {
            return dal.GetAverageAcceptAmount();
        }
        public DataTable GetYearTelAmount()
        {
            return dal.GetYearTelAmount();
        }
        public DataTable GetSixMonthTelAmount()
        {
            return dal.GetSixMonthTelAmount();
        }
        public DataTable GetPressKeyValue(string startTime)
        {
            return dal.GetPressKeyValue(startTime);
        }
        

        public DataTable GetEverydayOfMonthTelAmount()
        {
            return dal.GetEverydayOfMonthTelAmount();
        }

        public DataTable GetTodayFromTypeAmount(string startTime)
        { 
              return dal.GetTodayFromTypeAmount(startTime);

        }
        public DataTable GetTodayTelType(string startTime)
        {
            return dal.GetTodayTelType(startTime);

        }
        public DataTable GetTodayLineDistribution(string startTime)
        {
            return dal.GetTodayLineDistribution(startTime);

        }
        

        public bool SubmitShenPiYj(int workorderid, int shenpiresult, string shenpiopinion, int byid, string byname, int bmid)
        {
            return dal.SubmitShenPiYj(workorderid, shenpiresult, shenpiopinion, byid, byname, bmid);
        }


    }
}

