コード例 #1
0
 public ActionResult Edit(int id, TicketType ticketType)
 {
     if (ModelState.IsValid)
     {
         _ticketMetaManager.UpdateTicketType(id, ticketType);
         return RedirectToAction("Index");
     }
     return View(ticketType);
 }
コード例 #2
0
        public ActionResult Create(TicketType ticketType)
        {
            if (ModelState.IsValid)
            {
                _ticketMetaManager.CreateTicketType(ticketType);
                return RedirectToAction("Index");
            }

            return View(ticketType);
        }
コード例 #3
0
 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);
 }
コード例 #4
0
        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()
        }
コード例 #5
0
 public void UpdateTicketType(int id, TicketType ticketType)
 {
     _ctx.Entry(_ctx.TicketTypes.Find(id)).CurrentValues.SetValues(ticketType);
     _ctx.SaveChanges();
 }
コード例 #6
0
 public void CreateTicketType(TicketType ticketType)
 {
     _ctx.TicketTypes.Add(ticketType);
     _ctx.SaveChanges();
 }
コード例 #7
0
 public void CreateTicketType(TicketType ticketType)
 {
     _TicketMetaRepository.CreateTicketType(ticketType);
 }