using System;
using System.Data;
using System.Data.SqlClient;
using DataLinkMesWork;
using System.Collections;
using System.Collections.Specialized;
//using SystemFramework;

namespace bizFacade
{
    /// <summary>
    /// 电子看板信息系统
    /// </summary>
    public partial class ShaftPosition
    {
        /// <summary>
        /// 电子看板_工位机型_质量数据测量位置_查询_工作顺序
        /// </summary>
        /// <param name="opName"></param>
        /// <param name="engineTypeID"></param>
        /// <param name="dt"></param>
        static public void ShaftPosition_Select_WorkingStep(string opName, int engineTypeID, out DataTable dt)
        {
            dt = null;

            string sql = "exec 电子看板_工位机型_质量数据测量位置_查询_工作顺序 '" + opName + "'," + engineTypeID.ToString();
            DataAccess.ExecuteDataTable(sql, out  dt);
        }

        /// <summary>
        /// 电子看板_工位机型_质量数据测量位置_查询
        /// </summary>
        /// <param name="opName">工位号</param>
        /// <param name="engineTypeID">产品型号代码</param>
        /// <param name="dt"></param>
        static public void ShaftPosition_Select(string opName,int engineTypeID,out DataTable dt)
        {
            dt = null;

            string sql = "exec 电子看板_工位机型_质量数据测量位置_查询 '" + opName + "'," + engineTypeID.ToString();
            DataAccess.ExecuteDataTable(sql, out  dt);
        }
        /// <summary>
        /// 电子看板_装配零件_查询
        /// </summary>
        /// <param name="opName">工位号</param>
        /// <param name="engineType">产品型号代码</param>
        /// <param name="engineTypeID">产品型号代码</param>
        /// <param name="dt"></param>
        static public void Material_Select(string opName, string engineTypeID, string engineType, out DataTable dt)
        {
            dt = null;
            string sql = "exec 电子看板_装配零件_查询 '" + opName + "'," + engineTypeID.ToString() + ",'" + engineType + "'"; ;
            DataAccess.ExecuteDataTable(sql, out  dt);
        }
        /// <summary>
        /// 电子看板_装配零件_查询
        /// </summary>
        /// <param name="opName">工位号</param>
        /// <param name="engineTypeID">产品型号代码</param>
        /// <param name="dt"></param>
        static public void Material_Select_1(string opName, int engineTypeID, out DataTable dt)
        {
            dt = null;

            string sql = "exec 电子看板_装配零件_查询 '" + opName + "'," + engineTypeID.ToString() ;
            DataAccess.ExecuteDataTable(sql, out  dt);
        }
        /// <summary>
        /// 电子看板_工序内容_查询
        /// </summary>
        /// <param name="opName">工位号</param>
        /// <param name="engineTypeID">产品型号代码</param>
        /// <param name="dt"></param>
        static public void Process_Select(string opName, int engineTypeID, out DataTable dt)
        {
            dt = null;

            string sql = "exec 电子看板_工序内容_查询 '" + opName + "'," + engineTypeID.ToString();
            DataAccess.ExecuteDataTable(sql, out  dt);
        }
        /// <summary>
        /// 电子看板_工序内容_查询
        /// </summary>
        /// <param name="opName">工位号</param>
        /// <param name="engineTypeID">产品型号代码</param>
        /// <param name="dt"></param>
        static public void Process_Select_NeedDealWith(string opName, int engineTypeID, out DataTable dt)
        {
            dt = null;

            string sql = "exec 电子看板_工序内容_查询_需要处理 '" + opName + "'," + engineTypeID.ToString();
            DataAccess.ExecuteDataTable(sql, out  dt);
        }
        /// <summary>
        /// MES_基本变量_机型代码_查询
        /// </summary>
        /// <param name="dt"></param>
        static public void EngineType_Select(out DataTable dt)
        {
            dt = null;
            string sql = "exec MES_基本变量_机型代码_查询";
            DataAccess.ExecuteDataTable(sql, out  dt);
        }

