using System;
using System.IO;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Data.OleDb;

//using SystemFramework;
using DataLinkMesWork;
namespace bizFacade
{
    public partial class BaseDataSystemMES
    {
        /// <summary>
        /// MES_装配数据_零部件追溯_数据主表
        /// </summary>
        /// <param name="traceID"></param>
        static public void AssemblyPartIndexTableInsert(out long traceID)
        {
            traceID = 0;
            try
            {
                string sql = GetSqlStringAssemblyPartIndexTable();
                //if (SQLCommon.SqlServerConnectionStatus)
                {
                    DataAccess.ExecuteNonQuery_newID(sql, out traceID);

                }
                //if (!SQLCommon.SqlServerConnectionStatus)
                //{
                //    DataAccess.ExecuteNonQuery_newID_OleDb(sql, out traceID);
                //}
            }
            catch (Exception err)
            {
                ////ApplicationLog.WriteLog(err, err.Message);
            }
        }
        /// <summary>
        /// MES_装配数据_零部件追溯_增加
        /// </summary>
        /// <param name="dt"></param>
        /// <returns></returns>
        public static void VerifyAssemblyPartTableInsert(DataTable dt)
        {

            //if (SQLCommon.SqlServerConnectionStatus)
            {
                //如果与SQL Server 数据库通讯失败，ApplicationConfig.connectionStringPIS_NEW_Value = "0"
                VerifyAssemblyPartTableInsert_SqlServer(dt);
            }
            //if (!SQLCommon.SqlServerConnectionStatus)
            //{
            //    VerifyAssemblyPartTableInsert_Access(dt);
            //}

        }
        /// <summary>
        /// 同步通讯方式
        /// MES_装配数据_零部件追溯_增加
        /// SQL Server 数据库
        /// </summary>
        /// <param name="dt"></param>
        /// <returns></returns>
        public static bool VerifyAssemblyPartTableInsert_SqlServer(DataTable dt)
        {
            string sql;
            sql = "INSERT INTO [MES_装配数据_零部件追溯]"
                + "([追溯代码],[订单号],[SAP物料号],[发动机型号],[发动机型号代码], [发动机机型], "
                + "[发动机数量], [厂牌编号起始号], [客户名称],[投料日期],[文件编号],[集团名称],[通知号],"
                + "[功率],[指南文件编号],[装机状态],[适用状态],[物料描述],[计划下达日期],[计划完工日期],"
                + "[主配厂家],[工位号], [工位名称],[物料号], [零件图号], [零件名称], [零件数量],"
                + "[是否扫描],[扫描方式代码], [扫描方式], [是否主物料],[厂家代码],[生产厂家],  "
                + "[操作指导],[发动机号],[追踪代码],[主物料号],[物料号表索引号],[零件数量验证],"
                + "[物料条码], [物料条码物料号], [物料条码批次],[验证结果], [操作者工号], [操作者姓名], [班次代码], "
                + "物料来源代码,物料来源,是否禁用代码,是否禁用,被强制验证物料号,"
                + "更改代码,更改原因,零件类型,操作时间)"

                + "VALUES(@追溯代码,@订单号,@SAP物料号,@发动机型号,@发动机型号代码,@发动机机型,"
                + "@发动机数量,@厂牌编号起始号,@客户名称,@投料日期,@文件编号,@集团名称,@通知号,"
                + "@功率,@指南文件编号,@装机状态,@适用状态,@物料描述,@计划下达日期,@计划完工日期,"
                + "@主配厂家,@工位号,@工位名称,@物料号,@零件图号,@零件名称,@零件数量,"
                + " @是否扫描,@扫描方式代码,@扫描方式,@是否主物料,@厂家代码,@生产厂家,"
                + "@操作指导,@发动机号,@追踪代码,@主物料号,@物料号表索引号,@零件数量验证,"
                + "@物料条码,@物料条码物料号,@物料条码批次,@验证结果,@操作者工号,@操作者姓名,@班次代码,"
                + "@物料来源代码,@物料来源,@是否禁用代码,@是否禁用,@被强制验证物料号,"
                + "@更改代码,@更改原因,@零件类型,@操作时间)";



            SqlParameter[] thisParmsSql = new SqlParameter[55];
            //    + "([订单号],[SAP物料号],[发动机型号],[发动机型号代码], [发动机机型], "
            thisParmsSql[0] = new SqlParameter("@追溯代码", SqlDbType.Int, 4, "追溯代码");
            thisParmsSql[1] = new SqlParameter("@订单号", SqlDbType.NVarChar, 50, "订单号");
            thisParmsSql[2] = new SqlParameter("@SAP物料号", SqlDbType.NVarChar, 50, "SAP物料号");
            thisParmsSql[3] = new SqlParameter("@发动机型号", SqlDbType.NVarChar, 50, "发动机型号");
            thisParmsSql[4] = new SqlParameter("@发动机型号代码", SqlDbType.Int, 4, "发动机型号代码");
            thisParmsSql[5] = new SqlParameter("@发动机机型", SqlDbType.NVarChar, 50, "发动机机型");

            //     + "@发动机数量,@厂牌编号起始号,@客户名称,@投料日期,@文件编号,@集团名称,@通知号,"
            thisParmsSql[6] = new SqlParameter("@发动机数量", SqlDbType.Int, 4, "发动机数量");
            thisParmsSql[7] = new SqlParameter("@厂牌编号起始号", SqlDbType.Int, 4, "厂牌编号起始号");
            thisParmsSql[8] = new SqlParameter("@客户名称", SqlDbType.NVarChar, 50, "客户名称");
            thisParmsSql[9] = new SqlParameter("@投料日期", SqlDbType.DateTime, 8, "投料日期");
            thisParmsSql[10] = new SqlParameter("@文件编号", SqlDbType.NVarChar, 50, "文件编号");
            thisParmsSql[11] = new SqlParameter("@集团名称", SqlDbType.NVarChar, 50, "集团名称");
            thisParmsSql[12] = new SqlParameter("@通知号", SqlDbType.NVarChar, 50, "通知号");

            //    + "@功率,@指南文件编号,@装机状态,@适用状态,@物料描述,@计划下达日期,@计划完工日期,"
            thisParmsSql[13] = new SqlParameter("@功率", SqlDbType.NVarChar, 50, "功率");
            thisParmsSql[14] = new SqlParameter("@指南文件编号", SqlDbType.NVarChar, 50, "指南文件编号");
            thisParmsSql[15] = new SqlParameter("@装机状态", SqlDbType.NVarChar, 50, "装机状态");
            thisParmsSql[16] = new SqlParameter("@适用状态", SqlDbType.DateTime, 8, "适用状态");
            thisParmsSql[17] = new SqlParameter("@物料描述", SqlDbType.NVarChar, 255, "物料描述");
            thisParmsSql[18] = new SqlParameter("@计划下达日期", SqlDbType.DateTime, 8, "计划下达日期");
            thisParmsSql[19] = new SqlParameter("@计划完工日期", SqlDbType.DateTime, 8, "计划完工日期");

            //    + "@主配厂家,@工位号,@工位名称,@物料号,@零件图号,@零件名称,@零件数量,"

            thisParmsSql[20] = new SqlParameter("@主配厂家", SqlDbType.NVarChar, 50, "主配厂家");
            thisParmsSql[21] = new SqlParameter("@工位号", SqlDbType.NVarChar, 50, "工位号");
            thisParmsSql[22] = new SqlParameter("@工位名称", SqlDbType.NVarChar, 50, "工位名称");
            thisParmsSql[23] = new SqlParameter("@物料号", SqlDbType.NVarChar, 50, "物料号");
            thisParmsSql[24] = new SqlParameter("@零件图号", SqlDbType.NVarChar, 50, "零件图号");
            thisParmsSql[25] = new SqlParameter("@零件名称", SqlDbType.NVarChar, 50, "零件名称");
            thisParmsSql[26] = new SqlParameter("@零件数量", SqlDbType.Int, 4, "零件数量");

            //    +"[是否扫描],扫描方式代码, [扫描方式], [厂家代码],[生产厂家],  "

            thisParmsSql[27] = new SqlParameter("@是否扫描", SqlDbType.Int, 4, "是否扫描");
            thisParmsSql[28] = new SqlParameter("@扫描方式代码", SqlDbType.Int, 4, "扫描方式代码");
            thisParmsSql[29] = new SqlParameter("@扫描方式", SqlDbType.NVarChar, 50, "扫描方式");
            thisParmsSql[30] = new SqlParameter("@是否主物料", SqlDbType.Int, 4, "是否主物料");
            thisParmsSql[31] = new SqlParameter("@厂家代码", SqlDbType.NVarChar, 50, "厂家代码");
            thisParmsSql[32] = new SqlParameter("@生产厂家", SqlDbType.NVarChar, 50, "生产厂家");

            //+ "@操作指导,@发动机号,@物料号表索引号,@零件数量验证,"

            thisParmsSql[33] = new SqlParameter("@操作指导", SqlDbType.NVarChar, 255, "操作指导");
            thisParmsSql[34] = new SqlParameter("@发动机号", SqlDbType.NVarChar, 50, "发动机号");
            thisParmsSql[35] = new SqlParameter("@追踪代码", SqlDbType.NVarChar, 50, "追踪代码");
            thisParmsSql[36] = new SqlParameter("@主物料号", SqlDbType.NVarChar, 50, "主物料号");
            thisParmsSql[37] = new SqlParameter("@物料号表索引号", SqlDbType.Int, 4, "物料号表索引号");
            thisParmsSql[38] = new SqlParameter("@零件数量验证", SqlDbType.Int, 4, "零件数量验证");

            //     +"[物料条码], [物料条码物料号], [物料条码批次],@验证结果, [操作者工号], [操作者姓名], [班次代码], "
            thisParmsSql[39] = new SqlParameter("@物料条码", SqlDbType.NVarChar, 50, "物料条码");
            thisParmsSql[40] = new SqlParameter("@物料条码物料号", SqlDbType.NVarChar, 50, "物料条码物料号");
            thisParmsSql[41] = new SqlParameter("@物料条码批次", SqlDbType.NVarChar, 50, "物料条码批次");
            thisParmsSql[42] = new SqlParameter("@验证结果", SqlDbType.Int, 4, "验证结果");
            thisParmsSql[43] = new SqlParameter("@操作者工号", SqlDbType.NVarChar, 50, "操作者工号");
            thisParmsSql[44] = new SqlParameter("@操作者姓名", SqlDbType.NVarChar, 50, "操作者姓名");
            thisParmsSql[45] = new SqlParameter("@班次代码", SqlDbType.NVarChar, 50, "班次代码");

            //    +"物料来源代码,物料来源,是否禁用代码,是否禁用,被强制验证物料号,更改代码,更改原因)"

            thisParmsSql[46] = new SqlParameter("@物料来源代码", SqlDbType.Int, 4, "物料来源代码");
            thisParmsSql[47] = new SqlParameter("@物料来源", SqlDbType.NVarChar, 50, "物料来源");
            thisParmsSql[48] = new SqlParameter("@是否禁用代码", SqlDbType.Int, 4, "是否禁用代码");
            thisParmsSql[49] = new SqlParameter("@是否禁用", SqlDbType.NVarChar, 50, "是否禁用");
            thisParmsSql[50] = new SqlParameter("@被强制验证物料号", SqlDbType.NVarChar, 50, "被强制验证物料号");
            thisParmsSql[51] = new SqlParameter("@更改代码", SqlDbType.NVarChar, 50, "更改代码");
            thisParmsSql[52] = new SqlParameter("@更改原因", SqlDbType.NVarChar, 255, "更改原因");
            thisParmsSql[53] = new SqlParameter("@零件类型", SqlDbType.Int, 4, "零件类型");
            thisParmsSql[54] = new SqlParameter("@操作时间", SqlDbType.DateTime, 8, "操作时间");
            if (dt == null) return false;
            //如果与SQL Server 数据库通讯失败，ApplicationConfig.connectionStringPIS_NEW_Value = "0"

            return DataAccess.ExecuteSQL(sql, ref  thisParmsSql, dt);



        }
        /// <summary>
        /// 异步通讯方式
        /// 增加数据到Access数据库
        /// MES_装配数据_零部件追溯
        /// INSERT INTO [MES_装配数据_零部件追溯]
        /// </summary>
        /// <param name="dt"></param>
        /// <returns></returns>
        //public static bool VerifyAssemblyPartTableInsert_Access(DataTable dt)
        //{
        //    string sql;
        //    sql = "INSERT INTO [MES_装配数据_零部件追溯]"
        //        + "([追溯代码],[订单号],[SAP物料号],[发动机型号],[发动机型号代码], [发动机机型], "
        //        + "[发动机数量], [厂牌编号起始号], [客户名称],[投料日期],[文件编号],[集团名称],[通知号],"
        //        + "[功率],[指南文件编号],[装机状态],[适用状态],[物料描述],[计划下达日期],[计划完工日期],"
        //        + "[主配厂家],[工位号], [工位名称],[物料号], [零件图号], [零件名称], [零件数量],"
        //        + "[是否扫描],[扫描方式代码], [扫描方式], [是否主物料],[厂家代码],[生产厂家],  "
        //        + "[操作指导],[发动机号],[追踪代码],[主物料号],[物料号表索引号],[零件数量验证],"
        //        + "[物料条码], [物料条码物料号], [物料条码批次],[验证结果], [操作者工号], [操作者姓名], [班次代码], "
        //        + "物料来源代码,物料来源,是否禁用代码,是否禁用,被强制验证物料号,更改代码,更改原因,零件类型,操作时间)"

