Пример #1
0
 ///<Summary>
 ///DepartmentCollectionFromSearchFieldsCount
 ///This method returns the collection count of BODepartment objects, filtered by a search object
 ///</Summary>
 ///<returns>
 ///Int32
 ///</returns>
 ///<parameters>
 ///
 ///</parameters>
 public static Int32 DepartmentCollectionFromSearchFieldsCount(BODepartment boDepartment)
 {
     try
     {
         DAODepartment daoDepartment = new DAODepartment();
         daoDepartment.Id   = boDepartment.Id;
         daoDepartment.Name = boDepartment.Name;
         Int32 objCount = DAODepartment.SelectAllBySearchFieldsCount(daoDepartment);
         return(objCount);
     }
     catch
     {
         throw;
     }
 }
Пример #2
0
        ///<Summary>
        ///DepartmentCollectionFromSearchFields
        ///This method returns the collection of BODepartment objects, filtered by a search object
        ///</Summary>
        ///<returns>
        ///List<BODepartment>
        ///</returns>
        ///<parameters>
        ///
        ///</parameters>
        public static IList <BODepartment> DepartmentCollectionFromSearchFields(BODepartment boDepartment)
        {
            try
            {
                IList <BODepartment> boDepartmentCollection = new List <BODepartment>();
                DAODepartment        daoDepartment          = new DAODepartment();
                daoDepartment.Id   = boDepartment.Id;
                daoDepartment.Name = boDepartment.Name;
                IList <DAODepartment> daoDepartmentCollection = DAODepartment.SelectAllBySearchFields(daoDepartment);

                foreach (DAODepartment resdaoDepartment in daoDepartmentCollection)
                {
                    boDepartmentCollection.Add(new BODepartment(resdaoDepartment));
                }

                return(boDepartmentCollection);
            }
            catch
            {
                throw;
            }
        }