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; namespace MESClassLibrary.DAL.PunchAndWeld { public class PunchDeviceDAL { public DataTable SearchInfo() { try { string sql = @"select * from tb_PunchDevice "; return SqlHelper.ExecuteDataset(SqlHelper.GetConnSting(), CommandType.Text, sql, null).Tables[0]; } catch (Exception ex) { LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); return null; } } public DataTable SearchDeviceNo(string deviceName) { try { string sql = @"select * from tb_PunchDevice where DeviceName=@DeviceName"; SqlParameter[] param = null; param = new SqlParameter[1]; param[0] = new SqlParameter("@DeviceName", SqlDbType.VarChar); param[0].Value = deviceName; return SqlHelper.ExecuteDataset(SqlHelper.GetConnSting(), CommandType.Text, sql, param).Tables[0]; } catch (Exception ex) { LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); return null; } } } }