        //        + "VALUES(@追溯代码,@订单号,@SAP物料号,@发动机型号,@发动机型号代码,@发动机机型,"
        //        + "@发动机数量,@厂牌编号起始号,@客户名称,@投料日期,@文件编号,@集团名称,@通知号,"
        //        + "@功率,@指南文件编号,@装机状态,@适用状态,@物料描述,@计划下达日期,@计划完工日期,"
        //        + "@主配厂家,@工位号,@工位名称,@物料号,@零件图号,@零件名称,@零件数量,"
        //        + " @是否扫描,@扫描方式代码,@扫描方式,@是否主物料,@厂家代码,@生产厂家,"
        //        + "@操作指导,@发动机号,@追踪代码,@主物料号,@物料号表索引号,@零件数量验证,"
        //        + "@物料条码,@物料条码物料号,@物料条码批次,@验证结果,@操作者工号,@操作者姓名,@班次代码,"
        //        + "@物料来源代码,@物料来源,@是否禁用代码,@是否禁用,@被强制验证物料号,"
        //        + "@更改代码,@更改原因,@零件类型,@操作时间)";


        //    OleDbParameter[] thisParms1 = new OleDbParameter[55];
        //    //    + "([追溯代码],[订单号],[SAP物料号],[发动机型号],[发动机型号代码], [发动机机型], "
        //    thisParms1[0] = new OleDbParameter("@追溯代码", OleDbType.Integer, 4, "追溯代码");
        //    thisParms1[1] = new OleDbParameter("@订单号", OleDbType.VarChar, 50, "订单号");
        //    thisParms1[2] = new OleDbParameter("@SAP物料号", OleDbType.VarChar, 50, "SAP物料号");
        //    thisParms1[3] = new OleDbParameter("@发动机型号", OleDbType.VarChar, 50, "发动机型号");
        //    thisParms1[4] = new OleDbParameter("@发动机型号代码", OleDbType.Integer, 4, "发动机型号代码");
        //    thisParms1[5] = new OleDbParameter("@发动机机型", OleDbType.VarChar, 50, "发动机机型");

