Ejemplo n.º 1
0
 public List<DepartmentEntity> SearchDepartment(DepartmentSearchEntity searchObject)
 {
     //execute
     using (var db = VinaGerman.Database.VinagermanDatabase.GetDatabaseInstance())
     {
         try
         {
             db.OpenConnection();
             return db.Resolve<IDepartmentDB>().SearchDepartment(searchObject);
         }
         finally
         {
             db.CloseConnection();
         }
     }
 }
Ejemplo n.º 2
0
 public List<DepartmentEntity> SearchDepartment(DepartmentSearchEntity searchObject)
 {
     List<DepartmentEntity> result = null;
     string sqlStatement = "SELECT " + Environment.NewLine +
         "Department.DepartmentId," + Environment.NewLine +
         "Department.Phone," + Environment.NewLine +
         "Department.Description," + Environment.NewLine +
         "Company.Description as CompanyName," + Environment.NewLine +
         "Department.CompanyId," + Environment.NewLine +
         "Department.Deleted" + Environment.NewLine +
         "FROM Department JOIN Company ON Department.CompanyId=Company.CompanyId " + Environment.NewLine +
         "WHERE Department.Deleted=0 " + Environment.NewLine;
     if (searchObject.SearchText != null && searchObject.SearchText.Length > 0)
     {
         sqlStatement += "AND (Description LIKE N'%" + searchObject.SearchText + "%' OR Phone LIKE N'%" + searchObject.SearchText + "%')" + Environment.NewLine;
     }
     //execute
     result = Connection.Query<DepartmentEntity>(sqlStatement, null, Transaction).ToList();
     return result;
 }
Ejemplo n.º 3
0
 public List<VinaGerman.Entity.BusinessEntity.DepartmentEntity> SearchDepartment(DepartmentSearchEntity searchObject)
 {
     return Factory.Resolve<IDepartmentBL>().SearchDepartment(searchObject);
 }