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


//using SystemFramework;

namespace bizFacade
{
    public partial class BaseDataSystemMES
    {
        /// <summary>
        /// 增加,[MES_装配数据_零部件追溯_临时状态_缺省物料]
        /// </summary>
        /// <param name="barCode">物料条码</param>
        //static public void DefaultMaterialBarCodeInsert(string barCode)
        //{
        //    string sql;
        //    sql = "INSERT INTO [MES_装配数据_零部件追溯_临时状态_缺省物料] (物料条码)"
        //    +"VALUES('"+barCode+"')";
        //    DataAccess.ExecuteSQL_OleDb_Access(sql);
        //}
        /// <summary>
        /// 修改,[MES_装配数据_零部件追溯_临时状态_缺省物料]
        /// </summary>
        /// <param name="ID"></param>
        /// <param name="barCode"></param>
        //static public void DefaultMaterialBarCodeUpdate(string ID,string barCode)
        //{
        //    string sql;
        //    sql = "UPDATE [MES_装配数据_零部件追溯_临时状态_缺省物料] "
        //    + "SET 物料条码 = '" + barCode + "'"
        //    + "WHERE ID = "+ID.ToString();
        //    DataAccess.ExecuteSQL_OleDb_Access(sql);
        //}
        /// <summary>
        /// 删除
        /// [MES_装配数据_零部件追溯_临时状态_缺省物料]
        /// </summary>
        /// <param name="ID"></param>
        //static public void DefaultMaterialBarCodeDelete(string ID)
        //{
        //    string sql;
        //    sql = "DELETE FROM [MES_装配数据_零部件追溯_临时状态_缺省物料] "
        //    + "WHERE ID = " + ID.ToString();
        //    DataAccess.ExecuteSQL_OleDb_Access(sql);
        //}
        /// <summary>
        /// 获得 [MES_装配数据_零部件追溯_临时状态_缺省物料]
        /// </summary>
        /// <param name="dt"></param>
        //static public void DefaultMaterialBarCodeSelect(out DataTable dt)
        //{
        //    string sql;
        //    sql = "SELECT * FROM [MES_装配数据_零部件追溯_临时状态_缺省物料] ";
        //    DataAccess.ExecuteDataTable_OleDb_Access(sql, out  dt);
        //}    
        /// <summary>
        /// 强制验证物料删除,要将原物料设置为启用状态
        /// </summary>
        /// <param name="materialNumberVerify"></param>
        //static public void WorkPositionGuidOnLine_MaterialUpdateByMaterrial(string materialNumberVerify)
        //{
        //    string sql;
        //    sql = "UPDATE MES_计划BOM_订单计划下达 SET 是否禁用代码=0 WHERE 物料号='" + materialNumberVerify+"'";

        //    DataAccess.ExecuteSQL_OleDb_Access(sql);
        //}        
        /// <summary>
        /// 物料禁用
        /// </summary>
        /// <param name="ID"></param>
        //static public void WorkPositionGuidOnLine_MaterialNoUsing(int ID)
        //{
        //    string sql;
        //    sql = "UPDATE MES_计划BOM_订单计划下达 SET 是否禁用代码=1 WHERE ID=" + Convert.ToString(ID);

        //    DataAccess.ExecuteSQL_OleDb_Access(sql);
        //}
        /// <summary>
        /// 物料启用
        /// </summary>
        /// <param name="ID"></param>
        //static public void WorkPositionGuidOnLine_MaterialUsing(int ID)
        //{
        //    string sql;
        //    sql = "UPDATE MES_计划BOM_订单计划下达 SET 是否禁用代码=0 WHERE ID=" + Convert.ToString(ID);

        //    DataAccess.ExecuteSQL_OleDb_Access(sql);
        //}

        /// <summary>
        /// 订单号, 发动机型号, 发动机类型, 发动机数量
        /// </summary>
        /// <param name="orderForm"></param>
        /// <param name="dt"></param>
        //static public void WorkPositionGuidOnLine_OrderForm(string orderForm, out DataTable dt)
        //{
        //    string sql;
        //    sql = "SELECT distinct 订单号, 发动机型号, 发动机机型, 发动机数量, 客户名称,投料日期,计划下达日期  "
        //        + "FROM MES_计划BOM_订单计划下达_执行顺序  WHERE 订单号='"
        //        + orderForm + "'";

        //    DataAccess.ExecuteDataTable_OleDb_Access(sql, out  dt);
        //}