        //    //     + "@发动机数量,@厂牌编号起始号,@客户名称,@投料日期,@文件编号,@集团名称,@通知号,"
        //    thisParms1[6] = new OleDbParameter("@发动机数量", OleDbType.Integer, 4, "发动机数量");
        //    thisParms1[7] = new OleDbParameter("@厂牌编号起始号", OleDbType.Integer, 4, "厂牌编号起始号");
        //    thisParms1[8] = new OleDbParameter("@客户名称", OleDbType.VarChar, 50, "客户名称");
        //    thisParms1[9] = new OleDbParameter("@投料日期", OleDbType.DBDate, 8, "投料日期");
        //    thisParms1[10] = new OleDbParameter("@文件编号", OleDbType.VarChar, 50, "文件编号");
        //    thisParms1[11] = new OleDbParameter("@集团名称", OleDbType.VarChar, 50, "集团名称");
        //    thisParms1[12] = new OleDbParameter("@通知号", OleDbType.VarChar, 50, "通知号");

        //    //    + "@功率,@指南文件编号,@装机状态,@适用状态,@物料描述,@计划下达日期,@计划完工日期,"
        //    thisParms1[13] = new OleDbParameter("@功率", OleDbType.VarChar, 50, "功率");
        //    thisParms1[14] = new OleDbParameter("@指南文件编号", OleDbType.VarChar, 50, "指南文件编号");
        //    thisParms1[15] = new OleDbParameter("@装机状态", OleDbType.VarChar, 50, "装机状态");
        //    thisParms1[16] = new OleDbParameter("@适用状态", OleDbType.DBDate, 8, "适用状态");
        //    thisParms1[17] = new OleDbParameter("@物料描述", OleDbType.VarChar, 255, "物料描述");
        //    thisParms1[18] = new OleDbParameter("@计划下达日期", OleDbType.DBDate, 8, "计划下达日期");
        //    thisParms1[19] = new OleDbParameter("@计划完工日期", OleDbType.DBDate, 8, "计划完工日期");

