You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
86 lines
3.7 KiB
86 lines
3.7 KiB
3 months ago
|
using System;
|
||
|
using System.Collections.Generic;
|
||
|
using System.Data;
|
||
|
using System.Data.SqlClient;
|
||
|
using System.Linq;
|
||
|
using System.Reflection;
|
||
|
using System.Text;
|
||
|
using MESClassLibrary.BLL.Log;
|
||
|
|
||
|
namespace MESClassLibrary.DAL.ZPPlan
|
||
|
{
|
||
|
public class ZPBomDAL
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// 工位总成和半成品是否匹配
|
||
|
/// </summary>
|
||
|
/// <param name="stationNo"></param>
|
||
|
/// <param name="PartNo1"></param>
|
||
|
/// <param name="partNo2"></param>
|
||
|
/// <returns></returns>
|
||
|
public DataTable IsMath(string stationNo, string partNo1, string partNo2)
|
||
|
{
|
||
|
try
|
||
|
{
|
||
|
string sql = @"SELECT dbo.tb_Station.StationNo, dbo.tb_Product.PartNo AS PartNo1, tb_Product_1.PartNo AS PartNo2,
|
||
|
dbo.tb_ZPBom.IsHigh
|
||
|
FROM dbo.tb_Station RIGHT OUTER JOIN
|
||
|
dbo.tb_Product RIGHT OUTER JOIN
|
||
|
dbo.tb_Product AS tb_Product_1 RIGHT OUTER JOIN
|
||
|
dbo.tb_ZPBom ON tb_Product_1.ProductID = dbo.tb_ZPBom.ProductID2 ON
|
||
|
dbo.tb_Product.ProductID = dbo.tb_ZPBom.ProductID1 ON dbo.tb_Station.StationID = dbo.tb_ZPBom.StationID
|
||
|
where dbo.tb_Station.StationNo=@stationNo and dbo.tb_Product.PartNo=@partNo1 and tb_Product_1.PartNo=@partNo2";
|
||
|
SqlParameter[] param = new SqlParameter[3];
|
||
|
|
||
|
param[0] = new SqlParameter("@stationNo", SqlDbType.VarChar);
|
||
|
param[0].Value = stationNo;
|
||
|
|
||
|
param[1] = new SqlParameter("@partNo1", SqlDbType.VarChar);
|
||
|
param[1].Value = partNo1;
|
||
|
|
||
|
param[2] = new SqlParameter("@partNo2", SqlDbType.VarChar);
|
||
|
param[2].Value = partNo2;
|
||
|
|
||
|
return SqlHelper.ExecuteDataset(SqlHelper.GetConnSting(), CommandType.Text, sql, param).Tables[0];
|
||
|
}
|
||
|
catch (Exception ex)
|
||
|
{
|
||
|
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
|
||
|
return null;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public DataTable SearchPartAndMould(string stationNo, string partNo1, string mould)
|
||
|
{
|
||
|
try
|
||
|
{
|
||
|
string sql = @"SELECT dbo.tb_Station.StationNo, dbo.tb_Product.PartNo AS PartNo1, tb_Product_1.PartNo AS PartNo2,
|
||
|
dbo.tb_ZPBom.IsHigh, dbo.tb_ZPBom.MouldNo
|
||
|
FROM dbo.tb_Station RIGHT OUTER JOIN
|
||
|
dbo.tb_Product RIGHT OUTER JOIN
|
||
|
dbo.tb_Product AS tb_Product_1 RIGHT OUTER JOIN
|
||
|
dbo.tb_ZPBom ON tb_Product_1.ProductID = dbo.tb_ZPBom.ProductID2 ON
|
||
|
dbo.tb_Product.ProductID = dbo.tb_ZPBom.ProductID1 ON dbo.tb_Station.StationID = dbo.tb_ZPBom.StationID
|
||
|
where dbo.tb_Station.StationNo=@stationNo and dbo.tb_Product.PartNo=@partNo1 and dbo.tb_ZPBom.MouldNo=@mould";
|
||
|
SqlParameter[] param = new SqlParameter[3];
|
||
|
|
||
|
param[0] = new SqlParameter("@stationNo", SqlDbType.VarChar);
|
||
|
param[0].Value = stationNo;
|
||
|
|
||
|
param[1] = new SqlParameter("@partNo1", SqlDbType.VarChar);
|
||
|
param[1].Value = partNo1;
|
||
|
|
||
|
param[2] = new SqlParameter("@mould", SqlDbType.VarChar);
|
||
|
param[2].Value = mould;
|
||
|
|
||
|
return SqlHelper.ExecuteDataset(SqlHelper.GetConnSting(), CommandType.Text, sql, param).Tables[0];
|
||
|
}
|
||
|
catch (Exception ex)
|
||
|
{
|
||
|
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
|
||
|
return null;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|