Beispiel #1
0
 public List<LocationEntity> SearchLocation(LocationSearchEntity searchObject)
 {
     //execute
     using (var db = VinaGerman.Database.VinagermanDatabase.GetDatabaseInstance())
     {
         try
         {
             db.OpenConnection();
             return db.Resolve<ILocationDB>().SearchLocation(searchObject);
         }
         finally
         {
             db.CloseConnection();
         }
     }
 }
Beispiel #2
0
 public List<LocationEntity> SearchLocation(LocationSearchEntity searchObject)
 {
     List<LocationEntity> result = null;
     string sqlStatement = "SELECT " + Environment.NewLine +
         "Location.LocationId," + Environment.NewLine +
         "Location.Address," + Environment.NewLine +
         "Location.Description," + Environment.NewLine +
         "Company.Description as CompanyName," + Environment.NewLine +
         "Location.CompanyId," + Environment.NewLine +
         "Location.Deleted" + Environment.NewLine +
         "FROM Location JOIN Company ON Location.CompanyId=Company.CompanyId " + Environment.NewLine +
         "WHERE Location.Deleted=0 " + Environment.NewLine;
     if (searchObject.SearchText != null && searchObject.SearchText.Length > 0)
     {
         sqlStatement += "AND (Description LIKE N'%" + searchObject.SearchText + "%' OR Address LIKE N'%" + searchObject.SearchText + "%')" + Environment.NewLine;
     }
     //execute
     result = Connection.Query<LocationEntity>(sqlStatement, null, Transaction).ToList();
     return result;
 }
Beispiel #3
0
 public List<VinaGerman.Entity.BusinessEntity.LocationEntity> SearchLocation(LocationSearchEntity searchObject)
 {
     return Factory.Resolve<ILocationBL>().SearchLocation(searchObject);
 }