using System;
using System.Data;
using System.Text;
using System.Data.SqlClient;
using CallCenterApi.DB;

namespace CallCenterApi.DAL
{
    /// <summary>
    /// 数据访问类:T_Wo_WorkOrder
    /// </summary>
    public partial class T_Wo_WorkOrder
    {
        public T_Wo_WorkOrder()
        { }
        #region  BasicMethod
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool Exists(long ID)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select count(1) from T_Wo_WorkOrder");
            strSql.Append(" where ID=@ID");
            SqlParameter[] parameters = {
                    new SqlParameter("@ID", SqlDbType.BigInt)
            };
            parameters[0].Value = ID;

            return DbHelperSQL.Exists(strSql.ToString(), parameters);
        }

        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool Exists(string OrderID)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select count(1) from T_Wo_WorkOrder");
            strSql.Append(" where WorkOrderID=@ID");
            SqlParameter[] parameters = {
                    new SqlParameter("@ID", SqlDbType.BigInt)
            };
            parameters[0].Value = OrderID;

            return DbHelperSQL.Exists(strSql.ToString(), parameters);
        }


        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(CallCenterApi.Model.T_Wo_WorkOrder model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into T_Wo_WorkOrder(");
            strSql.Append("F_WorkOrderCode,F_CallID,F_Source,F_Type,F_IncidentProvince,F_IncidentCity,F_IncidentCountry,F_IncidentTownship,F_IncidentDetailed,F_SalesBase,F_Description,F_Files,F_DealType,F_CusPhone,F_CusName,F_CompanyName,F_CustomerID,F_MaterialID,F_QuestionType,F_BatchNumber,F_TS_Formula,F_TS_Category,F_TS_Quantity,F_TS_Level,F_ZX_ProName,F_ZX_Quantity,F_ZX_Area,F_ZX_Branch,F_CJ_Time,F_CJ_Level,F_CJ_Unit,F_CJ_TestUnit,F_CJ_Tonnage,F_CJ_BagNo,F_CJ_Outlay,F_State,F_SC_ProductBase,F_SC_PreliminaryOpinion,F_SC_QualityMonth,F_SC_CJ_SpotResult,F_SC_CJ_SelfResult,F_SC_CJ_ApprovalNo,F_SC_CJ_ReturnAccount,F_ZL_QualityEventLevel,F_ZL_ClaimAmount,F_ZL_ResponsibleUnit,F_ZL_ApprovalOpinions,F_ZL_ApprovalDisagree,F_ZL_CompensationMethod,F_ZL_CompensationMoney,F_ZL_CResponsibleUnits,F_ZL_Fquantity,F_ZL_ImprovementRequirements,F_ZL_CApprovalNo,F_ZL_CJ_IsRecord,F_IsAudit,F_AuditState,F_AuditBy,F_AuditOn,F_AuditCont,F_IsOver,F_DealBy,F_DealTime,F_DealContent,F_DealResult,F_DealReasons,F_IsVisit,F_VisitOn,F_VisitBy,F_VisitResult,F_VisitReason,F_CreateBy,F_CreateOn,F_UpdateCount,F_UpdateBy,F_UpdateOn,F_IsDelete,F_DeleteBy,F_DeleteOn,F_WxOpenId,F_Callresults,F_Highopinions,F_limit,F_Reasontimeout,F_Canal,F_SMSReply,F_Sid,F_VisitRemarks,F_Brand,F_Annotation,F_Production,F_Crops,F_CarNumber,F_LoadingFee,F_UnLoadingFee,F_MaterialFee,F_Formula,F_ReturnQuantity,F_EventReason,F_MailingNumber,F_ExpressName,F_DealContent2,F_State2,F_Annotation2,F_VisitResultScore,F_EffectiveScore,F_ServiceAttitude,F_ProductQuality,F_NPS,F_EvaluationResult,F_WorkmanShip,F_Manufacturers,F_ProductionNum,F_SuperiorOpinion,F_DrivePhone,F_SuperiorOpinion2,F_EventReason2,F_Flag)");
            strSql.Append(" values (");
            strSql.Append("@F_WorkOrderCode,@F_CallID,@F_Source,@F_Type,@F_IncidentProvince,@F_IncidentCity,@F_IncidentCountry,@F_IncidentTownship,@F_IncidentDetailed,@F_SalesBase,@F_Description,@F_Files,@F_DealType,@F_CusPhone,@F_CusName,@F_CompanyName,@F_CustomerID,@F_MaterialID,@F_QuestionType,@F_BatchNumber,@F_TS_Formula,@F_TS_Category,@F_TS_Quantity,@F_TS_Level,@F_ZX_ProName,@F_ZX_Quantity,@F_ZX_Area,@F_ZX_Branch,@F_CJ_Time,@F_CJ_Level,@F_CJ_Unit,@F_CJ_TestUnit,@F_CJ_Tonnage,@F_CJ_BagNo,@F_CJ_Outlay,@F_State,@F_SC_ProductBase,@F_SC_PreliminaryOpinion,@F_SC_QualityMonth,@F_SC_CJ_SpotResult,@F_SC_CJ_SelfResult,@F_SC_CJ_ApprovalNo,@F_SC_CJ_ReturnAccount,@F_ZL_QualityEventLevel,@F_ZL_ClaimAmount,@F_ZL_ResponsibleUnit,@F_ZL_ApprovalOpinions,@F_ZL_ApprovalDisagree,@F_ZL_CompensationMethod,@F_ZL_CompensationMoney,@F_ZL_CResponsibleUnits,@F_ZL_Fquantity,@F_ZL_ImprovementRequirements,@F_ZL_CApprovalNo,@F_ZL_CJ_IsRecord,@F_IsAudit,@F_AuditState,@F_AuditBy,@F_AuditOn,@F_AuditCont,@F_IsOver,@F_DealBy,@F_DealTime,@F_DealContent,@F_DealResult,@F_DealReasons,@F_IsVisit,@F_VisitOn,@F_VisitBy,@F_VisitResult,@F_VisitReason,@F_CreateBy,@F_CreateOn,@F_UpdateCount,@F_UpdateBy,@F_UpdateOn,@F_IsDelete,@F_DeleteBy,@F_DeleteOn,@F_WxOpenId,@F_Callresults,@F_Highopinions,@F_limit,@F_Reasontimeout,@F_Canal,@F_SMSReply,@F_Sid,@F_VisitRemarks,@F_Brand,@F_Annotation,@F_Production,@F_Crops,@F_CarNumber,@F_LoadingFee,@F_UnLoadingFee,@F_MaterialFee,@F_Formula,@F_ReturnQuantity,@F_EventReason,@F_MailingNumber,@F_ExpressName,@F_DealContent2,@F_State2,@F_Annotation2,@F_VisitResultScore,@F_EffectiveScore,@F_ServiceAttitude,@F_ProductQuality,@F_NPS,@F_EvaluationResult,@F_WorkmanShip,@F_Manufacturers,@F_ProductionNum,@F_SuperiorOpinion,@F_DrivePhone,@F_SuperiorOpinion2,@F_EventReason2,@F_Flag)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters = {
                    new SqlParameter("@F_WorkOrderCode", SqlDbType.VarChar,50),
                    new SqlParameter("@F_CallID", SqlDbType.VarChar,50),
                    new SqlParameter("@F_Source", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_Type", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_IncidentProvince", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_IncidentCity", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_IncidentCountry", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_IncidentTownship", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_IncidentDetailed", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_SalesBase", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_Description", SqlDbType.NText),
                    new SqlParameter("@F_Files", SqlDbType.NVarChar,-1),
                    new SqlParameter("@F_DealType", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_CusPhone", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_CusName", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_CompanyName", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_CustomerID", SqlDbType.NVarChar,100),
                    new SqlParameter("@F_MaterialID", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_QuestionType", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_BatchNumber", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_TS_Formula", SqlDbType.NText),
                    new SqlParameter("@F_TS_Category", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_TS_Quantity", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_TS_Level", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_ZX_ProName", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_ZX_Quantity", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_ZX_Area", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_ZX_Branch", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_CJ_Time", SqlDbType.DateTime),
                    new SqlParameter("@F_CJ_Level", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_CJ_Unit", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_CJ_TestUnit", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_CJ_Tonnage", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_CJ_BagNo", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_CJ_Outlay", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_State", SqlDbType.Int,4),
                    new SqlParameter("@F_SC_ProductBase", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_SC_PreliminaryOpinion", SqlDbType.NVarChar,-1),
                    new SqlParameter("@F_SC_QualityMonth", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_SC_CJ_SpotResult", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_SC_CJ_SelfResult", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_SC_CJ_ApprovalNo", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_SC_CJ_ReturnAccount", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_ZL_QualityEventLevel", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_ZL_ClaimAmount", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_ZL_ResponsibleUnit", SqlDbType.NVarChar,-1),
                    new SqlParameter("@F_ZL_ApprovalOpinions", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_ZL_ApprovalDisagree", SqlDbType.NVarChar,-1),
                    new SqlParameter("@F_ZL_CompensationMethod", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_ZL_CompensationMoney", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_ZL_CResponsibleUnits", SqlDbType.NVarChar,-1),
                    new SqlParameter("@F_ZL_Fquantity", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_ZL_ImprovementRequirements", SqlDbType.NVarChar,-1),
                    new SqlParameter("@F_ZL_CApprovalNo", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_ZL_CJ_IsRecord", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_IsAudit", SqlDbType.Int,4),
                    new SqlParameter("@F_AuditState", SqlDbType.Int,4),
                    new SqlParameter("@F_AuditBy", SqlDbType.VarChar,50),
                    new SqlParameter("@F_AuditOn", SqlDbType.DateTime),
                    new SqlParameter("@F_AuditCont", SqlDbType.NText),
                    new SqlParameter("@F_IsOver", SqlDbType.Int,4),
                    new SqlParameter("@F_DealBy", SqlDbType.VarChar,50),
                    new SqlParameter("@F_DealTime", SqlDbType.DateTime),
                    new SqlParameter("@F_DealContent", SqlDbType.NText),
                    new SqlParameter("@F_DealResult", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_DealReasons", SqlDbType.NVarChar,-1),
                    new SqlParameter("@F_IsVisit", SqlDbType.Int,4),
                    new SqlParameter("@F_VisitOn", SqlDbType.DateTime),
                    new SqlParameter("@F_VisitBy", SqlDbType.VarChar,50),
                    new SqlParameter("@F_VisitResult", SqlDbType.VarChar,50),
                    new SqlParameter("@F_VisitReason", SqlDbType.NText),
                    new SqlParameter("@F_CreateBy", SqlDbType.VarChar,50),
                    new SqlParameter("@F_CreateOn", SqlDbType.DateTime),
                    new SqlParameter("@F_UpdateCount", SqlDbType.Int,4),
                    new SqlParameter("@F_UpdateBy", SqlDbType.VarChar,50),
                    new SqlParameter("@F_UpdateOn", SqlDbType.DateTime),
                    new SqlParameter("@F_IsDelete", SqlDbType.Int,4),
                    new SqlParameter("@F_DeleteBy", SqlDbType.VarChar,50),
                    new SqlParameter("@F_DeleteOn", SqlDbType.DateTime),
                    new SqlParameter("@F_WxOpenId", SqlDbType.NVarChar,300),
                    new SqlParameter("@F_Callresults", SqlDbType.NVarChar,100),
                    new SqlParameter("@F_Highopinions", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_limit", SqlDbType.Int,4),
                    new SqlParameter("@F_Reasontimeout", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_Canal", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_SMSReply", SqlDbType.Int,4),
                    new SqlParameter("@F_Sid", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_VisitRemarks", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_Brand", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_Annotation", SqlDbType.NVarChar,-1),
                    new SqlParameter("@F_Production", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_Crops", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_CarNumber", SqlDbType.VarChar,20),
                    new SqlParameter("@F_LoadingFee", SqlDbType.Decimal,9),
                    new SqlParameter("@F_UnLoadingFee", SqlDbType.Decimal,9),
                    new SqlParameter("@F_MaterialFee", SqlDbType.Decimal,9),
                    new SqlParameter("@F_Formula", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_ReturnQuantity", SqlDbType.Int,4),
                    new SqlParameter("@F_EventReason", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_MailingNumber", SqlDbType.VarChar,20),
                    new SqlParameter("@F_ExpressName", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_DealContent2", SqlDbType.NText),
                    new SqlParameter("@F_State2", SqlDbType.Int,4),
                    new SqlParameter("@F_Annotation2", SqlDbType.NVarChar,-1),
                    new SqlParameter("@F_VisitResultScore", SqlDbType.Int,4),
                    new SqlParameter("@F_EffectiveScore", SqlDbType.Int,4),
                    new SqlParameter("@F_ServiceAttitude", SqlDbType.Int,4),
                    new SqlParameter("@F_ProductQuality", SqlDbType.Int,4),
                    new SqlParameter("@F_NPS", SqlDbType.Int,4),
                    new SqlParameter("@F_EvaluationResult", SqlDbType.Decimal,9),
                    new SqlParameter("@F_WorkmanShip", SqlDbType.NVarChar,50),
                    new SqlParameter("@F_Manufacturers", SqlDbType.NVarChar,50),
                    new SqlParameter("@F_ProductionNum", SqlDbType.Int,4),
                    new SqlParameter("@F_SuperiorOpinion", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_DrivePhone", SqlDbType.VarChar,20),
                    new SqlParameter("@F_SuperiorOpinion2", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_EventReason2", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_Flag", SqlDbType.Int,4)
            };
            parameters[0].Value = model.F_WorkOrderCode;
            parameters[1].Value = model.F_CallID;
            parameters[2].Value = model.F_Source;
            parameters[3].Value = model.F_Type;
            parameters[4].Value = model.F_IncidentProvince;
            parameters[5].Value = model.F_IncidentCity;
            parameters[6].Value = model.F_IncidentCountry;
            parameters[7].Value = model.F_IncidentTownship;
            parameters[8].Value = model.F_IncidentDetailed;
            parameters[9].Value = model.F_SalesBase;
            parameters[10].Value = model.F_Description;
            parameters[11].Value = model.F_Files;
            parameters[12].Value = model.F_DealType;
            parameters[13].Value = model.F_CusPhone;
            parameters[14].Value = model.F_CusName;
            parameters[15].Value = model.F_CompanyName;
            parameters[16].Value = model.F_CustomerID;
            parameters[17].Value = model.F_MaterialID;
            parameters[18].Value = model.F_QuestionType;
            parameters[19].Value = model.F_BatchNumber;
            parameters[20].Value = model.F_TS_Formula;
            parameters[21].Value = model.F_TS_Category;
            parameters[22].Value = model.F_TS_Quantity;
            parameters[23].Value = model.F_TS_Level;
            parameters[24].Value = model.F_ZX_ProName;
            parameters[25].Value = model.F_ZX_Quantity;
            parameters[26].Value = model.F_ZX_Area;
            parameters[27].Value = model.F_ZX_Branch;
            parameters[28].Value = model.F_CJ_Time;
            parameters[29].Value = model.F_CJ_Level;
            parameters[30].Value = model.F_CJ_Unit;
            parameters[31].Value = model.F_CJ_TestUnit;
            parameters[32].Value = model.F_CJ_Tonnage;
            parameters[33].Value = model.F_CJ_BagNo;
            parameters[34].Value = model.F_CJ_Outlay;
            parameters[35].Value = model.F_State;
            parameters[36].Value = model.F_SC_ProductBase;
            parameters[37].Value = model.F_SC_PreliminaryOpinion;
            parameters[38].Value = model.F_SC_QualityMonth;
            parameters[39].Value = model.F_SC_CJ_SpotResult;
            parameters[40].Value = model.F_SC_CJ_SelfResult;
            parameters[41].Value = model.F_SC_CJ_ApprovalNo;
            parameters[42].Value = model.F_SC_CJ_ReturnAccount;
            parameters[43].Value = model.F_ZL_QualityEventLevel;
            parameters[44].Value = model.F_ZL_ClaimAmount;
            parameters[45].Value = model.F_ZL_ResponsibleUnit;
            parameters[46].Value = model.F_ZL_ApprovalOpinions;
            parameters[47].Value = model.F_ZL_ApprovalDisagree;
            parameters[48].Value = model.F_ZL_CompensationMethod;
            parameters[49].Value = model.F_ZL_CompensationMoney;
            parameters[50].Value = model.F_ZL_CResponsibleUnits;
            parameters[51].Value = model.F_ZL_Fquantity;
            parameters[52].Value = model.F_ZL_ImprovementRequirements;
            parameters[53].Value = model.F_ZL_CApprovalNo;
            parameters[54].Value = model.F_ZL_CJ_IsRecord;
            parameters[55].Value = model.F_IsAudit;
            parameters[56].Value = model.F_AuditState;
            parameters[57].Value = model.F_AuditBy;
            parameters[58].Value = model.F_AuditOn;
            parameters[59].Value = model.F_AuditCont;
            parameters[60].Value = model.F_IsOver;
            parameters[61].Value = model.F_DealBy;
            parameters[62].Value = model.F_DealTime;
            parameters[63].Value = model.F_DealContent;
            parameters[64].Value = model.F_DealResult;
            parameters[65].Value = model.F_DealReasons;
            parameters[66].Value = model.F_IsVisit;
            parameters[67].Value = model.F_VisitOn;
            parameters[68].Value = model.F_VisitBy;
            parameters[69].Value = model.F_VisitResult;
            parameters[70].Value = model.F_VisitReason;
            parameters[71].Value = model.F_CreateBy;
            parameters[72].Value = model.F_CreateOn;
            parameters[73].Value = model.F_UpdateCount;
            parameters[74].Value = model.F_UpdateBy;
            parameters[75].Value = model.F_UpdateOn;
            parameters[76].Value = model.F_IsDelete;
            parameters[77].Value = model.F_DeleteBy;
            parameters[78].Value = model.F_DeleteOn;
            parameters[79].Value = model.F_WxOpenId;
            parameters[80].Value = model.F_Callresults;
            parameters[81].Value = model.F_Highopinions;
            parameters[82].Value = model.F_limit;
            parameters[83].Value = model.F_Reasontimeout;
            parameters[84].Value = model.F_Canal;
            parameters[85].Value = model.F_SMSReply;
            parameters[86].Value = model.F_Sid;
            parameters[87].Value = model.F_VisitRemarks;
            parameters[88].Value = model.F_Brand;
            parameters[89].Value = model.F_Annotation;
            parameters[90].Value = model.F_Production;
            parameters[91].Value = model.F_Crops;
            parameters[92].Value = model.F_CarNumber;
            parameters[93].Value = model.F_LoadingFee;
            parameters[94].Value = model.F_UnLoadingFee;
            parameters[95].Value = model.F_MaterialFee;
            parameters[96].Value = model.F_Formula;
            parameters[97].Value = model.F_ReturnQuantity;
            parameters[98].Value = model.F_EventReason;
            parameters[99].Value = model.F_MailingNumber;
            parameters[100].Value = model.F_ExpressName;
            parameters[101].Value = model.F_DealContent2;
            parameters[102].Value = model.F_State2;
            parameters[103].Value = model.F_Annotation2;
            parameters[104].Value = model.F_VisitResultScore;
            parameters[105].Value = model.F_EffectiveScore;
            parameters[106].Value = model.F_ServiceAttitude;
            parameters[107].Value = model.F_ProductQuality;
            parameters[108].Value = model.F_NPS;
            parameters[109].Value = model.F_EvaluationResult;
            parameters[110].Value = model.F_WorkmanShip;
            parameters[111].Value = model.F_Manufacturers;
            parameters[112].Value = model.F_ProductionNum;
            parameters[113].Value = model.F_SuperiorOpinion;
            parameters[114].Value = model.F_DrivePhone;
            parameters[115].Value = model.F_SuperiorOpinion2;
            parameters[116].Value = model.F_EventReason2;
            parameters[117].Value = model.F_Flag;

            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
            if (obj == null)
            {
                return 0;
            }
            else
            {
                return Convert.ToInt32(obj);
            }
        }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(CallCenterApi.Model.T_Wo_WorkOrder model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update T_Wo_WorkOrder set ");
            strSql.Append("F_WorkOrderCode=@F_WorkOrderCode,");
            strSql.Append("F_CallID=@F_CallID,");
            strSql.Append("F_Source=@F_Source,");
            strSql.Append("F_Type=@F_Type,");
            strSql.Append("F_IncidentProvince=@F_IncidentProvince,");
            strSql.Append("F_IncidentCity=@F_IncidentCity,");
            strSql.Append("F_IncidentCountry=@F_IncidentCountry,");
            strSql.Append("F_IncidentTownship=@F_IncidentTownship,");
            strSql.Append("F_IncidentDetailed=@F_IncidentDetailed,");
            strSql.Append("F_SalesBase=@F_SalesBase,");
            strSql.Append("F_Description=@F_Description,");
            strSql.Append("F_Files=@F_Files,");
            strSql.Append("F_DealType=@F_DealType,");
            strSql.Append("F_CusPhone=@F_CusPhone,");
            strSql.Append("F_CusName=@F_CusName,");
            strSql.Append("F_CompanyName=@F_CompanyName,");
            strSql.Append("F_CustomerID=@F_CustomerID,");
            strSql.Append("F_MaterialID=@F_MaterialID,");
            strSql.Append("F_QuestionType=@F_QuestionType,");
            strSql.Append("F_BatchNumber=@F_BatchNumber,");
            strSql.Append("F_TS_Formula=@F_TS_Formula,");
            strSql.Append("F_TS_Category=@F_TS_Category,");
            strSql.Append("F_TS_Quantity=@F_TS_Quantity,");
            strSql.Append("F_TS_Level=@F_TS_Level,");
            strSql.Append("F_ZX_ProName=@F_ZX_ProName,");
            strSql.Append("F_ZX_Quantity=@F_ZX_Quantity,");
            strSql.Append("F_ZX_Area=@F_ZX_Area,");
            strSql.Append("F_ZX_Branch=@F_ZX_Branch,");
            strSql.Append("F_CJ_Time=@F_CJ_Time,");
            strSql.Append("F_CJ_Level=@F_CJ_Level,");
            strSql.Append("F_CJ_Unit=@F_CJ_Unit,");
            strSql.Append("F_CJ_TestUnit=@F_CJ_TestUnit,");
            strSql.Append("F_CJ_Tonnage=@F_CJ_Tonnage,");
            strSql.Append("F_CJ_BagNo=@F_CJ_BagNo,");
            strSql.Append("F_CJ_Outlay=@F_CJ_Outlay,");
            strSql.Append("F_State=@F_State,");
            strSql.Append("F_SC_ProductBase=@F_SC_ProductBase,");
            strSql.Append("F_SC_PreliminaryOpinion=@F_SC_PreliminaryOpinion,");
            strSql.Append("F_SC_QualityMonth=@F_SC_QualityMonth,");
            strSql.Append("F_SC_CJ_SpotResult=@F_SC_CJ_SpotResult,");
            strSql.Append("F_SC_CJ_SelfResult=@F_SC_CJ_SelfResult,");
            strSql.Append("F_SC_CJ_ApprovalNo=@F_SC_CJ_ApprovalNo,");
            strSql.Append("F_SC_CJ_ReturnAccount=@F_SC_CJ_ReturnAccount,");
            strSql.Append("F_ZL_QualityEventLevel=@F_ZL_QualityEventLevel,");
            strSql.Append("F_ZL_ClaimAmount=@F_ZL_ClaimAmount,");
            strSql.Append("F_ZL_ResponsibleUnit=@F_ZL_ResponsibleUnit,");
            strSql.Append("F_ZL_ApprovalOpinions=@F_ZL_ApprovalOpinions,");
            strSql.Append("F_ZL_ApprovalDisagree=@F_ZL_ApprovalDisagree,");
            strSql.Append("F_ZL_CompensationMethod=@F_ZL_CompensationMethod,");
            strSql.Append("F_ZL_CompensationMoney=@F_ZL_CompensationMoney,");
            strSql.Append("F_ZL_CResponsibleUnits=@F_ZL_CResponsibleUnits,");
            strSql.Append("F_ZL_Fquantity=@F_ZL_Fquantity,");
            strSql.Append("F_ZL_ImprovementRequirements=@F_ZL_ImprovementRequirements,");
            strSql.Append("F_ZL_CApprovalNo=@F_ZL_CApprovalNo,");
            strSql.Append("F_ZL_CJ_IsRecord=@F_ZL_CJ_IsRecord,");
            strSql.Append("F_IsAudit=@F_IsAudit,");
            strSql.Append("F_AuditState=@F_AuditState,");
            strSql.Append("F_AuditBy=@F_AuditBy,");
            strSql.Append("F_AuditOn=@F_AuditOn,");
            strSql.Append("F_AuditCont=@F_AuditCont,");
            strSql.Append("F_IsOver=@F_IsOver,");
            strSql.Append("F_DealBy=@F_DealBy,");
            strSql.Append("F_DealTime=@F_DealTime,");
            strSql.Append("F_DealContent=@F_DealContent,");
            strSql.Append("F_DealResult=@F_DealResult,");
            strSql.Append("F_DealReasons=@F_DealReasons,");
            strSql.Append("F_IsVisit=@F_IsVisit,");
            strSql.Append("F_VisitOn=@F_VisitOn,");
            strSql.Append("F_VisitBy=@F_VisitBy,");
            strSql.Append("F_VisitResult=@F_VisitResult,");
            strSql.Append("F_VisitReason=@F_VisitReason,");
            strSql.Append("F_CreateBy=@F_CreateBy,");
            strSql.Append("F_CreateOn=@F_CreateOn,");
            strSql.Append("F_UpdateCount=@F_UpdateCount,");
            strSql.Append("F_UpdateBy=@F_UpdateBy,");
            strSql.Append("F_UpdateOn=@F_UpdateOn,");
            strSql.Append("F_IsDelete=@F_IsDelete,");
            strSql.Append("F_DeleteBy=@F_DeleteBy,");
            strSql.Append("F_DeleteOn=@F_DeleteOn,");
            strSql.Append("F_WxOpenId=@F_WxOpenId,");
            strSql.Append("F_Callresults=@F_Callresults,");
            strSql.Append("F_Highopinions=@F_Highopinions,");
            strSql.Append("F_limit=@F_limit,");
            strSql.Append("F_Reasontimeout=@F_Reasontimeout,");
            strSql.Append("F_Canal=@F_Canal,");
            strSql.Append("F_SMSReply=@F_SMSReply,");
            strSql.Append("F_Sid=@F_Sid,");
            strSql.Append("F_VisitRemarks=@F_VisitRemarks,");
            strSql.Append("F_Brand=@F_Brand,");
            strSql.Append("F_Annotation=@F_Annotation,");
            strSql.Append("F_Production=@F_Production,");
            strSql.Append("F_Crops=@F_Crops,");
            strSql.Append("F_CarNumber=@F_CarNumber,");
            strSql.Append("F_LoadingFee=@F_LoadingFee,");
            strSql.Append("F_UnLoadingFee=@F_UnLoadingFee,");
            strSql.Append("F_MaterialFee=@F_MaterialFee,");
            strSql.Append("F_Formula=@F_Formula,");
            strSql.Append("F_ReturnQuantity=@F_ReturnQuantity,");
            strSql.Append("F_EventReason=@F_EventReason,");
            strSql.Append("F_MailingNumber=@F_MailingNumber,");
            strSql.Append("F_ExpressName=@F_ExpressName,");
            strSql.Append("F_DealContent2=@F_DealContent2,");
            strSql.Append("F_State2=@F_State2,");
            strSql.Append("F_Annotation2=@F_Annotation2,");
            strSql.Append("F_VisitResultScore=@F_VisitResultScore,");
            strSql.Append("F_EffectiveScore=@F_EffectiveScore,");
            strSql.Append("F_ServiceAttitude=@F_ServiceAttitude,");
            strSql.Append("F_ProductQuality=@F_ProductQuality,");
            strSql.Append("F_NPS=@F_NPS,");
            strSql.Append("F_EvaluationResult=@F_EvaluationResult,");
            strSql.Append("F_WorkmanShip=@F_WorkmanShip,");
            strSql.Append("F_Manufacturers=@F_Manufacturers,");
            strSql.Append("F_ProductionNum=@F_ProductionNum,");
            strSql.Append("F_SuperiorOpinion=@F_SuperiorOpinion,");
            strSql.Append("F_DrivePhone=@F_DrivePhone,");
            strSql.Append("F_SuperiorOpinion2=@F_SuperiorOpinion2,");
            strSql.Append("F_EventReason2=@F_EventReason2,"); 
            strSql.Append("F_Flag=@F_Flag"); 
            strSql.Append(" where F_ID=@F_ID");
            SqlParameter[] parameters = {
                    new SqlParameter("@F_WorkOrderCode", SqlDbType.VarChar,50),
                    new SqlParameter("@F_CallID", SqlDbType.VarChar,50),
                    new SqlParameter("@F_Source", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_Type", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_IncidentProvince", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_IncidentCity", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_IncidentCountry", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_IncidentTownship", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_IncidentDetailed", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_SalesBase", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_Description", SqlDbType.NText),
                    new SqlParameter("@F_Files", SqlDbType.NVarChar,-1),
                    new SqlParameter("@F_DealType", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_CusPhone", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_CusName", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_CompanyName", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_CustomerID", SqlDbType.NVarChar,100),
                    new SqlParameter("@F_MaterialID", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_QuestionType", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_BatchNumber", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_TS_Formula", SqlDbType.NText),
                    new SqlParameter("@F_TS_Category", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_TS_Quantity", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_TS_Level", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_ZX_ProName", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_ZX_Quantity", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_ZX_Area", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_ZX_Branch", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_CJ_Time", SqlDbType.DateTime),
                    new SqlParameter("@F_CJ_Level", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_CJ_Unit", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_CJ_TestUnit", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_CJ_Tonnage", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_CJ_BagNo", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_CJ_Outlay", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_State", SqlDbType.Int,4),
                    new SqlParameter("@F_SC_ProductBase", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_SC_PreliminaryOpinion", SqlDbType.NVarChar,-1),
                    new SqlParameter("@F_SC_QualityMonth", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_SC_CJ_SpotResult", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_SC_CJ_SelfResult", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_SC_CJ_ApprovalNo", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_SC_CJ_ReturnAccount", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_ZL_QualityEventLevel", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_ZL_ClaimAmount", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_ZL_ResponsibleUnit", SqlDbType.NVarChar,-1),
                    new SqlParameter("@F_ZL_ApprovalOpinions", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_ZL_ApprovalDisagree", SqlDbType.NVarChar,-1),
                    new SqlParameter("@F_ZL_CompensationMethod", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_ZL_CompensationMoney", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_ZL_CResponsibleUnits", SqlDbType.NVarChar,-1),
                    new SqlParameter("@F_ZL_Fquantity", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_ZL_ImprovementRequirements", SqlDbType.NVarChar,-1),
                    new SqlParameter("@F_ZL_CApprovalNo", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_ZL_CJ_IsRecord", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_IsAudit", SqlDbType.Int,4),
                    new SqlParameter("@F_AuditState", SqlDbType.Int,4),
                    new SqlParameter("@F_AuditBy", SqlDbType.VarChar,50),
                    new SqlParameter("@F_AuditOn", SqlDbType.DateTime),
                    new SqlParameter("@F_AuditCont", SqlDbType.NText),
                    new SqlParameter("@F_IsOver", SqlDbType.Int,4),
                    new SqlParameter("@F_DealBy", SqlDbType.VarChar,50),
                    new SqlParameter("@F_DealTime", SqlDbType.DateTime),
                    new SqlParameter("@F_DealContent", SqlDbType.NText),
                    new SqlParameter("@F_DealResult", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_DealReasons", SqlDbType.NVarChar,-1),
                    new SqlParameter("@F_IsVisit", SqlDbType.Int,4),
                    new SqlParameter("@F_VisitOn", SqlDbType.DateTime),
                    new SqlParameter("@F_VisitBy", SqlDbType.VarChar,50),
                    new SqlParameter("@F_VisitResult", SqlDbType.VarChar,50),
                    new SqlParameter("@F_VisitReason", SqlDbType.NText),
                    new SqlParameter("@F_CreateBy", SqlDbType.VarChar,50),
                    new SqlParameter("@F_CreateOn", SqlDbType.DateTime),
                    new SqlParameter("@F_UpdateCount", SqlDbType.Int,4),
                    new SqlParameter("@F_UpdateBy", SqlDbType.VarChar,50),
                    new SqlParameter("@F_UpdateOn", SqlDbType.DateTime),
                    new SqlParameter("@F_IsDelete", SqlDbType.Int,4),
                    new SqlParameter("@F_DeleteBy", SqlDbType.VarChar,50),
                    new SqlParameter("@F_DeleteOn", SqlDbType.DateTime),
                    new SqlParameter("@F_WxOpenId", SqlDbType.NVarChar,300),
                    new SqlParameter("@F_Callresults", SqlDbType.NVarChar,100),
                    new SqlParameter("@F_Highopinions", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_limit", SqlDbType.Int,4),
                    new SqlParameter("@F_Reasontimeout", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_Canal", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_SMSReply", SqlDbType.Int,4),
                    new SqlParameter("@F_Sid", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_VisitRemarks", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_Brand", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_Annotation", SqlDbType.NVarChar,-1),
                    new SqlParameter("@F_Production", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_Crops", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_CarNumber", SqlDbType.VarChar,20),
                    new SqlParameter("@F_LoadingFee", SqlDbType.Decimal,9),
                    new SqlParameter("@F_UnLoadingFee", SqlDbType.Decimal,9),
                    new SqlParameter("@F_MaterialFee", SqlDbType.Decimal,9),
                    new SqlParameter("@F_Formula", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_ReturnQuantity", SqlDbType.Int,4),
                    new SqlParameter("@F_EventReason", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_MailingNumber", SqlDbType.VarChar,20),
                    new SqlParameter("@F_ExpressName", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_DealContent2", SqlDbType.NText),
                    new SqlParameter("@F_State2", SqlDbType.Int,4),
                    new SqlParameter("@F_Annotation2", SqlDbType.NVarChar,-1),
                    new SqlParameter("@F_VisitResultScore", SqlDbType.Int,4),
                    new SqlParameter("@F_EffectiveScore", SqlDbType.Int,4),
                    new SqlParameter("@F_ServiceAttitude", SqlDbType.Int,4),
                    new SqlParameter("@F_ProductQuality", SqlDbType.Int,4),
                    new SqlParameter("@F_NPS", SqlDbType.Int,4),
                    new SqlParameter("@F_EvaluationResult", SqlDbType.Decimal,9),
                    new SqlParameter("@F_WorkmanShip", SqlDbType.NVarChar,50),
                    new SqlParameter("@F_Manufacturers", SqlDbType.NVarChar,50),
                    new SqlParameter("@F_ProductionNum", SqlDbType.Int,4),
                    new SqlParameter("@F_SuperiorOpinion", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_DrivePhone", SqlDbType.VarChar,20),
                    new SqlParameter("@F_SuperiorOpinion2", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_EventReason2", SqlDbType.NVarChar,200),
                    new SqlParameter("@F_Flag", SqlDbType.Int,4),
                    new SqlParameter("@F_ID", SqlDbType.Int,4)};
            parameters[0].Value = model.F_WorkOrderCode;
            parameters[1].Value = model.F_CallID;
            parameters[2].Value = model.F_Source;
            parameters[3].Value = model.F_Type;
            parameters[4].Value = model.F_IncidentProvince;
            parameters[5].Value = model.F_IncidentCity;
            parameters[6].Value = model.F_IncidentCountry;
            parameters[7].Value = model.F_IncidentTownship;
            parameters[8].Value = model.F_IncidentDetailed;
            parameters[9].Value = model.F_SalesBase;
            parameters[10].Value = model.F_Description;
            parameters[11].Value = model.F_Files;
            parameters[12].Value = model.F_DealType;
            parameters[13].Value = model.F_CusPhone;
            parameters[14].Value = model.F_CusName;
            parameters[15].Value = model.F_CompanyName;
            parameters[16].Value = model.F_CustomerID;
            parameters[17].Value = model.F_MaterialID;
            parameters[18].Value = model.F_QuestionType;
            parameters[19].Value = model.F_BatchNumber;
            parameters[20].Value = model.F_TS_Formula;
            parameters[21].Value = model.F_TS_Category;
            parameters[22].Value = model.F_TS_Quantity;
            parameters[23].Value = model.F_TS_Level;
            parameters[24].Value = model.F_ZX_ProName;
            parameters[25].Value = model.F_ZX_Quantity;
            parameters[26].Value = model.F_ZX_Area;
            parameters[27].Value = model.F_ZX_Branch;
            parameters[28].Value = model.F_CJ_Time;
            parameters[29].Value = model.F_CJ_Level;
            parameters[30].Value = model.F_CJ_Unit;
            parameters[31].Value = model.F_CJ_TestUnit;
            parameters[32].Value = model.F_CJ_Tonnage;
            parameters[33].Value = model.F_CJ_BagNo;
            parameters[34].Value = model.F_CJ_Outlay;
            parameters[35].Value = model.F_State;
            parameters[36].Value = model.F_SC_ProductBase;
            parameters[37].Value = model.F_SC_PreliminaryOpinion;
            parameters[38].Value = model.F_SC_QualityMonth;
            parameters[39].Value = model.F_SC_CJ_SpotResult;
            parameters[40].Value = model.F_SC_CJ_SelfResult;
            parameters[41].Value = model.F_SC_CJ_ApprovalNo;
            parameters[42].Value = model.F_SC_CJ_ReturnAccount;
            parameters[43].Value = model.F_ZL_QualityEventLevel;
            parameters[44].Value = model.F_ZL_ClaimAmount;
            parameters[45].Value = model.F_ZL_ResponsibleUnit;
            parameters[46].Value = model.F_ZL_ApprovalOpinions;
            parameters[47].Value = model.F_ZL_ApprovalDisagree;
            parameters[48].Value = model.F_ZL_CompensationMethod;
            parameters[49].Value = model.F_ZL_CompensationMoney;
            parameters[50].Value = model.F_ZL_CResponsibleUnits;
            parameters[51].Value = model.F_ZL_Fquantity;
            parameters[52].Value = model.F_ZL_ImprovementRequirements;
            parameters[53].Value = model.F_ZL_CApprovalNo;
            parameters[54].Value = model.F_ZL_CJ_IsRecord;
            parameters[55].Value = model.F_IsAudit;
            parameters[56].Value = model.F_AuditState;
            parameters[57].Value = model.F_AuditBy;
            parameters[58].Value = model.F_AuditOn;
            parameters[59].Value = model.F_AuditCont;
            parameters[60].Value = model.F_IsOver;
            parameters[61].Value = model.F_DealBy;
            parameters[62].Value = model.F_DealTime;
            parameters[63].Value = model.F_DealContent;
            parameters[64].Value = model.F_DealResult;
            parameters[65].Value = model.F_DealReasons;
            parameters[66].Value = model.F_IsVisit;
            parameters[67].Value = model.F_VisitOn;
            parameters[68].Value = model.F_VisitBy;
            parameters[69].Value = model.F_VisitResult;
            parameters[70].Value = model.F_VisitReason;
            parameters[71].Value = model.F_CreateBy;
            parameters[72].Value = model.F_CreateOn;
            parameters[73].Value = model.F_UpdateCount;
            parameters[74].Value = model.F_UpdateBy;
            parameters[75].Value = model.F_UpdateOn;
            parameters[76].Value = model.F_IsDelete;
            parameters[77].Value = model.F_DeleteBy;
            parameters[78].Value = model.F_DeleteOn;
            parameters[79].Value = model.F_WxOpenId;
            parameters[80].Value = model.F_Callresults;
            parameters[81].Value = model.F_Highopinions;
            parameters[82].Value = model.F_limit;
            parameters[83].Value = model.F_Reasontimeout;
            parameters[84].Value = model.F_Canal;
            parameters[85].Value = model.F_SMSReply;
            parameters[86].Value = model.F_Sid;
            parameters[87].Value = model.F_VisitRemarks;
            parameters[88].Value = model.F_Brand;
            parameters[89].Value = model.F_Annotation;
            parameters[90].Value = model.F_Production;
            parameters[91].Value = model.F_Crops;
            parameters[92].Value = model.F_CarNumber;
            parameters[93].Value = model.F_LoadingFee;
            parameters[94].Value = model.F_UnLoadingFee;
            parameters[95].Value = model.F_MaterialFee;
            parameters[96].Value = model.F_Formula;
            parameters[97].Value = model.F_ReturnQuantity;
            parameters[98].Value = model.F_EventReason;
            parameters[99].Value = model.F_MailingNumber;
            parameters[100].Value = model.F_ExpressName;
            parameters[101].Value = model.F_DealContent2;
            parameters[102].Value = model.F_State2;
            parameters[103].Value = model.F_Annotation2;
            parameters[104].Value = model.F_VisitResultScore;
            parameters[105].Value = model.F_EffectiveScore;
            parameters[106].Value = model.F_ServiceAttitude;
            parameters[107].Value = model.F_ProductQuality;
            parameters[108].Value = model.F_NPS;
            parameters[109].Value = model.F_EvaluationResult;
            parameters[110].Value = model.F_WorkmanShip;
            parameters[111].Value = model.F_Manufacturers;
            parameters[112].Value = model.F_ProductionNum;
            parameters[113].Value = model.F_SuperiorOpinion;
            parameters[114].Value = model.F_DrivePhone;
            parameters[115].Value = model.F_SuperiorOpinion2;
            parameters[116].Value = model.F_EventReason2; 
            parameters[117].Value = model.F_Flag;
            parameters[118].Value = model.F_ID;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }

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

            StringBuilder strSql = new StringBuilder();
            strSql.Append("delete from T_Wo_WorkOrder ");
            strSql.Append(" where F_ID=@F_ID");
            SqlParameter[] parameters = {
                    new SqlParameter("@F_ID", SqlDbType.BigInt)
            };
            parameters[0].Value = ID;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        /// <summary>
        /// 批量删除数据
        /// </summary>
        public bool DeleteList(string IDlist)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update T_Wo_WorkOrder set F_IsDelete=1 ");
            //  strSql.Append("delete from T_Wo_WorkOrder ");
            strSql.Append(" where F_ID in (" + IDlist + ")  ");
            int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }


        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public CallCenterApi.Model.T_Wo_WorkOrder GetModel(long ID)
        {

            StringBuilder strSql = new StringBuilder();
            strSql.Append("select  top 1 * from T_Wo_WorkOrder ");
            strSql.Append(" where F_ID=@F_ID");
            SqlParameter[] parameters = {
                    new SqlParameter("@F_ID", SqlDbType.BigInt)
            };
            parameters[0].Value = ID;

            CallCenterApi.Model.T_Wo_WorkOrder model = new CallCenterApi.Model.T_Wo_WorkOrder();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
            if (ds.Tables[0].Rows.Count > 0)
            {
                return DataRowToModel(ds.Tables[0].Rows[0]);
            }
            else
            {
                return null;
            }
        }
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public CallCenterApi.Model.T_Wo_WorkOrder GetModelSid(string sid)
        {

            StringBuilder strSql = new StringBuilder();
            strSql.Append("select  top 1 * from T_Wo_WorkOrder ");
            strSql.Append(" where F_Sid=@F_Sid");
            SqlParameter[] parameters = {
                    new SqlParameter("@F_Sid", SqlDbType.VarChar,200)
            };
            parameters[0].Value = sid;

            CallCenterApi.Model.T_Wo_WorkOrder model = new CallCenterApi.Model.T_Wo_WorkOrder();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
            if (ds.Tables[0].Rows.Count > 0)
            {
                return DataRowToModel(ds.Tables[0].Rows[0]);
            }
            else
            {
                return null;
            }
        }
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public CallCenterApi.Model.T_Wo_WorkOrder GetModel(string WorkOrderId)
        {

            StringBuilder strSql = new StringBuilder();
            strSql.Append("select  top 1 * from T_Wo_WorkOrder ");
            strSql.Append(" where WorkOrderId=@WorkOrderId");
            SqlParameter[] parameters = {
                    new SqlParameter("@WorkOrderId", SqlDbType.BigInt)
            };
            parameters[0].Value = WorkOrderId;

            CallCenterApi.Model.T_Wo_WorkOrder model = new CallCenterApi.Model.T_Wo_WorkOrder();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
            if (ds.Tables[0].Rows.Count > 0)
            {
                return DataRowToModel(ds.Tables[0].Rows[0]);
            }
            else
            {
                return null;
            }
        }


        /// <summary>
		/// 得到一个对象实体
		/// </summary>
		public CallCenterApi.Model.T_Wo_WorkOrder DataRowToModel(DataRow row)
        {
            CallCenterApi.Model.T_Wo_WorkOrder model = new CallCenterApi.Model.T_Wo_WorkOrder();
            if (row != null)
            {
                if (row["F_ID"] != null && row["F_ID"].ToString() != "")
                {
                    model.F_ID = int.Parse(row["F_ID"].ToString());
                }
                if (row["F_WorkOrderCode"] != null)
                {
                    model.F_WorkOrderCode = row["F_WorkOrderCode"].ToString();
                }
                if (row["F_Callresults"] != null)
                {
                    model.F_Callresults = row["F_Callresults"].ToString();
                }
                if (row["F_CallID"] != null)
                {
                    model.F_CallID = row["F_CallID"].ToString();
                }
                if (row["F_Source"] != null)
                {
                    model.F_Source = row["F_Source"].ToString();
                }
                if (row["F_Type"] != null)
                {
                    model.F_Type = row["F_Type"].ToString();
                }
                if (row["F_IncidentProvince"] != null)
                {
                    model.F_IncidentProvince = row["F_IncidentProvince"].ToString();
                }
                if (row["F_IncidentCity"] != null)
                {
                    model.F_IncidentCity = row["F_IncidentCity"].ToString();
                }
                if (row["F_IncidentCountry"] != null)
                {
                    model.F_IncidentCountry = row["F_IncidentCountry"].ToString();
                }
                if (row["F_IncidentTownship"] != null)
                {
                    model.F_IncidentTownship = row["F_IncidentTownship"].ToString();
                }
                if (row["F_IncidentDetailed"] != null)
                {
                    model.F_IncidentDetailed = row["F_IncidentDetailed"].ToString();
                }
                if (row["F_CusName"] != null)
                {
                    model.F_CusName = row["F_CusName"].ToString();
                }
                if (row["F_CusPhone"] != null)
                {
                    model.F_CusPhone = row["F_CusPhone"].ToString();
                }
                if (row["F_CompanyName"] != null)
                {
                    model.F_CompanyName = row["F_CompanyName"].ToString();
                }
                if (row["F_SalesBase"] != null)
                {
                    model.F_SalesBase = row["F_SalesBase"].ToString();
                }
                if (row["F_Description"] != null)
                {
                    model.F_Description = row["F_Description"].ToString();
                }
                if (row["F_Files"] != null)
                {
                    model.F_Files = row["F_Files"].ToString();
                }
                if (row["F_DealType"] != null)
                {
                    model.F_DealType = row["F_DealType"].ToString();
                }
                if (row["F_CustomerID"] != null && row["F_CustomerID"].ToString() != "")
                {
                    model.F_CustomerID = row["F_CustomerID"].ToString();
                }
                if (row["F_MaterialID"] != null)
                {
                    model.F_MaterialID = row["F_MaterialID"].ToString();
                }
                if (row["F_QuestionType"] != null)
                {
                    model.F_QuestionType = row["F_QuestionType"].ToString();
                }
                if (row["F_BatchNumber"] != null)
                {
                    model.F_BatchNumber = row["F_BatchNumber"].ToString();
                }
                if (row["F_TS_Formula"] != null)
                {
                    model.F_TS_Formula = row["F_TS_Formula"].ToString();
                }
                if (row["F_TS_Category"] != null)
                {
                    model.F_TS_Category = row["F_TS_Category"].ToString();
                }
                if (row["F_TS_Quantity"] != null)
                {
                    model.F_TS_Quantity = row["F_TS_Quantity"].ToString();
                }
                if (row["F_TS_Level"] != null)
                {
                    model.F_TS_Level = row["F_TS_Level"].ToString();
                }
                if (row["F_ZX_ProName"] != null)
                {
                    model.F_ZX_ProName = row["F_ZX_ProName"].ToString();
                }
                if (row["F_ZX_Quantity"] != null)
                {
                    model.F_ZX_Quantity = row["F_ZX_Quantity"].ToString();
                }
                if (row["F_ZX_Area"] != null)
                {
                    model.F_ZX_Area = row["F_ZX_Area"].ToString();
                }
                if (row["F_ZX_Branch"] != null)
                {
                    model.F_ZX_Branch = row["F_ZX_Branch"].ToString();
                }
                if (row["F_CJ_Time"] != null && row["F_CJ_Time"].ToString() != "")
                {
                    model.F_CJ_Time = DateTime.Parse(row["F_CJ_Time"].ToString());
                }
                if (row["F_CJ_Level"] != null)
                {
                    model.F_CJ_Level = row["F_CJ_Level"].ToString();
                }
                if (row["F_CJ_Unit"] != null)
                {
                    model.F_CJ_Unit = row["F_CJ_Unit"].ToString();
                }
                if (row["F_CJ_TestUnit"] != null)
                {
                    model.F_CJ_TestUnit = row["F_CJ_TestUnit"].ToString();
                }
                if (row["F_CJ_Tonnage"] != null)
                {
                    model.F_CJ_Tonnage = row["F_CJ_Tonnage"].ToString();
                }
                if (row["F_CJ_BagNo"] != null)
                {
                    model.F_CJ_BagNo = row["F_CJ_BagNo"].ToString();
                }
                if (row["F_CJ_Outlay"] != null)
                {
                    model.F_CJ_Outlay = row["F_CJ_Outlay"].ToString();
                }
                if (row["F_State"] != null && row["F_State"].ToString() != "")
                {
                    model.F_State = int.Parse(row["F_State"].ToString());
                }
                if (row["F_SC_ProductBase"] != null)
                {
                    model.F_SC_ProductBase = row["F_SC_ProductBase"].ToString();
                }
                if (row["F_SC_PreliminaryOpinion"] != null)
                {
                    model.F_SC_PreliminaryOpinion = row["F_SC_PreliminaryOpinion"].ToString();
                }
                if (row["F_SC_QualityMonth"] != null)
                {
                    model.F_SC_QualityMonth = row["F_SC_QualityMonth"].ToString();
                }
                if (row["F_SC_CJ_SpotResult"] != null)
                {
                    model.F_SC_CJ_SpotResult = row["F_SC_CJ_SpotResult"].ToString();
                }
                if (row["F_SC_CJ_SelfResult"] != null)
                {
                    model.F_SC_CJ_SelfResult = row["F_SC_CJ_SelfResult"].ToString();
                }
                if (row["F_SC_CJ_ApprovalNo"] != null)
                {
                    model.F_SC_CJ_ApprovalNo = row["F_SC_CJ_ApprovalNo"].ToString();
                }
                if (row["F_SC_CJ_ReturnAccount"] != null)
                {
                    model.F_SC_CJ_ReturnAccount = row["F_SC_CJ_ReturnAccount"].ToString();
                }
                if (row["F_ZL_QualityEventLevel"] != null)
                {
                    model.F_ZL_QualityEventLevel = row["F_ZL_QualityEventLevel"].ToString();
                }
                if (row["F_ZL_ClaimAmount"] != null)
                {
                    model.F_ZL_ClaimAmount = row["F_ZL_ClaimAmount"].ToString();
                }
                if (row["F_ZL_ResponsibleUnit"] != null)
                {
                    model.F_ZL_ResponsibleUnit = row["F_ZL_ResponsibleUnit"].ToString();
                }
                if (row["F_ZL_ApprovalOpinions"] != null)
                {
                    model.F_ZL_ApprovalOpinions = row["F_ZL_ApprovalOpinions"].ToString();
                }
                if (row["F_ZL_ApprovalDisagree"] != null)
                {
                    model.F_ZL_ApprovalDisagree = row["F_ZL_ApprovalDisagree"].ToString();
                }
                if (row["F_ZL_CompensationMethod"] != null)
                {
                    model.F_ZL_CompensationMethod = row["F_ZL_CompensationMethod"].ToString();
                }
                if (row["F_ZL_CompensationMoney"] != null)
                {
                    model.F_ZL_CompensationMoney = row["F_ZL_CompensationMoney"].ToString();
                }
                if (row["F_ZL_CResponsibleUnits"] != null)
                {
                    model.F_ZL_CResponsibleUnits = row["F_ZL_CResponsibleUnits"].ToString();
                }
                if (row["F_ZL_Fquantity"] != null)
                {
                    model.F_ZL_Fquantity = row["F_ZL_Fquantity"].ToString();
                }
                if (row["F_ZL_ImprovementRequirements"] != null)
                {
                    model.F_ZL_ImprovementRequirements = row["F_ZL_ImprovementRequirements"].ToString();
                }
                if (row["F_ZL_CApprovalNo"] != null)
                {
                    model.F_ZL_CApprovalNo = row["F_ZL_CApprovalNo"].ToString();
                }
                if (row["F_ZL_CJ_IsRecord"] != null)
                {
                    model.F_ZL_CJ_IsRecord = row["F_ZL_CJ_IsRecord"].ToString();
                }
                if (row["F_IsAudit"] != null && row["F_IsAudit"].ToString() != "")
                {
                    model.F_IsAudit = int.Parse(row["F_IsAudit"].ToString());
                }
                if (row["F_AuditState"] != null && row["F_AuditState"].ToString() != "")
                {
                    model.F_AuditState = int.Parse(row["F_AuditState"].ToString());
                }
                if (row["F_AuditBy"] != null)
                {
                    model.F_AuditBy = row["F_AuditBy"].ToString();
                }
                if (row["F_AuditOn"] != null && row["F_AuditOn"].ToString() != "")
                {
                    model.F_AuditOn = DateTime.Parse(row["F_AuditOn"].ToString());
                }
                if (row["F_AuditCont"] != null)
                {
                    model.F_AuditCont = row["F_AuditCont"].ToString();
                }
                if (row["F_IsOver"] != null && row["F_IsOver"].ToString() != "")
                {
                    model.F_IsOver = int.Parse(row["F_IsOver"].ToString());
                }
                if (row["F_DealBy"] != null)
                {
                    model.F_DealBy = row["F_DealBy"].ToString();
                }
                if (row["F_DealTime"] != null && row["F_DealTime"].ToString() != "")
                {
                    model.F_DealTime = DateTime.Parse(row["F_DealTime"].ToString());
                }
                if (row["F_DealContent"] != null)
                {
                    model.F_DealContent = row["F_DealContent"].ToString();
                }
                if (row["F_DealResult"] != null)
                {
                    model.F_DealResult = row["F_DealResult"].ToString();
                }
                if (row["F_Reasontimeout"] != null)
                {
                    model.F_Reasontimeout = row["F_Reasontimeout"].ToString();
                }
                if (row["F_DealReasons"] != null)
                {
                    model.F_DealReasons = row["F_DealReasons"].ToString();
                }
                if (row["F_IsVisit"] != null && row["F_IsVisit"].ToString() != "")
                {
                    model.F_IsVisit = int.Parse(row["F_IsVisit"].ToString());
                }
                if (row["F_VisitOn"] != null && row["F_VisitOn"].ToString() != "")
                {
                    model.F_VisitOn = DateTime.Parse(row["F_VisitOn"].ToString());
                }
                if (row["F_VisitBy"] != null)
                {
                    model.F_VisitBy = row["F_VisitBy"].ToString();
                }
                if (row["F_VisitResult"] != null)
                {
                    model.F_VisitResult = row["F_VisitResult"].ToString();
                }
                if (row["F_VisitReason"] != null)
                {
                    model.F_VisitReason = row["F_VisitReason"].ToString();
                }
                if (row["F_CreateBy"] != null)
                {
                    model.F_CreateBy = row["F_CreateBy"].ToString();
                }
                if (row["F_CreateOn"] != null && row["F_CreateOn"].ToString() != "")
                {
                    model.F_CreateOn = DateTime.Parse(row["F_CreateOn"].ToString());
                }
                if (row["F_UpdateCount"] != null && row["F_UpdateCount"].ToString() != "")
                {
                    model.F_UpdateCount = int.Parse(row["F_UpdateCount"].ToString());
                }
                if (row["F_UpdateBy"] != null)
                {
                    model.F_UpdateBy = row["F_UpdateBy"].ToString();
                }
                if (row["F_UpdateOn"] != null && row["F_UpdateOn"].ToString() != "")
                {
                    model.F_UpdateOn = DateTime.Parse(row["F_UpdateOn"].ToString());
                }
                if (row["F_IsDelete"] != null && row["F_IsDelete"].ToString() != "")
                {
                    model.F_IsDelete = int.Parse(row["F_IsDelete"].ToString());
                }
                if (row["F_limit"] != null && row["F_limit"].ToString() != "")
                {
                    model.F_limit = int.Parse(row["F_limit"].ToString());
                }
                if (row["F_DeleteBy"] != null)
                {
                    model.F_DeleteBy = row["F_DeleteBy"].ToString();
                }
                if (row["F_DeleteOn"] != null && row["F_DeleteOn"].ToString() != "")
                {
                    model.F_DeleteOn = DateTime.Parse(row["F_DeleteOn"].ToString());
                }
                if (row["F_WxOpenId"] != null)
                {
                    model.F_WxOpenId = row["F_WxOpenId"].ToString();
                }
                if (row["F_Canal"] != null)
                {
                    model.F_Canal = row["F_Canal"].ToString();
                }
                if (row["F_SMSReply"] != null && row["F_SMSReply"].ToString() != "")
                {
                    model.F_SMSReply = int.Parse(row["F_SMSReply"].ToString());
                }
                if (row["F_Sid"] != null)
                {
                    model.F_Sid = row["F_Sid"].ToString();
                }
                if (row["F_VisitRemarks"] != null)
                {
                    model.F_VisitRemarks = row["F_VisitRemarks"].ToString();
                }
                if (row["F_Brand"] != null)
                {
                    model.F_Brand = row["F_Brand"].ToString();
                }
                if (row["F_Annotation"] != null)
                {
                    model.F_Annotation = row["F_Annotation"].ToString();
                }
                if (row["F_Production"] != null)
                {
                    model.F_Production = row["F_Production"].ToString();
                }
                if (row["F_Crops"] != null)
                {
                    model.F_Crops = row["F_Crops"].ToString();
                }
                if (row["F_CarNumber"] != null)
                {
                    model.F_CarNumber = row["F_CarNumber"].ToString();
                }
                if (row["F_LoadingFee"] != null && row["F_LoadingFee"].ToString() != "")
                {
                    model.F_LoadingFee = decimal.Parse(row["F_LoadingFee"].ToString());
                }
                if (row["F_UnLoadingFee"] != null && row["F_UnLoadingFee"].ToString() != "")
                {
                    model.F_UnLoadingFee = decimal.Parse(row["F_UnLoadingFee"].ToString());
                }
                if (row["F_MaterialFee"] != null && row["F_MaterialFee"].ToString() != "")
                {
                    model.F_MaterialFee = decimal.Parse(row["F_MaterialFee"].ToString());
                }
                if (row["F_Formula"] != null)
                {
                    model.F_Formula = row["F_Formula"].ToString();
                }
                if (row["F_ReturnQuantity"] != null && row["F_ReturnQuantity"].ToString() != "")
                {
                    model.F_ReturnQuantity = int.Parse(row["F_ReturnQuantity"].ToString());
                }
                if (row["F_EventReason"] != null)
                {
                    model.F_EventReason = row["F_EventReason"].ToString();
                }
                if (row["F_MailingNumber"] != null)
                {
                    model.F_MailingNumber = row["F_MailingNumber"].ToString();
                }
                if (row["F_ExpressName"] != null)
                {
                    model.F_ExpressName = row["F_ExpressName"].ToString();
                }
                if (row["F_DealContent2"] != null)
                {
                    model.F_DealContent2 = row["F_DealContent2"].ToString();
                }
                if (row["F_State2"] != null && row["F_State2"].ToString() != "")
                {
                    model.F_State2 = int.Parse(row["F_State2"].ToString());
                }
                if (row["F_Annotation2"] != null)
                {
                    model.F_Annotation2 = row["F_Annotation2"].ToString();
                }
                if (row["F_VisitResultScore"] != null && row["F_VisitResultScore"].ToString() != "")
                {
                    model.F_VisitResultScore = int.Parse(row["F_VisitResultScore"].ToString());
                }
                if (row["F_EffectiveScore"] != null && row["F_EffectiveScore"].ToString() != "")
                {
                    model.F_EffectiveScore = int.Parse(row["F_EffectiveScore"].ToString());
                }
                if (row["F_ServiceAttitude"] != null && row["F_ServiceAttitude"].ToString() != "")
                {
                    model.F_ServiceAttitude = int.Parse(row["F_ServiceAttitude"].ToString());
                }
                if (row["F_ProductQuality"] != null && row["F_ProductQuality"].ToString() != "")
                {
                    model.F_ProductQuality = int.Parse(row["F_ProductQuality"].ToString());
                }
                if (row["F_NPS"] != null && row["F_NPS"].ToString() != "")
                {
                    model.F_NPS = int.Parse(row["F_NPS"].ToString());
                }
                if (row["F_EvaluationResult"] != null && row["F_EvaluationResult"].ToString() != "")
                {
                    model.F_EvaluationResult = decimal.Parse(row["F_EvaluationResult"].ToString());
                }
                if (row["F_WorkmanShip"] != null)
                {
                    model.F_WorkmanShip = row["F_WorkmanShip"].ToString();
                }
                if (row["F_Manufacturers"] != null)
                {
                    model.F_Manufacturers = row["F_Manufacturers"].ToString();
                }
                if (row["F_ProductionNum"] != null && row["F_ProductionNum"].ToString() != "")
                {
                    model.F_ProductionNum = int.Parse(row["F_ProductionNum"].ToString());
                }
                if (row["F_SuperiorOpinion"] != null)
                {
                    model.F_SuperiorOpinion = row["F_SuperiorOpinion"].ToString();
                }
                if (row["F_DrivePhone"] != null)
                {
                    model.F_DrivePhone = row["F_DrivePhone"].ToString();
                }
                if (row["F_SuperiorOpinion2"] != null)
                {
                    model.F_SuperiorOpinion2 = row["F_SuperiorOpinion2"].ToString();
                }
                if (row["F_EventReason2"] != null)
                {
                    model.F_EventReason2 = row["F_EventReason2"].ToString();
                }
                if (row["F_Flag"] != null && row["F_Flag"].ToString() != "")
                {
                    model.F_Flag = int.Parse(row["F_Flag"].ToString());
                }


            }
            return model;
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select * ");
            strSql.Append(" FROM T_Wo_WorkOrder ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            return DbHelperSQL.Query(strSql.ToString());
        }

        /// <summary>
        /// 获得前几行数据
        /// </summary>
        public DataSet GetList(int Top, string strWhere, string filedOrder)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select ");
            if (Top > 0)
            {
                strSql.Append(" top " + Top.ToString());
            }
            strSql.Append(" * ");
            strSql.Append(" FROM T_Wo_WorkOrder ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            strSql.Append(" order by " + filedOrder);
            return DbHelperSQL.Query(strSql.ToString());
        }

        /// <summary>
        /// 获取记录总数
        /// </summary>
        public int GetRecordCount(string strWhere)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select count(1) FROM T_Wo_WorkOrder ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            object obj = DbHelperSQL.GetSingle(strSql.ToString());
            if (obj == null)
            {
                return 0;
            }
            else
            {
                return Convert.ToInt32(obj);
            }
        }
        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("SELECT * FROM ( ");
            strSql.Append(" SELECT ROW_NUMBER() OVER (");
            if (!string.IsNullOrEmpty(orderby.Trim()))
            {
                strSql.Append("order by T." + orderby);
            }
            else
            {
                strSql.Append("order by T.ID desc");
            }
            strSql.Append(")AS Row, T.*  from T_Wo_WorkOrder T ");
            if (!string.IsNullOrEmpty(strWhere.Trim()))
            {
                strSql.Append(" WHERE " + strWhere);
            }
            strSql.Append(" ) TT");
            strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex);
            return DbHelperSQL.Query(strSql.ToString());
        }

        /*
		/// <summary>
		/// 分页获取数据列表
		/// </summary>
		public DataSet GetList(int PageSize,int PageIndex,string strWhere)
		{
			SqlParameter[] parameters = {
					new SqlParameter("@tblName", SqlDbType.VarChar, 255),
					new SqlParameter("@fldName", SqlDbType.VarChar, 255),
					new SqlParameter("@PageSize", SqlDbType.Int),
					new SqlParameter("@PageIndex", SqlDbType.Int),
					new SqlParameter("@IsReCount", SqlDbType.Bit),
					new SqlParameter("@OrderType", SqlDbType.Bit),
					new SqlParameter("@strWhere", SqlDbType.VarChar,1000),
					};
			parameters[0].Value = "T_Wo_WorkOrder";
			parameters[1].Value = "ID";
			parameters[2].Value = PageSize;
			parameters[3].Value = PageIndex;
			parameters[4].Value = 0;
			parameters[5].Value = 0;
			parameters[6].Value = strWhere;	
			return DbHelperSQL.RunProcedure("UP_GetRecordByPage",parameters,"ds");
		}*/

        #endregion  BasicMethod
        #region  ExtensionMethod

        /// <summary>
        /// 处理工单
        /// </summary>
        public int DealWorkOrder(string strorderid, int isend, string strcont, int jsbm, string jsgh, string clgh)
        {
            SqlParameter[] parameters = {
                    new SqlParameter("@orderid", SqlDbType.VarChar, 50),
                    new SqlParameter("@isend", SqlDbType.Int),
                    new SqlParameter("@cont", SqlDbType.NVarChar,-1),
                    new SqlParameter("@jsbm", SqlDbType.Int),
                    new SqlParameter("@jsgh", SqlDbType.VarChar,-1),
                    new SqlParameter("@clgh", SqlDbType.VarChar,50)
                    };
            parameters[0].Value = strorderid;
            parameters[1].Value = isend;
            parameters[2].Value = strcont;
            parameters[3].Value = jsbm;
            parameters[4].Value = jsgh;
            parameters[5].Value = clgh;
            int n = 0;
            return DbHelperSQL.RunProcedure("DealWorkOrder", parameters, out n);
        }

        #endregion  ExtensionMethod
    }
}