        //    //    + "@主配厂家,@工位号,@工位名称,@物料号,@零件图号,@零件名称,@零件数量,"

        //    thisParms1[20] = new OleDbParameter("@主配厂家", OleDbType.VarChar, 50, "主配厂家");
        //    thisParms1[21] = new OleDbParameter("@工位号", OleDbType.VarChar, 50, "工位号");
        //    thisParms1[22] = new OleDbParameter("@工位名称", OleDbType.VarChar, 50, "工位名称");
        //    thisParms1[23] = new OleDbParameter("@物料号", OleDbType.VarChar, 50, "物料号");
        //    thisParms1[24] = new OleDbParameter("@零件图号", OleDbType.VarChar, 50, "零件图号");
        //    thisParms1[25] = new OleDbParameter("@零件名称", OleDbType.VarChar, 50, "零件名称");
        //    thisParms1[26] = new OleDbParameter("@零件数量", OleDbType.Integer, 4, "零件数量");

        //    //    +"[是否扫描],扫描方式代码, [扫描方式], [厂家代码],[生产厂家],  "

        //    thisParms1[27] = new OleDbParameter("@是否扫描", OleDbType.Integer, 4, "是否扫描");
        //    thisParms1[28] = new OleDbParameter("@扫描方式代码", OleDbType.Integer, 4, "扫描方式代码");
        //    thisParms1[29] = new OleDbParameter("@扫描方式", OleDbType.VarChar, 50, "扫描方式");
        //    thisParms1[30] = new OleDbParameter("@是否主物料", OleDbType.Integer, 4, "是否主物料");
        //    thisParms1[31] = new OleDbParameter("@厂家代码", OleDbType.VarChar, 50, "厂家代码");
        //    thisParms1[32] = new OleDbParameter("@生产厂家", OleDbType.VarChar, 50, "生产厂家");

