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 BaseDataSystemMES
    {

        /// <summary>
        /// 基本数据_工作日历_查询
        /// 日期,班次代码,工位产量,工位节拍,在线产量,在线节拍
        /// </summary>
        /// <param name="dateTime"></param>
        /// <param name="opName"></param>
        /// <param name="shiftCode"></param>
        /// <param name="OpNameCount"></param>
        /// <param name="opNameTargetTime"></param>
        /// <param name="onlineCount"></param>
        /// <param name="onlineTargetTime"></param>
        static public void OpNameCount_Select(DateTime dateTime, string opName,
            out int shiftCode,out int OpNameCount,out int opNameTargetTime,out int onlineCount,out int onlineTargetTime)
        {

            DataTable dt;
            OpNameCount = 0;
            shiftCode = 1;
            OpNameCount = 0;
            opNameTargetTime = 0;
            onlineCount = 0;
            onlineTargetTime = 0;

            string procedureName;
            procedureName = "基本数据_工作日历_查询";
            SqlParameter[] thisParms = new SqlParameter[2];
            thisParms[0] = new System.Data.SqlClient.SqlParameter("@日期", dateTime);
            thisParms[1] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
            DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms,out dt);
            if (dt != null)
            {
                if (dt.Rows.Count > 0)
                {
                    try
                    {
                        shiftCode = Convert.ToInt32(dt.Rows[0]["班次代码"]);
                        OpNameCount = Convert.ToInt32(dt.Rows[0]["工位产量"]);
                        opNameTargetTime = Convert.ToInt32(dt.Rows[0]["工位节拍"]);
                        onlineCount = Convert.ToInt32(dt.Rows[0]["在线产量"]);
                        onlineTargetTime = Convert.ToInt32(dt.Rows[0]["在线节拍"]);
                    }
                    catch (Exception err)
                    {
                        ////ApplicationLog.WriteLog(err, err.Message);
                    }
                }
            }
        }
        /// <summary>
        /// MES_操作着_生产班次_查询
        /// </summary>
        /// <param name="dt"></param>
        static public void Shift_Select(out DataTable dt)
        {
            string sql;
            sql = "exec MES_操作着_生产班次_查询";
            DataAccess.ExecuteDataTable(sql, out dt);
        }
        /// <summary>
        /// 电子看板_托盘编号_查询
        /// </summary>
        /// <param name="dt"></param>
        static public void PartPalletCode_Select(out DataTable dt)
        {
            string sql;
            sql = "exec 电子看板_托盘编号_查询";
            DataAccess.ExecuteDataTable(sql,out dt);
        }



    }
}
