コード例 #1
0
        private async void HandleBuy()
        {
            List <Ticket> tickets = new List <Ticket>();

            bought  = true;
            loading = true;

            foreach (var seat in choosenSeats)
            {
                tickets.Add(new Ticket
                {
                    Id        = MiniGuids.MiniGuid.NewGuid(),
                    ForDateId = PlayDateTime.Id,
                    Seat      = seat.Seat
                });

                PlayDateTime.SeatsTaken.Add(seat.Seat);
            }

            Console.WriteLine($"Update PlayDatetime: {PlayDateTime.Id}");
            await PlayDateTimeRepo.Update(PlayDateTime);

            Console.WriteLine($"Add tickets:");
            await TicketRepo.Add(tickets);

            tickets.ForEach(x => Console.WriteLine($"---- Id: {x.Id}"));

            await Task.Delay(2000);

            loading = false;
            StateHasChanged();
            _ = OnClosed.InvokeAsync(this);
        }
コード例 #2
0
        public ActionResult EnterNew(AddTicketViewModel model)
        {
            Ticket ticket = new Ticket
            {
                Name    = model.Name,
                Numbers = new int[6] {
                    model.Numbers1, model.Numbers2, model.Numbers3,
                    model.Numbers4, model.Numbers5, model.Numbers6
                }
            };

            TicketRepo.Add(ticket);
            return(View("DisplayTicket", TicketRepo.GetAll().LastOrDefault()));
            //if !IsValid: return View(model);
        }
コード例 #3
0
ファイル: TicketLogic.cs プロジェクト: emc255/BugTracker
        //CREATE TICKET
        public void createTicket(CreateTicketViewModel model, string userId)
        {
            TicketType     ticketType     = new TicketType(model.TicketTypeName);
            TicketPriority ticketPriority = new TicketPriority(model.Priority);

            TicketTypeRepo.Add(ticketType);
            TicketPriorityRepo.Add(ticketPriority);
            Ticket ticket = new Ticket(model.Title, model.Description, DateTime.Now, model.ProjectId, ticketType.Id,
                                       ticketPriority.Id, userId);

            TicketRepo.Add(ticket);
            var copyTicket = TicketRepo.GetEntity(x => x.Id == ticket.Id);

            TicketHistory history = new TicketHistory(copyTicket.Id, "property", model.Description, model.Description, true, userId);

            TicketHistoryRepo.Add(history);
        }
コード例 #4
0
 public void AddTicket(Ticket ticket) => TicketRepo.Add(ticket);
コード例 #5
0
 public void AddTicket(Ticket ticket)
 {
     if (ticket != null)
         _repo.Add(ticket);
 }