Ejemplo n.º 1
0
        // GET: Create
        public ActionResult Create()
        {
            var AllProducer = new SelectList(_ProRep.GetProducer().ToList(), "Producer_Id", "Producer_Name");

            ViewData["AllProducer"] = AllProducer;
            return(View());
        }
Ejemplo n.º 2
0
        //********************Implementation********************

        //Display
        public ActionResult Index()
        {
            ViewBag.FileStatus = "hello";
            var AllProducer = _ProducerRep.GetProducer();

            return(View(AllProducer));
        }
        public SubcategoryPageDTO Subcategory(int id, int?page, int?limit)
        {
            var result = new SubcategoryPageDTO
            {
                Subcategory = subcategoriesRepository.GetSubcategory(id),
                Products    = subcategoriesRepository.GetProductsForSubcategory(id, page ?? 1, limit ?? 20)
            };

            foreach (var product in result.Products)
            {
                product.Producer = producerRepository.GetProducer(product.ProducerID);
            }

            return(result);
        }