Example #1
0
        public IQueryable <CategoryVO> GetAll()
        {
            IQueryable <CategoryVO> qCateogry;

            using (var categoryAccessor = new CategoryAccessor())
            {
                qCateogry = categoryAccessor.Repo.All;
            }
            return(qCateogry);
        }
Example #2
0
        public List <CategoryVO> FindAll()
        {
            List <CategoryVO> catList;

            using (var categoryAccessor = new CategoryAccessor())
            {
                catList = _categoryAccessor.Repo.All.ToList();
            }
            return(catList);
        }
Example #3
0
        /// <summary>
        /// Created by Mason Allen
        /// Created on 5/2/17
        /// Returns a list of all categories in the db
        /// </summary>
        /// <returns></returns>
        public List <Category> RetrieveCategoryList()
        {
            List <Category> categoryList;

            try
            {
                categoryList = CategoryAccessor.RetrieveCategoryList();
            }
            catch (Exception)
            {
                throw;
            }

            return(categoryList);
        }
Example #4
0
        /// <summary>
        /// Mason Allen
        /// Created:
        /// 2017/04/13
        /// </summary>
        /// <remarks>
        /// Ariel Sigo
        /// Updated:
        /// 2017/04/29
        ///
        /// Standardized Comment
        /// </remarks>
        /// <param name="categoryId"></param>
        /// <returns>1 for success, 0 for fail</returns>
        public int DeleteCategory(string categoryId)
        {
            int success = 0;

            try
            {
                success = CategoryAccessor.DeleteCategory(categoryId);
            }
            catch (Exception)
            {
                throw;
            }

            return(success);
        }
Example #5
0
        /// <summary>
        /// Ryan Spurgetis
        ///
        /// Created
        /// 2017/02/09
        ///
        /// Takes data for a new Category for Products from view, sends to the Accessor class.
        /// </summary>
        /// <remarks>
        /// Ariel Sigo
        /// Updated:
        /// 2017/04/29
        ///
        /// Standardized Comment
        /// </remarks>
        /// <param name="productCategory">Name of category</param>
        /// <param name="prodCategoryDesc">Description of category</param>
        /// <returns>True if succesfful</returns>
        public bool CreateCategory(Category category)
        {
            var result = false;

            try
            {
                result = (1 == CategoryAccessor.CreateCategory(category));
            }
            catch (Exception ex)
            {
                throw new ApplicationException("Problem with adding product category." + ex.Message + ex.StackTrace);
            }

            return(result);
        }
Example #6
0
 public CategoryBL()
 {
     _categoryAccessor = new CategoryAccessor();
 }