public List<ArticleEntity> SearchArticle(ArticleSearchEntity searchObject) { List<ArticleEntity> result = null; string sqlStatement = "SELECT " + Environment.NewLine + "Article.ArticleId," + Environment.NewLine + "Article.CategoryId," + Environment.NewLine + "Article.ArticleNo," + Environment.NewLine + "Article.Description," + Environment.NewLine + "Article.Unit," + Environment.NewLine + "Article.Deleted" + Environment.NewLine + "FROM Article " + Environment.NewLine + "WHERE Deleted=0 " + Environment.NewLine; if (searchObject.SearchText != null && searchObject.SearchText.Length > 0) { sqlStatement += "AND (ArticleNo LIKE N'%" + searchObject.SearchText + "%')" + Environment.NewLine; } //execute result = Connection.Query<ArticleEntity>(sqlStatement, null, Transaction).ToList(); return result; }
public List<ArticleEntity> SearchArticle(ArticleSearchEntity searchObject) { return Factory.Resolve<IArticleBL>().SearchArticle(searchObject); }
public List<ArticleEntity> SearchArticle(ArticleSearchEntity searchObject) { //execute using (var db = VinaGerman.Database.VinagermanDatabase.GetDatabaseInstance()) { try { db.OpenConnection(); return db.Resolve<IArticleDB>().SearchArticle(searchObject); } finally { db.CloseConnection(); } } }