68 lines
3.0 KiB
C#
68 lines
3.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data.SqlClient;
|
|
using System.Data;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using DataLinkMesWork;
|
|
|
|
namespace MesServerFunctions
|
|
{
|
|
public class Db
|
|
{
|
|
/// <summary>
|
|
/// 合力_OPA90是否允许工作_判断 如果允许工作则将两个轮毂状态设为待匹配
|
|
/// </summary>
|
|
/// <param name="EngineTypeID"></param>
|
|
/// <param name="EngineTypeID_QiaoKe"></param>
|
|
/// <param name="EngineID"></param>
|
|
/// <param name="OrderForm"></param>
|
|
/// <param name="MatchResult"></param>
|
|
/// <param name="MatchResultStr"></param>
|
|
/// <returns></returns>
|
|
public static bool OP50_OPA90_MatchResult(int EngineTypeID, int EngineTypeID_QiaoKe, string EngineID, string OrderForm, out int MatchResult, out string MatchResultStr)
|
|
{
|
|
DataTable dt = new DataTable();
|
|
MatchResult = 3;// 默认是报警 程序出错
|
|
MatchResultStr = "默认是报警 程序出错";// 默认是报警 程序出错
|
|
string produceName = "合力_OPA90是否允许工作_判断";
|
|
SqlParameter[] thisParms = new SqlParameter[4];
|
|
thisParms[0] = new System.Data.SqlClient.SqlParameter("@轮毂机型", EngineTypeID);
|
|
thisParms[1] = new System.Data.SqlClient.SqlParameter("@轮毂总成号", EngineID);
|
|
thisParms[2] = new System.Data.SqlClient.SqlParameter("@桥壳_机型", EngineTypeID_QiaoKe);
|
|
thisParms[3] = new System.Data.SqlClient.SqlParameter("@订单号", OrderForm);
|
|
if (DataAccess.ExecuteStoredProcedure(produceName, ref thisParms, out dt))
|
|
{
|
|
if (dt.Rows.Count > 0)
|
|
{
|
|
MatchResult = Convert.ToInt32(dt.Rows[0]["最终结果"]);
|
|
MatchResultStr = dt.Rows[0]["最终结果说明"].ToString();
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public static bool OP051_OP050_NeedWork(string EngineID, string opName, string orderForm, out int MatchResult)
|
|
{
|
|
DataTable dt = new DataTable();
|
|
MatchResult = 0;
|
|
string produceName = "合力_OP050前停判断_下工位是否需要工作";
|
|
SqlParameter[] thisParms = new SqlParameter[3];
|
|
thisParms[0] = new System.Data.SqlClient.SqlParameter("@桥壳总成号", EngineID);
|
|
thisParms[1] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
|
thisParms[2] = new System.Data.SqlClient.SqlParameter("@订单号", orderForm);
|
|
if (DataAccess.ExecuteStoredProcedure(produceName, ref thisParms, out dt))
|
|
{
|
|
if (dt.Rows.Count > 0)
|
|
{
|
|
MatchResult = Convert.ToInt32(dt.Rows[0]["是否需要工作"]);
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
}
|