public ActionResult Create(TicketModel model) { AutoMapperWebConfiguration.Configure(); if (ModelState.IsValid) { var ticket = AutoMapper.Mapper.Map<TicketModel, Ticket>(model); ticket.CreatedOnUtc = DateTime.UtcNow; ticket.Status = TicketStatus.Open; ticket.VendorId = _workContext.CurrentVendor!=null?_workContext.CurrentVendor.Id:-1; _ticketService.InsertTicket(ticket); return RedirectToAction("Index"); } return View("Create"); }
public ActionResult Create() { var model = new TicketModel(); return View(model); }