        //    //+ "@操作指导,@发动机号,@物料号表索引号,@零件数量验证,"

        //    thisParms1[33] = new OleDbParameter("@操作指导", OleDbType.VarChar, 255, "操作指导");
        //    thisParms1[34] = new OleDbParameter("@发动机号", OleDbType.VarChar, 50, "发动机号");
        //    thisParms1[35] = new OleDbParameter("@追踪代码", OleDbType.VarChar, 50, "追踪代码");
        //    thisParms1[36] = new OleDbParameter("@主物料号", OleDbType.VarChar, 50, "主物料号");
        //    thisParms1[37] = new OleDbParameter("@物料号表索引号", OleDbType.Integer, 4, "物料号表索引号");
        //    thisParms1[38] = new OleDbParameter("@零件数量验证", OleDbType.Integer, 4, "零件数量验证");

        //    //     +"[物料条码], [物料条码物料号], [物料条码批次],@验证结果, [操作者工号], [操作者姓名], [班次代码], "
        //    thisParms1[39] = new OleDbParameter("@物料条码", OleDbType.VarChar, 50, "物料条码");
        //    thisParms1[40] = new OleDbParameter("@物料条码物料号", OleDbType.VarChar, 50, "物料条码物料号");
        //    thisParms1[41] = new OleDbParameter("@物料条码批次", OleDbType.VarChar, 50, "物料条码批次");
        //    thisParms1[42] = new OleDbParameter("@验证结果", OleDbType.Integer, 4, "验证结果");
        //    thisParms1[43] = new OleDbParameter("@操作者工号", OleDbType.VarChar, 50, "操作者工号");
        //    thisParms1[44] = new OleDbParameter("@操作者姓名", OleDbType.VarChar, 50, "操作者姓名");
        //    thisParms1[45] = new OleDbParameter("@班次代码", OleDbType.VarChar, 50, "班次代码");

        //    //    +"物料来源代码,物料来源,是否禁用代码,是否禁用,被强制验证物料号,更改代码,更改原因)"