        /// <summary>
        /// 电子看板_MES_基本变量_原始数据_更新测量数据
        /// </summary>
        /// <param name="opName"></param>
        /// <param name="engineTypeID"></param>
        /// <param name="shaftNo"></param>
        /// <param name="value1"></param>
        /// <param name="value2"></param>
        /// <param name="value3"></param>
        /// <param name="value4"></param>
        static public void ShaftDataUpdate(string opName, string engineTypeID, string shaftNo, string value1, string value2, string value3, string value4)
        {

            string sql = "exec 电子看板_MES_基本变量_原始数据_更新测量数据 ";
            sql = sql + " '" + opName + "',";
            sql = sql + " '" + engineTypeID + "',";
            sql = sql + " " + shaftNo.ToString() + ",";
            sql = sql + " '" + value1 + "',";
            sql = sql + " '" + value2 + "',";
            sql = sql + " '" + value3 + "',";
            sql = sql + " " + value4.ToString() +"";
            DataAccess.ExecuteSQL(sql);
        }
        /// <summary>
        /// 电子看板_MES_基本变量_原始数据_清零测量数据
        /// </summary>
        /// <param name="opName"></param>
        static public void ShaftDataClear(string opName)
        {

            string sql = "exec 电子看板_MES_基本变量_原始数据_更新测量数据 ";
            sql = sql + " '" + opName + "'";
            DataAccess.ExecuteSQL(sql);
        }

        /// <summary>
        /// 电子看板_MES_基本变量_原始数据_增加测量数据
        /// </summary>
        /// <param name="opName"></param>
        /// <param name="engineID"></param>
        /// <param name="engineType"></param>
        /// <param name="engineTypeID"></param>
        /// <param name="isGood"></param>
        /// <param name="dateTime"></param>
        static public void ShaftDataInsert(string opName, string engineID, string engineType, string engineTypeID,
            string isGood, string dateTime)
        {

            string sql = "exec 电子看板_MES_基本变量_原始数据_增加测量数据 ";
            sql = sql + " '" + opName + "',";
            sql = sql + " '" + engineID + "',";
            sql = sql + " '" + engineType + "',";
            sql = sql + " " + engineTypeID + ",";
            sql = sql + " " + isGood + ",";
            sql = sql + " '" + dateTime + "'";
            DataAccess.ExecuteSQL(sql);
        }


        /// <summary>
        /// [电子看板_工位机型_质量数据测量位置_查询_OP3010] 2012-12-13
        /// </summary>
        /// <param name="opName">工位号</param>
        /// <param name="engineTypeID">产品型号代码</param>
        /// <param name="dt"></param>
        static public void ShaftPosition_Select_OP3010(string opName, int engineTypeID,int IsUsing ,out DataTable dt)
        {
            dt = null;

            string sql = "exec 电子看板_工位机型_质量数据测量位置_查询_OP3010 '" + opName + "','" + engineTypeID.ToString() + "','" + IsUsing+ "'";
            DataAccess.ExecuteDataTable(sql, out  dt);
        }
        /// <summary>
        /// [电子看板_工位机型_质量数据测量位置_查询_工作顺序_OP3010] 2012-12-13
        /// </summary>
        /// <param name="opName"></param>
        /// <param name="engineTypeID"></param>
        /// <param name="dt"></param>
        static public void ShaftPosition_Select_WorkingStep_OP3010(string opName, int engineTypeID,int IsUsing, out DataTable dt)
        {
            dt = null;
            string sql = "exec 电子看板_工位机型_质量数据测量位置_查询_工作顺序_OP3010 '" + opName + "','" + engineTypeID.ToString() + "','" + IsUsing + "'";
            DataAccess.ExecuteDataTable(sql, out  dt);
        }


        /// <summary>
        /// [MES_操作者_用户_显示_查询]  2013-01-23 王可心 用户名增加用
        /// </summary>
        /// <param name="dt"></param>
        static public void UserName_Select(out DataTable dt)
        {
            dt = null;
            string sql = "exec MES_操作者_用户_显示_查询 ";
            DataAccess.ExecuteDataTable(sql, out  dt);
        }
    }
}