        /// <summary>
        /// MES_计划BOM_订单计划下达_扫描方式
        /// </summary>
        /// <param name="dt"></param>
        //static public void WorkPositionGuidOnLine_MaterialVerifyID(out DataTable dt)
        //{
        //    string sql;
        //    sql = "SELECT 扫描方式代码,扫描方式 from MES_计划BOM_订单计划下达_扫描方式  ";
        //    DataAccess.ExecuteDataTable_OleDb_Access(sql, out  dt);
        //}
        /// <summary>
        /// MES_计划BOM_订单计划下达_物料来源
        /// </summary>
        /// <param name="dt"></param>
        //static public void WorkPositionGuidOnLine_MaterialComeFrom(out DataTable dt)
        //{
        //    string sql;
        //    sql = "SELECT 物料来源代码,物料来源 from MES_计划BOM_订单计划下达_物料来源  ";
        //    DataAccess.ExecuteDataTable_OleDb_Access(sql, out  dt);
        //}
        /// <summary>
        /// MES_计划BOM_订单计划下达_是否禁用
        /// </summary>
        /// <param name="dt"></param>
        //static public void WorkPositionGuidOnLine_MaterialIsUsing(out DataTable dt)
        //{
        //    string sql;
        //    sql = "SELECT 是否禁用代码,是否禁用 from MES_计划BOM_订单计划下达_是否禁用  ";
        //    DataAccess.ExecuteDataTable_OleDb_Access(sql, out  dt);
        //}
                
        /// <summary>
        /// 物料验证
        /// 删除新物料
        /// </summary>
        /// <param name="ID"></param>
        //static public void WorkPositionGuidOnLine_NewMaterial_Delete(int ID)
        //{
        //    string sql;
        //    sql = "DELETE FROM MES_计划BOM_订单计划下达  WHERE ID=" + Convert.ToString(ID);

        //    DataAccess.ExecuteSQL_OleDb_Access(sql);
        //}

        /// <summary>
        /// 物料验证
        /// 添加新物料
        /// </summary>
        /// <param name="dt"></param>
        //static public bool WorkPositionGuidOnLine_NewMaterial_Insert(DataTable dt)
        //{
        //    string sql;
        //    sql =
        //        "INSERT INTO [MES_计划BOM_订单计划下达]" +
        //        "([订单号], [SAP物料号], [发动机型号],  [发动机型号代码], [发动机机型]," +
        //        "[发动机数量], [厂牌编号起始号], [客户名称], [投料日期], [文件编号], [集团名称], [通知号], " +
        //        "[功率], [指南文件编号], [装机状态], [适用状态], [物料描述],[计划下达日期], [计划完工日期],[实际完成日期],[实际结束日期],[操作时间], " +
        //        "[主配厂家],[工位号], [工位名称], [物料号], [零件图号], [零件名称], [零件数量],[是否扫描],[扫描方式],[厂家代码], [生产厂家], " +
        //        "[操作指导],[工位基本操作指导],[工位基本指导图片],[日计划产量], [工位操作指导],[工位指导图片],[物料来源代码],[是否禁用代码],[被强制验证物料号],更改代码,更改原因)" +
        //        "VALUES(@订单号,@SAP物料号,@发动机型号,@发动机型号代码,@发动机机型," +
        //        "@发动机数量,@厂牌编号起始号,@客户名称,@投料日期,@文件编号,@集团名称,@通知号," +
        //        "@功率,@指南文件编号,@装机状态,@适用状态,@物料描述,@计划下达日期,@计划完工日期,@实际完成日期,@实际结束日期,@操作时间," +
        //        "@主配厂家,@工位号,@工位名称,@物料号,@零件图号,@零件名称,@零件数量,@是否扫描,@扫描方式,@厂家代码,@生产厂家," +
        //        "@操作指导,@工位基本操作指导,@工位基本指导图片,@日计划产量,@工位操作指导,@工位指导图片,@物料来源代码,@是否禁用代码,@被强制验证物料号,@更改代码,@更改原因)";
        //    OleDbParameter[] thisParms = new OleDbParameter[44];
        //    thisParms[0] = new OleDbParameter("@订单号", OleDbType.VarChar, 50, "订单号");
        //    thisParms[1] = new OleDbParameter("@SAP物料号", OleDbType.VarChar, 50, "SAP物料号");
        //    thisParms[2] = new OleDbParameter("@发动机型号", OleDbType.VarChar, 50, "发动机型号");
        //    thisParms[3] = new OleDbParameter("@发动机型号代码", OleDbType.Integer, 4, "发动机型号代码");
        //    thisParms[4] = new OleDbParameter("@发动机机型", OleDbType.VarChar, 50, "发动机机型");

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

