using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using DataLinkMesWork;
using System.Security.Cryptography;
//using SystemFramework;

namespace bizFacade
{
    public partial class MES
    {
        /// <summary>
        ///电子看板_发动机号_合格放行_记录_增加
        /// </summary>
        /// <param name="dt"></param>
        /// <returns></returns>
        public static bool InsertRecord_ComfirmOkGO(string opName, string userName, string type)
        {
            string procedureName = "电子看板_发动机号_合格放行_记录_增加";
            //string connectionString = ApplicationConfig.ConnectionString;
            string errorMessage;
            SqlParameter[] sqlParameters = new SqlParameter[3];
            sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
            sqlParameters[0].Direction = ParameterDirection.Input;
            sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@放行者工号", userName);
            sqlParameters[1].Direction = ParameterDirection.Input;
            sqlParameters[2] = new System.Data.SqlClient.SqlParameter("@放行类别", type);
            sqlParameters[2].Direction = ParameterDirection.Input;
            bool isOK;
            isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters);
            if (isOK)
            {
                return true;
            }
            else
            {
                return false;
            }

        }
        /// <summary>
        /// 操作指南-手动转线-增加
        /// </summary>
        /// <param name="opname"></param>
        /// <param name="Cbx_ManualTurnLine"></param>
        /// <returns></returns>
        public static bool ManualTurnLine_Insert(string opname, int Cbx_ManualTurnLine)
        {

            string procedureName = "测量数据工位_监控系统_手动转线_增加";
            //string connectionString = ApplicationConfig.ConnectionString;
            string errorMessage;
            SqlParameter[] sqlParameters = new SqlParameter[2];
            sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
            sqlParameters[0].Direction = ParameterDirection.Input;
            sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@是否启用转线", Cbx_ManualTurnLine);
            sqlParameters[1].Direction = ParameterDirection.Input;
            bool isOK;
            isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters);
            if (isOK)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        /// <summary>
        /// 操作指南-离线返修-增加
        /// </summary>
        /// <param name="opname"></param>
        /// <param name="Cbx_ManualTurnLine"></param>
        /// <returns></returns>
        public static bool OutLineRepair_Insert(string opname, int Cbx_OutLineRepair)
        {

            string procedureName = "测量数据工位_监控系统_离线返修_增加";
            //string connectionString = ApplicationConfig.ConnectionString;
            string errorMessage;
            SqlParameter[] sqlParameters = new SqlParameter[2];
            sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
            sqlParameters[0].Direction = ParameterDirection.Input;
            sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@离线返修", Cbx_OutLineRepair);
            sqlParameters[1].Direction = ParameterDirection.Input;
            bool isOK;
            isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters);
            if (isOK)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        /// <summary>
        /// 显示测量数据_工位号_根据发动机型号_查询
        /// </summary>
        /// <param name="opName"></param>
        /// <param name="engineID"></param>
        /// <param name="dt"></param>
        /// <returns></returns>
        static public bool QualityDataSelect_engineID(string opName, string engineID, out DataTable dt)
        {
            string procedureName;
            procedureName = "显示测量数据_工位号_根据发动机型号_查询";
            SqlParameter[] sqlParameters = new SqlParameter[2];
            sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
            sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
            return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
        }
        /// <summary>
        /// StudentSelect
        /// </summary>
        /// <param name="dt"></param>
        /// <returns></returns>
        public static bool getopname(string opname, out DataTable dt)
        {
            string procedureName = "MES_计划BOM_工位与名称_查询_根据工位号";
            SqlParameter[] sqlParameters = new SqlParameter[1];
            sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
            return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
        }

