注塑喷涂
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.
 
 
 
 
 

68 lines
2.7 KiB

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.PunchAndWeld
{
public class PunchAndStationDAL
{
public DataTable IsMath(string partNo1, string partNo2)
{
try
{
string sql = @"SELECT tb_Product_1.PartNo AS PartNo1, tb_Product_1.ProductName AS ProductName1, dbo.tb_Product.PartNo AS PartNo2,
dbo.tb_Product.ProductName AS ProductName2
FROM dbo.tb_PunchAndStation LEFT OUTER JOIN
dbo.tb_Product ON dbo.tb_PunchAndStation.ProductID2 = dbo.tb_Product.ProductID LEFT OUTER JOIN
dbo.tb_Product AS tb_Product_1 ON dbo.tb_PunchAndStation.ProductID1 = tb_Product_1.ProductID
where tb_Product_1.PartNo=@partNo1 and dbo.tb_Product.PartNo =@partNo2";
SqlParameter[] param = null;
param = new SqlParameter[2];
param[0] = new SqlParameter("@partNo1", SqlDbType.VarChar);
param[0].Value = partNo1;
param[1] = new SqlParameter("@partNo2", SqlDbType.VarChar);
param[1].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 IsMath1(string partNo, string stationNo)
{
try
{
string sql = @"SELECT * FROM dbo.tb_PunchAndStation ps
LEFT OUTER JOIN dbo.tb_Product p ON ps.ProductID1=p.ProductID
LEFT OUTER JOIN dbo.tb_Station s ON ps.StationID=s.StationID
WHERE s.StationNo=@stationNo AND p.PartNo=@PartNo";
SqlParameter[] param = null;
param = new SqlParameter[2];
param[0] = new SqlParameter("@PartNo", SqlDbType.VarChar);
param[0].Value = partNo;
param[1] = new SqlParameter("@stationNo", SqlDbType.VarChar);
param[1].Value = stationNo;
return SqlHelper.ExecuteDataset(SqlHelper.GetConnSting(), CommandType.Text, sql, param).Tables[0];
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
return null;
}
}
}
}