using System; using System.Data; using System.Data.SqlClient; using DataLinkMesWork; using System.Collections; using System.Collections.Specialized; //using SystemFramework; namespace bizFacade { /// /// 电子看板信息系统 /// public partial class BaseDataSystemMES { /// /// MES_装配数据_零部件追溯_数据主表_增加_电子看板 /// @发动机号 nvarchar(50)=null, /// @发动机型号 nvarchar(50)=null, /// @机型代码 int=null, /// @订单号 nvarchar(50)=null, /// @工位号 nvarchar(50)=null, /// @到达时间 datetime, /// @离开时间 datetime, /// @操作者工号 nvarchar(50)=null, /// @班次代码 nvarchar(50)=null, /// @放行方式 int =null, /// @工位类型 nvarchar(50)=null, /// @追溯代码 int = null output /// /// 发动机号 /// 发动机型号 /// 机型代码 /// 订单号 /// 工位号 /// 到达时间 /// 离开时间 /// 操作者工号 /// 班次代码 /// 放行方式 /// 工位类型 /// 追溯代码 static public void MaterialMailTable_Insert(string engineID,string engineType,int engineTypeID,string orderForm,string opName, DateTime arrivedTime,DateTime leavTime,string opperatorCode,string shiftCode, int goOverType,string opNameType,out int traceCode) { string procedureName; try { procedureName = "MES_装配数据_零部件追溯_数据主表_增加_电子看板"; SqlParameter[] thisParms = new SqlParameter[12]; thisParms[0] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID); thisParms[1] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType); thisParms[2] = new System.Data.SqlClient.SqlParameter("@机型代码", engineTypeID); thisParms[3] = new System.Data.SqlClient.SqlParameter("@订单号", orderForm); thisParms[4] = new System.Data.SqlClient.SqlParameter("@工位号", opName); thisParms[5] = new System.Data.SqlClient.SqlParameter("@到达时间", arrivedTime); thisParms[6] = new System.Data.SqlClient.SqlParameter("@离开时间", leavTime); thisParms[7] = new System.Data.SqlClient.SqlParameter("@操作者工号", opperatorCode); thisParms[8] = new System.Data.SqlClient.SqlParameter("@班次代码", shiftCode); thisParms[9] = new System.Data.SqlClient.SqlParameter("@放行方式", goOverType); thisParms[10] = new System.Data.SqlClient.SqlParameter("@工位类型", opNameType); thisParms[11] = new System.Data.SqlClient.SqlParameter("@追溯代码", 0); thisParms[11].Direction = ParameterDirection.Output; DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms); traceCode = Convert.ToInt32(thisParms[11].Value); } catch (Exception err) { traceCode = 0; ////ApplicationLog.WriteLog(err, err.Message); } } /// /// MES_装配数据_零部件追溯_增加_电子看板 ///ALTER PROCEDURE MES_装配数据_零部件追溯_增加_电子看板 ///@追溯代码 int = null, ///@发动机号 nvarchar(50)=null, ///@工位号 nvarchar(50)=null, ///@零件图号 nvarchar(50)=null, ///@零件名称 nvarchar(50)=null, ///@零件数量 int=null, ///@生产厂家 nvarchar(50)=null, ///@物料条码批次 nvarchar(50)=null, ///@操作者工号 nvarchar(50)=null, ///@班次代码 nvarchar(50)=null /// /// /// /// /// /// /// static public void MaterialSubTable_Insert(int traceCode,string engineID, string opName,string opperatorCode,string shiftCode, DataTable dt) { string procedureName; procedureName = "MES_装配数据_零部件追溯_增加_电子看板"; SqlParameter[] thisParms = new SqlParameter[10]; thisParms[0] = new System.Data.SqlClient.SqlParameter("@追溯代码", traceCode); thisParms[1] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID); thisParms[2] = new System.Data.SqlClient.SqlParameter("@工位号", opName); thisParms[3] = new System.Data.SqlClient.SqlParameter("@操作者工号", opperatorCode); thisParms[4] = new System.Data.SqlClient.SqlParameter("@班次代码", shiftCode); thisParms[5] = new System.Data.SqlClient.SqlParameter("@零件图号", SqlDbType.NVarChar, 50, "零件图号"); thisParms[6] = new System.Data.SqlClient.SqlParameter("@零件名称", SqlDbType.NVarChar, 50, "零件名称"); thisParms[7] = new System.Data.SqlClient.SqlParameter("@零件数量", SqlDbType.Int, 4, "零件数量"); thisParms[8] = new System.Data.SqlClient.SqlParameter("@生产厂家", SqlDbType.NVarChar, 50, "生产厂家"); thisParms[9] = new System.Data.SqlClient.SqlParameter("@物料条码批次", SqlDbType.NVarChar, 50, "零件批号"); DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms,dt); } /// /// 保存物料信息 /// /// 发动机号 /// 发动机型号 /// 机型代码 /// 订单号 /// 工位号 /// 到达时间 /// 离开时间 /// 操作者工号 /// 班次代码 /// 放行方式 /// 工位类型 /// 装配物料列表 static public void Material_Insert_B5A(string engineID, string engineType, int engineTypeID, string orderForm, string opName, DateTime arrivedTime, DateTime leavTime, string opperatorCode, string shiftCode, int goOverType, string opNameType, DataTable dt) { int traceCode; //MES_装配数据_零部件追溯_数据主表_增加_电子看板 MaterialMailTable_Insert( engineID, engineType, engineTypeID,orderForm,opName,arrivedTime, leavTime, opperatorCode, shiftCode,goOverType, opNameType,out traceCode); //MES_装配数据_零部件追溯_增加_电子看板 MaterialSubTable_Insert(traceCode, engineID, opName, opperatorCode, shiftCode, dt); } /// /// 电子看板_工位名称与产品型号工艺卡_查询 /// /// /// /// static public void GetPdfSrc(string opName, string engineTypeID, out string PdfSrc) { string sql; DataTable dt; PdfSrc = null; sql = "exec 电子看板_工位名称与产品型号工艺卡_查询 '" + opName + "'," + engineTypeID; DataAccess.ExecuteDataTable(sql, out dt); if (dt != null) { if (dt.Rows.Count > 0) { PdfSrc = dt.Rows[0]["工艺卡路径"].ToString(); } } } } }