        /// <summary>
        /// 排产计划_查询计划
        /// </summary>
        /// <param name="opname"></param>
        /// <param name="selectDate"></param>
        /// <param name="tb"></param>
        /// <returns></returns>
        public static bool GetPlan(string opname,string selectDate, out DataTable tb)
        {
            string procedureName = "排产计划_查询计划";
            //string connectionString = ApplicationConfig.ConnectionString;
            DataSet ds;
            string errorMessage;
            bool isOK;
            tb = null;
            SqlParameter[] sqlParameters = new SqlParameter[2];
            sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@转生产订单日期", selectDate);
            sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
            isOK = DataAccess.ExecuteStoredProcedure(procedureName,ref sqlParameters,  out  ds);
            if (isOK)
            {
                if (ds.Tables.Count > 0)
                {
                    tb = ds.Tables[0];
                    return true;
                }
                else
                {
                    return false;
                }
            }
            else
            {
                return false;
            }
        
        }
        /// <summary>
        /// [电子看板_发动机号_线首工位_分线订单主表_数据_查询]
        /// </summary>
        /// <param name="opname"></param>
        /// <param name="selectDate"></param>
        /// <param name="tb"></param>
        /// <returns></returns>
        public static bool GetPlan_Cap(string opname, out DataTable tb)
        {
            string procedureName = "电子看板_发动机号_线首工位_分线订单主表_数据_查询";
            //string connectionString = ApplicationConfig.ConnectionString;
            DataSet ds;
            string errorMessage;
            bool isOK;
            tb = null;
            SqlParameter[] sqlParameters = new SqlParameter[1];
            sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
            isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out  ds);
            if (isOK)
            {
                if (ds.Tables.Count > 0)
                {
                    tb = ds.Tables[0];
                    return true;
                }
                else
                {
                    return false;
                }
            }
            else
            {
                return false;
            }

        }

        /// <summary>
        /// 电子看板_发动机号_工位队列表_查询_根据工位号(数据源工位) 20140709 wt 
        /// </summary>
        /// <param name="opname"></param>
        /// <param name="tb"></param>
        /// <returns></returns>
        public static bool GetQueue(string opname, out DataTable tb)
        {
            string procedureName = "电子看板_发动机号_工位队列表_查询_根据工位号";
            //string connectionString = ApplicationConfig.ConnectionString;
            DataSet ds;
            string errorMessage;
            bool isOK;
            tb = null;
            SqlParameter[] sqlParameters = new SqlParameter[1];
            sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@数据源工位", opname);
            isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out  ds);
            if (isOK)
            {
                if (ds.Tables.Count > 0)
                {
                    tb = ds.Tables[0];
                    return true;
                }
                else
                {
                    return false;
                }
            }
            else
            {
                return false;
            }
        }
        /// <summary>
        ///  电子看板_发动机号_工位队列表_增加  20140709 wt  ClearQueue
        /// </summary>
        /// <param name="opname"></param>
        /// <param name="engineId"></param>
        /// <param name="tb"></param>
        /// <returns></returns>
        public static bool InsertQueue(string opname, string engineId)
        {

            string procedureName = "电子看板_发动机号_工位队列表_增加";
            //string connectionString = ApplicationConfig.ConnectionString;
            string errorMessage;
            SqlParameter[] sqlParameters = new SqlParameter[2];
            sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@数据源工位", opname);
            sqlParameters[0].Direction = ParameterDirection.Input;
            sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", engineId);
            sqlParameters[1].Direction = ParameterDirection.Input;
            bool isOK;
            isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters);
            if (isOK)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        /// <summary>
        ///  电子看板_发动机号_工位队列表_清空  20140709 wt  
        /// </summary>
        /// <param name="opname"></param>
        /// <param name="engineId"></param>
        /// <param name="tb"></param>
        /// <returns></returns>
        //public static bool ClearQueue()
        //{

        //    string procedureName = "电子看板_发动机号_工位队列表_清空";
        //    //string connectionString = ApplicationConfig.ConnectionString;
        //    string errorMessage;
        //    bool isOK;
        //    isOK = DataAccess.ExecuteNonQuery(procedureName);
        //    if (isOK)
        //    {
        //        return true;
        //    }
        //    else
        //    {
        //        return false;
        //    }
        //}
        /// <summary>
        /// 测量数据合格_查询_WEB页面显示  20140622 wt
        /// </summary>
        /// <param name="opname"></param>
        /// <param name="selectDate"></param>
        /// <param name="tb"></param>
        /// <returns></returns>
        public static bool GetCurrentQuality_Select(string engineID,string opname, out DataTable tb)
        {
            string procedureName = "测量数据合格_查询_WEB页面显示";
            //string connectionString = ApplicationConfig.ConnectionString;
            DataSet ds;
            string errorMessage;
            bool isOK;
            tb = null;
            SqlParameter[] sqlParameters = new SqlParameter[2];
            sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
            sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
            isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out  ds);
            if (isOK)
            {
                if (ds.Tables.Count > 0)
                {
                    tb = ds.Tables[0];
                    return true;
                }
                else
                {
                    return false;
                }
            }
            else
            {
                return false;
            }

        }

        ///// <summary>
        ///// WEB查询按钮的信息  20140625 wt
        ///// </summary>
        ///// <param name="tb"></param>
        ///// <returns></returns>
        //public static bool OpnameSelect_Buttons(out DataTable tb)
        //{
        //    string procedureName = "WEB_质量查询模块_按钮基础信息_查询";
        //    //string connectionString = ApplicationConfig.ConnectionString;
        //    DataSet ds;
        //    string errorMessage;
        //    bool isOK;

        //    isOK = DataAccess.ExecuteStoredProcedure(procedureName, out  ds);
        //    if (isOK)
        //    {
        //        tb = ds.Tables[0];
        //        return true;
        //    }
        //    else
        //    {
        //        tb = null;
        //        return false;
        //    }

        //}
        /// <summary>
        ///  WEB_安东模块_物料原因按钮基础信息_查询  20140707 wt
        /// </summary>
        /// <param name="opname"></param>
        /// <param name="engineId"></param>
        /// <param name="tb"></param>
        /// <returns></returns>
        public static bool MaterialProblemButtons_Select(string opname, string engineId, out DataTable tb)
        {

            string procedureName = "WEB_安东模块_物料原因按钮基础信息_查询";
            //string connectionString = ApplicationConfig.ConnectionString;
            string errorMessage;
            bool isOK;
            SqlParameter[] sqlParameters = new SqlParameter[2];
            sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
            sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", engineId);
            DataSet ds;
            isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out  ds);
            if (isOK)
            {
                tb = ds.Tables[0];
                return true;
            }
            else
            {
                tb = null;
                return false;
            }
        }
        /// <summary>
        ///  WEB_安东模块_物料ANDON信息_插入  20140708 wt  
        /// </summary>
        /// <param name="opname"></param>
        /// <param name="engineId"></param>
        /// <param name="tb"></param>
        /// <returns></returns>
        public static bool MaterialProblemButtons_Insert(string opname, string materialname)
        {

            string procedureName = "WEB_安东模块_物料ANDON信息_插入";
            //string connectionString = ApplicationConfig.ConnectionString;
            string errorMessage;
            SqlParameter[] sqlParameters = new SqlParameter[2];
            sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
            sqlParameters[0].Direction = ParameterDirection.Input;
            sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@物料描述", materialname);
            sqlParameters[1].Direction = ParameterDirection.Input;
            bool isOK;
            isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters);
            if (isOK)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        /// <summary>
        /// WEB根据工位名称和发动机号查询质量数据 20140625 wt
        /// </summary>
        /// <param name="opname"></param>
        /// <param name="engineId"></param>
        /// <param name="tb"></param>
        /// <returns></returns>
        public static bool QualityData_Select(string opname, string engineId, out DataTable tb)
        {

            string procedureName = "WEB_质量查询模块_测量数据合格_查询";
            //string connectionString = ApplicationConfig.ConnectionString;
            string errorMessage;
            bool isOK;
            SqlParameter[] sqlParameters = new SqlParameter[2];
            sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
            sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", engineId);
            DataSet ds;
            isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out  ds);
            if (isOK)
            {
                tb = ds.Tables[0];
                return true;
            }
            else
            {
                tb = null;
                return false;
            }
        }
        /// <summary>
        /// WEB根据工位名称和发动机号查询质量数据合格索引(包括了分线的信息、存储过程中根据工位类型区分) 20140626 wt
        /// </summary>
        /// <param name="opname"></param>
        /// <param name="engineId"></param>
        /// <param name="tb"></param>
        /// <returns></returns>
        public static bool QualityDataButton_bgColor_Select(string opname, out DataTable dt)
        {
            string procedureName = "显示测量数据_工位号_查询";
            SqlParameter[] sqlParameters = new SqlParameter[1];
            sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
            return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
        }


        /// <summary>
        /// MES界面显示_弹窗消息_查询
        /// </summary>
        /// <param name="opname"></param>
        /// <param name="tb"></param>
        /// <returns></returns>
        public static bool ShowWindowNotice(string opname, out DataTable dt)
        {
            string procedureName = "MES界面显示_弹窗消息_查询";
            SqlParameter[] sqlParameters = new SqlParameter[1];
            sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
            return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
        }


        /// <summary>
        /// MES界面显示_消息滚动_查询
        /// </summary>
        /// <param name="opname"></param>
        /// <param name="tb"></param>
        /// <returns></returns>
        public static bool ShowLEDNotice(string opname, out DataTable dt)
        {
            string procedureName = "MES界面显示_消息滚动_查询";
            SqlParameter[] sqlParameters = new SqlParameter[1];
            sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
            return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
        }

        /// <summary>
        /// 上线临时表插入数据 20140609 通过页面直接插入数据库
        /// </summary>
        /// <param name="opName">工位号</param>
        /// <param name="engineID">发动机号</param>
        static public bool SubOnLoadTemp_Insert(string opName, string orderNum, string engineType, string sublineOrderID, out DataTable tb)
        {
            string procedureName = "电子看板_发动机号_上线临时表_增加";
            //string connectionString = ApplicationConfig.ConnectionString;
            DataSet ds;
            string errorMessage;
            bool isOK;
            tb = null;
           SqlParameter[] sqlParameters = new SqlParameter[4];
           sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
           sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@订单号", orderNum);
           sqlParameters[2] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
           sqlParameters[3] = new System.Data.SqlClient.SqlParameter("@分线主表数据ID", Convert.ToInt32(sublineOrderID));
            isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out  ds);
            if (isOK)
            {
                if (ds.Tables.Count > 0)
                {
                    tb = ds.Tables[0];
                    return true;
                }
                else
                {
                    return false;
                }
            }
            else
            {
                return false;
            }   
     
        }


        /// <summary>
        /// [电子看板_发动机号_线首工位_查询_根据发动机号和工位号] 20140604 王可心
        /// </summary>
        /// <param name="engineID"></param>
        /// <param name="opName"></param>
        static public bool GetEngineIDOpName_Select(string engineID, string opName, out DataTable dt)
        {
            string errorMessage = "";
            DataSet ds;
            bool isOK;
            dt = null;
            //string connectionString = ApplicationConfig.ConnectionString;
            string procedureName;
            procedureName = "电子看板_发动机号_线首工位_查询_根据发动机号和工位号";
            SqlParameter[] thisParms = new SqlParameter[2];
            thisParms[0] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
            thisParms[1] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
            isOK= DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out ds);
            if (isOK)
            {
                if (ds.Tables.Count > 0)
                {
                    dt = ds.Tables[0];
                    return true;
                }
                else
                {
                    return false;
                }
            }
            else
            {
                return false;
            }   
        }



        /// <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>
        /// 电子看板_装配零件_物料验证_查询 20131231 
        /// </summary>
        /// <param name="opName">工位号</param>
        /// <param name="engineID">发动机号</param>
        /// <param name="dt"></param>
        static public bool PartMaterialVerify_Select(string opName,  out DataTable dt)
        {
            string errorMessage = "";
            DataSet ds;
            dt = null;
            bool isOK;

            //string connectionString = ApplicationConfig.ConnectionString;

            string procedureName;
            procedureName = "电子看板_装配零件_物料验证_查询";
            SqlParameter[] thisParms = new SqlParameter[1];
            thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
            //thisParms[1] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);

            isOK= DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out ds);
            if (isOK)
            {
                if (ds.Tables.Count > 0)
                {
                    dt = ds.Tables[0];
                    return true;
                }
                else
                {
                    return false;
                }
            }
            else
            {
                return false;
            }   
        }

        /// <summary>
        /// 设备管理_设备维护内容_查询
        /// </summary>
        /// <param name="opName"></param>
        /// <param name="MachineType"></param>
        /// <param name="dt"></param>
        /// <returns></returns>ShowMaintainPic
        static public bool LoadMachineType(string opName,out DataTable dt)
        {
            string procedureName;
            procedureName = "设备管理_设备维护初始化_查询";
            SqlParameter[] sqlParameters = new SqlParameter[1];
            sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
            return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
        }

        /// <summary>
        /// 设备管理_设备维护内容_查询
        /// </summary>
        /// <param name="opName"></param>
        /// <param name="MachineType"></param>
        /// <param name="dt"></param>
        /// <returns></returns>ShowMaintainPic
        static public bool ShowMaintainData(string opName, string MachineType, out DataTable dt)
        {
            string procedureName;
            procedureName = "设备管理_设备维护内容_查询";
            SqlParameter[] sqlParameters = new SqlParameter[2];
            sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
            sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@保养类型代码", MachineType);
            return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
        }

        /// <summary>
        /// 设备管理_设备维护图片_查询
        /// </summary>
        /// <param name="opName"></param>
        /// <param name="MachineType"></param>
        /// <param name="pic"></param>
        static public void GetMaintainImageFile(string opName, string MachineType, out byte[] pic)
        {
            string sql;
            DataTable dt;
            pic = null;
            sql = "exec 设备管理_设备维护图片_查询 '" + opName + "'," + MachineType;
            DataAccess.ExecuteDataTable(sql, out  dt);
            if (dt != null)
            {
                if (dt.Rows.Count > 0)
                {
                    pic = (byte[])dt.Rows[0]["保养图片"];
                }
            }
        }

        /// <summary>
        /// 显示测量数据_工位数据_查询
        /// </summary>
        /// <param name="opName"></param>
        /// <param name="opname"></param>
        /// <param name="dt"></param>
        /// <returns></returns>
        static public bool QualityDataSelect(string opName, string opname, out DataTable dt)
        {
            string procedureName;
            procedureName = "显示测量数据_工位数据_查询";
            SqlParameter[] sqlParameters = new SqlParameter[2];
            sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
            sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@查询工位号", opname);
            return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
        }

        /// <summary>
        /// 显示物料数据_工位数据_查询
        /// </summary>
        /// <param name="opName"></param>
        /// <param name="opname"></param>
        /// <param name="dt"></param>
        /// <returns></returns>
        static public bool MaterialDataSelect(string opName, string opname, out DataTable dt)
        {
            string procedureName;
            procedureName = "显示物料数据_工位数据_查询";
            SqlParameter[] sqlParameters = new SqlParameter[2];
            sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
            sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@查询工位号", opname);
            return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
        }

        /// <summary>
        /// 操作指南-
        /// </summary>
        /// <param name="opName">工位号</param>
        /// <param name="IsNormalOrRepair">是否启用备用模式</param>
        /// <returns></returns>
        public static bool Assembel_RadioNormal_Insert(string opName, int IsNormalOrRepair)
        {
            string produceName = "测量数据工位_监控系统_拧紧与返修拧紧_增加";
            SqlParameter[] thisParms = new SqlParameter[2];
            thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
            thisParms[1] = new System.Data.SqlClient.SqlParameter("@是否启用备用模式", IsNormalOrRepair);
            return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
        }
        /// <summary>
        /// 测量数据工位_监控系统_返修上下线_上线_增加
        /// </summary>
        /// <param name="opName"></param>
        /// <param name="upLine"></param>
        /// <returns></returns>
        public static bool AssembelRadioNormalWork_Insert(string opName, int upLine)
        {
            string produceName = "测量数据工位_监控系统_返修上下线_上线_增加";
            SqlParameter[] thisParms = new SqlParameter[2];
            thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
            thisParms[1] = new System.Data.SqlClient.SqlParameter("@是否启用备用模式", upLine);
            return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
        }
        /// <summary>
        /// 启用拧紧_初始化
        /// </summary>
        /// <param name="opName"></param>
        /// <param name="tb"></param>
        public static void cbx_BakOpNameIsWorkStatus_Select(string opName, out DataTable tb)
        {
            string sql = "SELECT [是否启用备用模式] FROM [dbo].[测量数据工位_监控系统_拧紧与返修拧紧] WHERE [工位号]='" + opName + "'";
            //string connectionString = ApplicationConfig.ConnectionString;
            string errorMessage;
            tb = null;
            DataAccess.ExecuteDataTable(sql, out tb);
        }
    }
}
