using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Reflection; using System.Text; using MESClassLibrary.BLL.Log; namespace MESClassLibrary.DAL.ZPPlan { public class ScanRecordDAL { public int IsScan(string barcode, string stationID) { try { int res = 0; string sql = @"select * from tb_ScanRecord where BarCode='" + barcode + @"'"; if (!string.IsNullOrEmpty(stationID)) { sql += @" and StationID ='"+ stationID+ @"'"; } DataTable dt = SqlHelper.ExecuteDataset(SqlHelper.GetConnSting(), CommandType.Text, sql, null).Tables[0]; if (dt != null && dt.Rows.Count > 0) { res = dt.Rows.Count; } return res; } catch (Exception ex) { LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); return 0; } } } }