示例#1
0
        public async Task <IActionResult> Delete(int?ID)
        {
            if (ID == null)
            {
                return(RedirectToAction("Events", "Owner"));
            }

            Ticket ticket = await _db.Tickets.FirstOrDefaultAsync(x => x.ID == ID);

            JackLib.IfNull(ticket);

            return(View(ticket));
        }
示例#2
0
        public async Task <IActionResult> Copy(int?ID)
        {
            if (ID == null)
            {
                return(RedirectToAction("Events", "Owner"));
            }

            Ticket ticket = await _db.Tickets.SingleOrDefaultAsync(x => x.ID == ID);

            JackLib.IfNull(ticket);

            // get current event's name
            ViewBag.Event = (await _db.Events.SingleOrDefaultAsync(x => x.ID == ticket.EID)).Name;

            return(View(ticket));
        }