        //    thisParms1[46] = new OleDbParameter("@物料来源代码", OleDbType.Integer, 4, "物料来源代码");
        //    thisParms1[47] = new OleDbParameter("@物料来源", OleDbType.VarChar, 50, "物料来源");
        //    thisParms1[48] = new OleDbParameter("@是否禁用代码", OleDbType.Integer, 4, "是否禁用代码");
        //    thisParms1[49] = new OleDbParameter("@是否禁用", OleDbType.VarChar, 50, "是否禁用");
        //    thisParms1[50] = new OleDbParameter("@被强制验证物料号", OleDbType.VarChar, 50, "被强制验证物料号");
        //    thisParms1[51] = new OleDbParameter("@更改代码", OleDbType.VarChar, 50, "更改代码");
        //    thisParms1[52] = new OleDbParameter("@更改原因", OleDbType.VarChar, 255, "更改原因");
        //    thisParms1[53] = new OleDbParameter("@零件类型", OleDbType.Integer, 4, "零件类型");
        //    thisParms1[54] = new OleDbParameter("@操作时间", OleDbType.DBTimeStamp, 8, "操作时间");

        //    return DataAccess.ExecuteDataTable_OleDb_Insert_Access(sql, dt, ref  thisParms1);
        //}
        /// <summary>
        /// 获得增加表[MES_装配数据_零部件追溯_数据主表]的SQL语句
        /// </summary>
        private static string GetSqlStringAssemblyPartIndexTable()
        {
            string sql = null;
            sql = "INSERT INTO [MES_装配数据_零部件追溯_数据主表] " +
                "(订单号,订单计划发动机号,发动机号,追踪代码,主物料号,工位号,到达时间,离开时间,操作者工号,班次代码,"
                + "[SAP物料号],[发动机型号],[发动机型号代码], [发动机机型], "
                + "[发动机数量], [厂牌编号起始号], [客户名称],[投料日期],[文件编号],[集团名称],[通知号],"
                + "[功率],[指南文件编号],[装机状态],[适用状态],[物料描述],[计划下达日期],[计划完工日期],[主配厂家],[零件类型],[是否禁用],[返修标志])"
                + " VALUES ("
                //订单号,发动机号,追踪代码,工位号,到达时间,离开时间,操作者工号,班次代码
                + "'" + MaterialData.orderForm + "',"
                + "'" + MaterialData.engineNumber_OrderPlan + "',"
                + "'" + MaterialData.engineNumber + "',"
                + "'" + MaterialData.engineTraceCode + "',"
                + "'" + MaterialData.mainMaterialNumber + "',"
                + "'" + MaterialData.opName + "',"
                + "'" + MaterialData.arrivedTime.ToString("G") + "',"
                + "'" + MaterialData.leavedTime.ToString("G") + "',"
                + "'" + MaterialData.operatorCode + "',"
                + "'" + MaterialData.operatorShift + "',"
                //+ "[SAP物料号],[发动机型号],[发动机型号代码], [发动机机型], "

                + "'" + MaterialData.sAPMaterialNumber + "',"
                + "'" + MaterialData.engineNumberType + "',"
                + "" + MaterialData.engineNumberCode + ","//int
                + "'" + MaterialData.engineNumberBasicType + "',"
                //+ "[发动机数量], [厂牌编号起始号], [客户名称],[投料日期],[文件编号],[集团名称],[通知号],"

                + "" + MaterialData.engineCount + ","//int
                + "'" + MaterialData.engineNumberFirstID + "',"//int
                + "'" + MaterialData.customesName + "',"
                + "'" + MaterialData.prepareMaterialDateTime.ToString("G") + "',"
                + "'" + MaterialData.fileCode + "',"
                + "'" + MaterialData.groupName + "',"
                + "'" + MaterialData.notifyCode + "',"
                //+ "[功率],[指南文件编号],[装机状态],[适用状态],[物料描述],[计划下达日期],[计划完工日期],主配厂家,零件类型,是否禁用,返修标志"
                + "'" + MaterialData.n_Force + "',"
                + "'" + MaterialData.directFileCode + "',"
                + "'" + MaterialData.workEngineStatus + "',"
                + "'" + MaterialData.adaptDateTime.ToString("G") + "',"
                + "'" + MaterialData.materialDescript + "',"
                + "'" + MaterialData.planSendedDateTime.ToString("G") + "',"
                + "'" + MaterialData.planFinishDateTime.ToString("G") + "',"
                + "'" + MaterialData.mainPruduceFatory + "',"
                + "" + MaterialData.partType.ToString() + ","
                + "" + MaterialData.isMainMaterial.ToString() + ","
                + "" + MaterialData.isRepairID.ToString() + ") ";
            return sql;
        }
    }
}
