public ActionResult Edit(int id, TicketType ticketType) { if (ModelState.IsValid) { _ticketMetaManager.UpdateTicketType(id, ticketType); return RedirectToAction("Index"); } return View(ticketType); }
public ActionResult Create(TicketType ticketType) { if (ModelState.IsValid) { _ticketMetaManager.CreateTicketType(ticketType); return RedirectToAction("Index"); } return View(ticketType); }
public void UpdateTicketType(int ticketTypeId, TicketType ticketType) { TicketType t = _TicketMetaRepository.FindTicketType(ticketTypeId); // t.EditionId = ticketType.EditionId; t.Day = ticketType.Day; t.Price = ticketType.Price; t.Sort = ticketType.Sort; t.Stock = ticketType.Stock; _TicketMetaRepository.UpdateTicketType(ticketTypeId, t); }
public void AdjustStock(TicketOrder t) { var type = new TicketType(); foreach(var lines in t.TicketLines) { type = lines.TicketType; type.Stock -= lines.NumberOfItems; _ITicketMetaRepository.UpdateTicketType(type.TicketTypeId, type); //_ITicketMetaRepository.FindTicketType(lines.TicketType.TicketTypeId); // lines.NumberOfItems; } // _ITicketMetaRepository.UpdateTicketType() }
public void UpdateTicketType(int id, TicketType ticketType) { _ctx.Entry(_ctx.TicketTypes.Find(id)).CurrentValues.SetValues(ticketType); _ctx.SaveChanges(); }
public void CreateTicketType(TicketType ticketType) { _ctx.TicketTypes.Add(ticketType); _ctx.SaveChanges(); }
public void CreateTicketType(TicketType ticketType) { _TicketMetaRepository.CreateTicketType(ticketType); }