Пример #1
0
        public ActionResult Create()
        {
            // Special Case where the sub categories should be based on the category
            var categories    = _ticketCategoryRepository.GetAll().ToList();
            var firstCategory = categories.First();
            var subCategories = _ticketSubCategoryRepository.GetAllBy(s => s.TicketCategoryId == firstCategory.Id);

            ViewBag.TicketCategoryId    = new SelectList(categories, "Id", "Title");
            ViewBag.TicketSubCategoryId = new SelectList(subCategories, "Id", "Title");

            return(View());
        }
        public ActionResult GetSubCategoriesByCategoryId(int id)
        {
            var subCategories = _ticketSubCategoryRepository.GetAllBy(d => d.TicketCategoryId == id).ToList();

            return(Json(subCategories));
        }