using MESClassLibrary.BLL.Log; using System; using System.Collections.Generic; using System.Data; using System.Data.SqlClient; using System.Linq; using System.Reflection; using System.Text; namespace MESClassLibrary.DAL.painting { public class TmpBarCodeDal { public bool ClearBarCode() { bool res=false; try { string sql = @"truncate table tmp_barCode"; SqlHelper.ExecuteNonQuery(SqlHelper.GetConnSting(), CommandType.Text, sql, null); return true; } catch (Exception ex) { LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); } return res; } public bool AddInfo(string barCode) { bool res = false; try { string sql = @"insert into tmp_barCode(barCode) VALUES('" + barCode +@"')"; SqlHelper.ExecuteNonQuery(SqlHelper.GetConnSting(), CommandType.Text, sql, null); return true; } catch (Exception ex) { LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); } return res; } public int InsertBulkCopy(string connectionString, DataTable dt) { int res = 0; try { SqlHelper.InsertBatch(connectionString, dt); } catch (Exception ex) { LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); res= -1; } return res; } } }