一厂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.

48 lines
1.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 MESClassLibrary.BLL.Log;
using MESClassLibrary.EFModel;
namespace MESClassLibrary.DAL.BasicInfo
{
public class BarcodeBMWDAL
{
public bool AddInfo(tb_BarCode_BMW md)
{
try
{
string sql = @"insert into tb_BarCode_BMW (BarCode) values('"+ md.BarCode+@"')";
SqlHelper.ExecuteNonQuery(SqlHelper.GetConnSting(), CommandType.Text, sql, null);
return true;
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(),MethodBase.GetCurrentMethod());
return false;
}
}
public DataTable SearchSeq(string barcode)
{
try
{
string sql = @"select top 1 BarCode from tb_BarCode_BMW where BarCode like '%" + barcode + @"%' order by ID desc";
return SqlHelper.ExecuteDataset(SqlHelper.GetConnSting(), CommandType.Text, sql, null).Tables[0];
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
return null;
}
}
}
}