예제 #1
0
 public List<CategoryEntity> SearchCategories(CategorySearchEntity searchObject)
 {
     //execute
     using (var db = VinaGerman.Database.VinagermanDatabase.GetDatabaseInstance())
     {
         try
         {
             db.OpenConnection();
             return db.Resolve<ICategoryDB>().SearchCategories(searchObject);
         }
         finally
         {
             db.CloseConnection();
         }
     }
 }
예제 #2
0
 public List<CategoryEntity> SearchCategories(CategorySearchEntity searchObject)
 {
     List<CategoryEntity> result = null;
     string sqlStatement = "SELECT " + Environment.NewLine +
         "Category.CategoryId," + Environment.NewLine +
         "Category.Description," + Environment.NewLine +
         "Category.Deleted" + Environment.NewLine +
         "FROM Category " + Environment.NewLine +
         "WHERE Deleted=0 " + Environment.NewLine;
     if (searchObject.SearchText != null && searchObject.SearchText.Length > 0)
     {
         sqlStatement += "AND (Description LIKE N'%" + searchObject.SearchText + "%')" + Environment.NewLine;
     }
     //execute
     result = Connection.Query<CategoryEntity>(sqlStatement, null, Transaction).ToList();
     return result;
 }
예제 #3
0
 public List<CategoryEntity> SearchCategories(CategorySearchEntity searchObject)
 {
     return Factory.Resolve<ICategoryBL>().SearchCategories(searchObject);
 }