Example #1
0
        public async Task <IActionResult> ConfirmOrder([FromBody] TicketResource ticketResourse)
        {
            var ticket = await ticketsService.GetTicketById(ticketResourse.Id);

            var order = await ordersService.GetOrderByTicketIdAndStatuses(ticket.Id, OrderStatuses.WaitingForConfirmation);

            await ticketsService.ChangeTicketStatus(ticket, TicketStatuses.WaitingForReceivingConfirmation);

            await ordersService.ChangeOrderStatus(order, OrderStatuses.Confirmed);

            return(Ok());
        }
Example #2
0
        public async Task <IActionResult> ConfirmOrder(int ticketId)
        {
            var ticket = await ticketsService.GetTicketById(ticketId);

            var order = await ordersService.GetOrderByTicketIdAndStatuses(ticket.Id, OrderStatuses.WaitingForConfirmation);

            await ticketsService.ChangeTicketStatus(ticket, TicketStatuses.WaitingForReceivingConfirmation);

            await ordersService.ChangeOrderStatus(order, OrderStatuses.Confirmed);

            return(View("InstructionOrderConfirmed"));
        }
        public async Task <IActionResult> CancelOrder(int orderId)
        {
            var order = await ordersService.GetOrderById(orderId);

            var ticket = await ticketsService.GetTicketById(order.TicketId);

            await ticketsService.ChangeTicketStatus(ticket, TicketStatuses.Selling);

            await ordersService.ChangeOrderStatus(order, OrderStatuses.Cancelled);

            return(View("InstructionOrderCanceled"));
        }