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
{
    /// <summary>
    /// 关键零部件追溯
    /// </summary>
    public partial class BaseDataSystemMES
    {
        /// <summary>
        /// 删除追踪代码
        /// </summary>
        /// <returns></returns>
        //public static void CartTraceCodeCheck(string opName, string TraceCode)
        //{
        //    string sql;
        //    sql = "DELETE FROM [MES_装配数据_零部件追溯] "
        //    + " where 追踪代码='" + TraceCode + "'";

        //    DataAccess.ExecuteSQL_OleDb_Access(sql);
        //    sql = "DELETE FROM  [MES_装配数据_零部件追溯_数据主表] "
        //    + " where 追踪代码='" + TraceCode + "'";
        //    DataAccess.ExecuteSQL_OleDb_Access(sql);
        //}
        /// <summary>
        /// 删除追踪代码
        /// 对于曲轴活塞上线工位，如果[MES_装配数据_零部件追溯_数据主表] 中[追踪代码]数量大于3删除
        /// </summary>
        /// <returns></returns>
        //public static void CartTraceCodeCheck_F3(string opName, string TraceCode)
        //{
        //    int count;
        //    string sql;

        //    sql = "SELECT COUNT(*) FROM [MES_装配数据_零部件追溯] "
        //    + " where 追踪代码='" + TraceCode + "'"
        //    + " and 工位号='" + opName+"'";
        //    DataAccess.ExecuteOutNum_OleDb_Access(sql, out  count);
        //    if (count >= 3)
        //    {
        //        sql = "DELETE FROM [MES_装配数据_零部件追溯] "
        //        + " where 追踪代码='" + TraceCode + "'";

        //        DataAccess.ExecuteSQL_OleDb_Access(sql);
        //        sql = "DELETE FROM  [MES_装配数据_零部件追溯_数据主表] "
        //        + " where 追踪代码='" + TraceCode + "'";
        //        DataAccess.ExecuteSQL_OleDb_Access(sql);
        //    }
        //}
        /// <summary>
        /// 更改物料[发动机号][追踪号码]
        /// [MES_装配数据_零部件追溯_临时状态]
        /// </summary>
        /// <returns></returns>
        //public static void CartTraceCodeUpdate_TraceCode(string engineID, string traceCode)
        //{
        //    string sql;
        //    sql = "UPDATE  [MES_装配数据_零部件追溯_临时状态] "
        //        + " SET 发动机号 = '" + engineID + "'"
        //        + ",追踪代码 = '" + traceCode + "'";
        //    DataAccess.ExecuteSQL_OleDb_Access(sql);
        //}
        /// <summary>
        /// [MES_装配数据_零部件追溯_临时状态]
        /// </summary>
        /// <returns></returns>
        //public static void CartTraceCodeSelect_TraceCode(out DataTable dt)
        //{
        //    string sql;
        //    sql = "SELECT TOP 1 * FROM  [MES_装配数据_零部件追溯_临时状态] ";
        //    DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
        //}
        /// <summary>
        /// 更改物料[追踪号码]
        /// [MES_装配数据_零部件追溯_临时状态]
        /// </summary>
        /// <returns></returns>
        //public static void CartTraceCodeUpdate(string opName, string TraceCode)
        //{
        //    string sql;
        //    sql = "UPDATE  [MES_装配数据_零部件追溯_临时状态] "
        //        + " SET 发动机号 = '" + TraceCode + "'"
        //        + ",追踪代码 = '" + TraceCode + "'"
        //    + " where 工位号='" + opName + "'";
        //    DataAccess.ExecuteSQL_OleDb_Access(sql);
        //}
        /// <summary>
        /// 总线缸盖上线工位
        /// 根据[追踪号码]获得验证物料
        /// </summary>
        /// <returns></returns>
        //public static void CartTraceCodeGetVerifyMaterial(string opName, string TraceCode, string opNameOtherFileName,out DataTable dt)
        //{
        //    string sql;
        //    sql = "SELECT * FROM  [MES_装配数据_零部件追溯] "
        //        + " WHERE 追踪代码 = '" + TraceCode + "'"
        //        + " AND 工位号 = '" + opName + "'";
        //    DataAccess.ExecuteDataTable_OleDb_Access(sql, opNameOtherFileName, out dt);
        //}
        /// <summary>
        /// 总线缸盖上线工位
        /// 根据[追踪号码]获得全部验证物料
        /// </summary>
        /// <returns></returns>
        //public static void CartTraceCodeGetMaterial(string opName, string TraceCode, string opNameOtherFileName, out DataTable dt)
        //{
        //    string sql;
        //    sql = "SELECT * FROM  [MES_装配数据_零部件追溯] "
        //        + " WHERE 追踪代码 = '" + TraceCode + "'";
        //    DataAccess.ExecuteDataTable_OleDb_Access(sql, opNameOtherFileName, out dt);
        //}
    }
}
