示例#1
0
        public IBOProductsByCategory BOProductsByCategory(IProductsByCategoryRepository repo)
        {
            BOProductsByCategory boProductsByCategory = (BOProductsByCategory)BOProductsByCategory();

            boProductsByCategory.Repository = repo;
            return(boProductsByCategory);
        }
 ///<Summary>
 ///ProductsByCategoryCollectionCount
 ///This method returns the collection count of BOProductsByCategory objects
 ///</Summary>
 ///<returns>
 ///Int32
 ///</returns>
 ///<parameters>
 ///
 ///</parameters>
 public static Int32 ProductsByCategoryCollectionCount(IProductsByCategoryRepository iProductsByCategoryRepository)
 {
     Doing(null);
     try
     {
         Int32 objCount = iProductsByCategoryRepository.SelectAllCount();
         return(objCount);
     }
     catch (Exception ex)
     {
         Failed(null, ex);
         Handle(null, ex);
         return(-1);
     }
 }
        ///<Summary>
        ///ProductsByCategoryCollection
        ///This method returns the collection of BOProductsByCategory objects
        ///</Summary>
        ///<returns>
        ///IList[IBOProductsByCategory]
        ///</returns>
        ///<parameters>
        ///
        ///</parameters>
        public static IList <IBOProductsByCategory> ProductsByCategoryCollection(IProductsByCategoryRepository iProductsByCategoryRepository)
        {
            Doing(null);
            try
            {
                IList <IBOProductsByCategory>  boProductsByCategoryCollection  = new List <IBOProductsByCategory>();
                IList <IDAOProductsByCategory> daoProductsByCategoryCollection = iProductsByCategoryRepository.SelectAll();
                Done(null);

                foreach (IDAOProductsByCategory daoProductsByCategory in daoProductsByCategoryCollection)
                {
                    boProductsByCategoryCollection.Add(new BOProductsByCategory(daoProductsByCategory));
                }

                return(boProductsByCategoryCollection);
            }
            catch (Exception ex)
            {
                Failed(null, ex);
                Handle(null, ex);
                return(null);
            }
        }