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; } } } }