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>
        /// MES_基本变量_厂家代码_查询
        /// </summary>
        static public void MaterialFactory_Select(out DataTable dt)
        {
            string sql;
            sql = "exec MES_基本变量_厂家代码_查询";
            DataAccess.ExecuteDataTable(sql, out  dt);
        }
        ///// <summary>
        ///// 电子看板_装配零件_查询
        ///// </summary>
        ///// <param name="opName"></param>
        ///// <param name="engineTypeID"></param>
        ///// <param name="dt"></param>
        //static public void PartMaterial_Select(string opName, string engineType,string engineTypeID, out DataTable dt)
        //{
        //    string sql;
        //    sql = "exec 电子看板_装配零件_查询 '" + opName + "'," + engineTypeID + ",'" + engineType+"'";
        //    DataAccess.ExecuteDataTable(sql, out  dt);
        //}
        /// <summary>
        /// 电子看板_装配零件_增加
        /// </summary>
        /// <param name="opName">工位号</param>
        /// <param name="engineTypeID">产品型号代码</param>
        /// <param name="MaterialMark">标号</param>
        /// <param name="PartDrawNumber">零件图号</param>
        /// <param name="PartName">零件名称</param>
        /// <param name="PartCount">零件数量</param>
        /// <param name="MaterialNumber">零件批号</param>
        /// <param name="PartFactor">生产厂家</param>
        /// <param name="PartMemo">备注</param>
        /// <param name="engineType">发动机型号</param>
        static public void PartMaterial_Insert
            (string opName, int engineTypeID,
            int MaterialMark, string PartDrawNumber, string PartName, int PartCount,
            string MaterialNumber, string PartFactor, string PartMemo, string engineType)
        {
            string procedureName;
            procedureName = "电子看板_装配零件_增加";
            SqlParameter[] thisParms = new SqlParameter[10];
            thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
            thisParms[1] = new System.Data.SqlClient.SqlParameter("@产品型号代码", engineTypeID);
            thisParms[2] = new System.Data.SqlClient.SqlParameter("@标号", MaterialMark);
            thisParms[3] = new System.Data.SqlClient.SqlParameter("@零件图号", PartDrawNumber);
            thisParms[4] = new System.Data.SqlClient.SqlParameter("@零件名称", PartName);
            thisParms[5] = new System.Data.SqlClient.SqlParameter("@零件数量", PartCount);
            thisParms[6] = new System.Data.SqlClient.SqlParameter("@零件批号", MaterialNumber);
            thisParms[7] = new System.Data.SqlClient.SqlParameter("@生产厂家", PartFactor);
            thisParms[8] = new System.Data.SqlClient.SqlParameter("@备注", PartMemo);
            thisParms[9] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
            DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
        }
        /// <summary>
        /// 电子看板_装配零件_修改
        /// </summary>
        /// <param name="ID">唯一标志</param>
        /// <param name="MaterialMark">标号</param>
        /// <param name="PartDrawNumber">零件图号</param>
        /// <param name="PartName">零件名称</param>
        /// <param name="PartCount">零件数量</param>
        /// <param name="MaterialNumber">零件批号</param>
        /// <param name="PartFactor">生产厂家</param>
        /// <param name="PartMemo">备注</param>
        static public void PartMaterial_Update
            (int ID,int MaterialMark, string PartDrawNumber, string PartName, int PartCount,
            string MaterialNumber, string PartFactor, string PartMemo)
        {
            string procedureName;
            procedureName = "电子看板_装配零件_修改";
            SqlParameter[] thisParms = new SqlParameter[8];
            thisParms[0] = new System.Data.SqlClient.SqlParameter("@ID", ID);
            thisParms[1] = new System.Data.SqlClient.SqlParameter("@标号", MaterialMark);
            thisParms[2] = new System.Data.SqlClient.SqlParameter("@零件图号", PartDrawNumber);
            thisParms[3] = new System.Data.SqlClient.SqlParameter("@零件名称", PartName);
            thisParms[4] = new System.Data.SqlClient.SqlParameter("@零件数量", PartCount);
            thisParms[5] = new System.Data.SqlClient.SqlParameter("@零件批号", MaterialNumber);
            thisParms[6] = new System.Data.SqlClient.SqlParameter("@生产厂家", PartFactor);
            thisParms[7] = new System.Data.SqlClient.SqlParameter("@备注", PartMemo);
            DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
        }
        /// <summary>
        /// 电子看板_装配零件_删除
        /// </summary>
        /// <param name="ID"></param>
        static public void PartMaterial_Delete(int ID)
        {
            string procedureName;
            procedureName = "电子看板_装配零件_删除";
            SqlParameter[] thisParms = new SqlParameter[1];
            thisParms[0] = new System.Data.SqlClient.SqlParameter("@ID", ID);
            DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
        }
    }
}
