public static List <InsightSupplierLink> GetInsightSupplierLinkByInsightSupplierId(int insightSupplierId) { List <InsightSupplierLink> list = new List <InsightSupplierLink>(); Database db = DatabaseFactory.CreateDatabase("SPARInsightManagement"); string sqlCommand = "GetInsightSupplierLinkByInsightSupplierId"; DbCommand dbCommand = db.GetStoredProcCommand(sqlCommand); db.AddInParameter(dbCommand, "@InsightSupplierId", DbType.Int32, insightSupplierId); using (IDataReader dataReader = db.ExecuteReader(dbCommand)) { while (dataReader.Read()) { InsightSupplierLink insightSupplierLink = new InsightSupplierLink(); insightSupplierLink.InsightSupplierId = insightSupplierId; insightSupplierLink.InsightSupplierLinkId = Convert.ToInt32(dataReader["InsightSupplierLinkId"]); insightSupplierLink.LinkId = Convert.ToInt32(dataReader["LinkId"]); list.Add(insightSupplierLink); } } return(list); }