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.
67 lines
1.6 KiB
67 lines
1.6 KiB
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;
|
|
}
|
|
}
|
|
}
|
|
|