一厂MES,含注塑,喷涂,冲孔
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.

105 lines
3.3 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 System.Threading.Tasks;
using MESClassLibrary.BLL.Log;
namespace MESClassLibrary.DAL.Mistake247
{
public class MistakeDAL
{
public DataTable IsMath(string DeviceNo, string PartNo)
{
try
{
string sql = @"SELECT * from tb_Mistake_247 where DeviceNo=@DeviceNo and PartNo1=@PartNo";
SqlParameter[] param = new SqlParameter[2];
param[0] = new SqlParameter("@DeviceNo", SqlDbType.VarChar);
param[0].Value = DeviceNo;
param[1] = new SqlParameter("@PartNo", SqlDbType.VarChar);
param[1].Value = PartNo;
return SqlHelper.ExecuteDataset(SqlHelper.GetConnSting(), CommandType.Text, sql, param).Tables[0];
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
return null;
}
}
public DataTable SearchByNo(string PartNo, string deviceNo)
{
try
{
string sql = @"SELECT * from tb_Mistake_247 where PartNo1=@PartNo and DeviceNo=@deviceNo";
SqlParameter[] param = new SqlParameter[2];
param[0] = new SqlParameter("@PartNo", SqlDbType.VarChar);
param[0].Value = PartNo;
param[1] = new SqlParameter("@deviceNo", SqlDbType.VarChar);
param[1].Value = deviceNo;
return SqlHelper.ExecuteDataset(SqlHelper.GetConnSting(), CommandType.Text, sql, param).Tables[0];
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
return null;
}
}
public DataTable SearchPartName(string PartNo)
{
try
{
string sql = @"SELECT * from tb_Mistake_247 where [PartNo2]=@PartNo ";
SqlParameter[] param = new SqlParameter[1];
param[0] = new SqlParameter("@PartNo", SqlDbType.VarChar);
param[0].Value = PartNo;
return SqlHelper.ExecuteDataset(SqlHelper.GetConnSting(), CommandType.Text, sql, param).Tables[0];
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
return null;
}
}
public DataTable SearchPartNoByDecice(string deviceNo)
{
try
{
string sql = @"SELECT * from tb_Mistake_247 where DeviceNo=@DeviceNo ";
SqlParameter[] param = new SqlParameter[1];
param[0] = new SqlParameter("@DeviceNo", SqlDbType.VarChar);
param[0].Value = deviceNo;
return SqlHelper.ExecuteDataset(SqlHelper.GetConnSting(), CommandType.Text, sql, param).Tables[0];
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
return null;
}
}
}
}