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>
        /// 基本数据_工作日历_班次产量查询_New
        /// </summary>
        /// <param name="opName"></param>
        /// <param name="opNameCount">在线产量</param>
        /// <param name="opNameCountTime">在线节拍</param>
        static public void OpNameCount_BQ(string opName, out int opNameCount, out int opNameCountTime)
        {
            opNameCount = 0;
            opNameCountTime = 0;
            string procedureName;
            procedureName = "基本数据_工作日历_班次产量查询_北汽";
            SqlParameter[] thisParms = new SqlParameter[3];
            thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
            thisParms[1] = new System.Data.SqlClient.SqlParameter("@在线产量", 0);
            thisParms[1].Direction = ParameterDirection.Output;
            thisParms[2] = new System.Data.SqlClient.SqlParameter("@在线节拍", 0);
            thisParms[2].Direction = ParameterDirection.Output;
            if (DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms))
            {
                opNameCount = Convert.ToInt32(thisParms[1].Value);
                opNameCountTime = Convert.ToInt32(thisParms[2].Value);
            }
        }

        /// <summary>
        /// 基本数据_工作日历_班次产量查询_New
        /// </summary>
        /// <param name="opName"></param>
        /// <param name="opNameCount">在线产量</param>
        /// <param name="opNameCountTime">在线节拍</param>
        static public void OpNameCount_New(string opName, out int opNameCount, out int opNameCountTime)
        {
            opNameCount = 0;
            opNameCountTime = 0;
            string procedureName;
            procedureName = "基本数据_工作日历_班次产量查询_New";
            SqlParameter[] thisParms = new SqlParameter[3];
            thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
            thisParms[1] = new System.Data.SqlClient.SqlParameter("@在线产量", 0);
            thisParms[1].Direction = ParameterDirection.Output;
            thisParms[2] = new System.Data.SqlClient.SqlParameter("@在线节拍", 0);
            thisParms[2].Direction = ParameterDirection.Output;
            if (DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms))
            {
                opNameCount = Convert.ToInt32(thisParms[1].Value);
                opNameCountTime = Convert.ToInt32(thisParms[2].Value);
            }
        }

        /// <summary>
        /// MES界面显示_消息滚动_增加
        /// </summary>
        /// <param name="opName"></param>
        /// <param name="content"></param>
        /// <returns></returns>
        public static bool Rolling_news_Add(string opName, string content)
        {

            string procedureName = "MES界面显示_消息滚动_增加";
            bool isOK;
            SqlParameter[] thisParms = new SqlParameter[2];
            thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
            thisParms[1] = new System.Data.SqlClient.SqlParameter("@ScollNotice", content);
            isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
            if (isOK)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
    }
}
