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.Model; namespace MESClassLibrary.DAL.Hybrid { public class HybridScanRecordDAL { public DataTable searchInfo(string barCode) { try { string sql = @"SELECT * from tb_HybridScanRecord where BarCode ='"+ barCode +"'"; return SqlHelper.ExecuteDataset(SqlHelper.GetConnSting(), CommandType.Text, sql, null).Tables[0]; } catch (Exception ex) { LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); return null; } } public bool AddInfo(HybridScanRecordModel md) { try { string sql = @"insert into tb_HybridScanRecord(ID,BarCode) values(@ID,@BarCode)"; SqlParameter[] param=new SqlParameter[2]; param[0] = new SqlParameter("@ID", SqlDbType.VarChar); param[0].Value = md.ID; param[1] = new SqlParameter("@BarCode", SqlDbType.VarChar); param[1].Value = md.BarCode; SqlHelper.ExecuteNonQuery(SqlHelper.GetConnSting(), CommandType.Text, sql, param); return true; } catch (Exception ex) { LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); return false; } } } }