        //    thisParms[12] = new OleDbParameter("@功率", OleDbType.VarChar, 50, "功率");
        //    thisParms[13] = new OleDbParameter("@指南文件编号", OleDbType.VarChar, 50, "指南文件编号");
        //    thisParms[14] = new OleDbParameter("@装机状态", OleDbType.VarChar, 50, "装机状态");
        //    thisParms[15] = new OleDbParameter("@适用状态", OleDbType.VarChar, 50, "适用状态");
        //    thisParms[16] = new OleDbParameter("@物料描述", OleDbType.VarChar, 255, "物料描述");
        //    thisParms[17] = new OleDbParameter("@计划下达日期", OleDbType.DBDate, 8, "计划下达日期");
        //    thisParms[18] = new OleDbParameter("@计划完工日期", OleDbType.DBDate, 8, "计划完工日期");
        //    thisParms[19] = new OleDbParameter("@实际完成日期", OleDbType.DBDate, 8, "实际完成日期");
        //    thisParms[20] = new OleDbParameter("@实际结束日期", OleDbType.DBDate, 8, "实际结束日期");
        //    thisParms[21] = new OleDbParameter("@操作时间", OleDbType.DBDate, 8, "操作时间");

        //    thisParms[22] = new OleDbParameter("@主配厂家", OleDbType.VarChar, 50, "主配厂家");
        //    thisParms[23] = new OleDbParameter("@工位号", OleDbType.VarChar, 50, "工位号");
        //    thisParms[24] = new OleDbParameter("@工位名称", OleDbType.VarChar, 255, "工位名称");
        //    thisParms[25] = new OleDbParameter("@物料号", OleDbType.VarChar, 50, "物料号");
        //    thisParms[26] = new OleDbParameter("@零件图号", OleDbType.VarChar, 50, "零件图号");
        //    thisParms[27] = new OleDbParameter("@零件名称", OleDbType.VarChar, 255, "零件名称");
        //    thisParms[28] = new OleDbParameter("@零件数量", OleDbType.Integer, 4, "零件数量");
        //    thisParms[29] = new OleDbParameter("@是否扫描", OleDbType.Integer, 4, "是否扫描");
        //    thisParms[30] = new OleDbParameter("@扫描方式", OleDbType.Integer, 4, "扫描方式");
        //    thisParms[31] = new OleDbParameter("@厂家代码", OleDbType.VarChar, 255, "厂家代码");
        //    thisParms[32] = new OleDbParameter("@生产厂家", OleDbType.VarChar, 255, "生产厂家");


        //    thisParms[33] = new OleDbParameter("@操作指导", OleDbType.VarChar, 255, "操作指导");
        //    thisParms[34] = new OleDbParameter("@工位基本操作指导", OleDbType.VarChar, 255, "工位基本操作指导");
        //    thisParms[35] = new OleDbParameter("@工位基本指导图片", OleDbType.VarBinary, 10000000, "工位基本指导图片");
        //    thisParms[36] = new OleDbParameter("@日计划产量", OleDbType.Integer, 4, "日计划产量");
        //    thisParms[37] = new OleDbParameter("@工位操作指导", OleDbType.VarChar, 255, "工位操作指导");
        //    thisParms[38] = new OleDbParameter("@工位指导图片", OleDbType.VarBinary, 10000000, "工位指导图片");

        //    thisParms[39] = new OleDbParameter("@物料来源代码", OleDbType.Integer, 4, "物料来源代码");
        //    thisParms[40] = new OleDbParameter("@是否禁用代码", OleDbType.Integer, 4, "是否禁用代码");
        //    thisParms[41] = new OleDbParameter("@被强制验证物料号", OleDbType.VarChar, 255, "被强制验证物料号");
        //    thisParms[42] = new OleDbParameter("@更改代码", OleDbType.VarChar, 255, "更改代码");
        //    thisParms[43] = new OleDbParameter("@更改原因", OleDbType.VarChar, 255, "更改原因");

        //    return DataAccess.ExecuteDataTable_OleDb_Insert_Access(sql, dt, ref thisParms);
        //}
    }
}
