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 EventTicketCreationTicketQueryResult Handle(EventTicketCreationQuery query) { List <FIL.Contracts.Models.TicketCategory> ticketCategories = new List <FIL.Contracts.Models.TicketCategory>(); try { var ticketCategory = _ticketCategoryRepository.GetAll(null); foreach (var item in ticketCategory) { ticketCategories.Add(new FIL.Contracts.Models.TicketCategory { Id = item.Id, Name = item.Name }); } return(new EventTicketCreationTicketQueryResult { TicektCategories = ticketCategories }); } catch (Exception ex) { _logger.Log(Logging.Enums.LogCategory.Error, ex); return(new EventTicketCreationTicketQueryResult { TicektCategories = null }); } }
public JsonResult Index() { var apiResult = TryExecute(() => { return(_ticketCategoryRepository.GetAll(o => o.OrderByDescending(t => t.CreatedOn))); }, "Ticket Categories Fetched sucessfully"); return(Json(apiResult, JsonRequestBehavior.AllowGet)); }
public ActionResult Index() { var categories = _ticketCategoryRepository.GetAll(); return(View(categories)); }