using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data; using System.Data.SqlClient; using System.Reflection; using MESClassLibrary.BLL.Log; namespace MESClassLibrary.DAL.BasicInfo { public class ModelProductDAL { public DataTable SearchInfo(string ModelNo, string partNo) { try { string sql = @"SELECT dbo.tb_Model_Product.ModelID, dbo.tb_ModelInfo.ModelNo, dbo.tb_Product.PartNo, dbo.tb_Model_Product.ProuctID FROM dbo.tb_Model_Product LEFT OUTER JOIN dbo.tb_ModelInfo ON dbo.tb_Model_Product.ModelID = dbo.tb_ModelInfo.ID LEFT OUTER JOIN dbo.tb_Product ON dbo.tb_Model_Product.ProuctID = dbo.tb_Product.ProductID WHERE ModelNo=@ModelNo AND PartNo=@partNo"; SqlParameter[] param = new SqlParameter[2]; param[0] = new SqlParameter("@ModelNo", SqlDbType.VarChar); param[0].Value = ModelNo; param[1] = new SqlParameter("@partNo", SqlDbType.VarChar); param[1].Value = partNo; return SqlHelper.ExecuteDataset(SqlHelper.GetConnSting(), CommandType.Text, sql, param).Tables[0]; } catch (Exception ex) { LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); return null; } } } }