示例#1
0
    private List <TrafficMessage> DeleteTickets(System.Object value)
    {
        int id = (int)value;

        Lucky.LuckyUtils.Log("delete ticket id " + id);
        TicketsOperaton ticket_operation = new TicketsOperaton();

        RoutineTicket ticket = ticket_operation.GetTicketByTickedId(id);

        Lucky.LuckyUtils.Log("delte routine id " + ticket.GetRoutineId());

        bool abc = ticket_operation.RefundTicket(id);

        if (abc)
        {
            TimeManager.instance.RemoveGo(ticket.GetRoutineId());
            return(new List <TrafficMessage>());
        }
        else
        {
            return(null);
        }
    }
示例#2
0
    public List <TrafficMessage> BuyingTickets(System.Object value)
    {
        int id = (int)value;

        Debug.Log("id " + id);
        TicketsOperaton ticket_operation = new TicketsOperaton();
        int             ticketid         = ticket_operation.BuyTickets(id);

        if (ticketid == 0)
        {
            Lucky.LuckyUtils.Log("ticket id error");
            return(null);
        }
        RoutineTicket ticket = ticket_operation.GetTicketByTickedId(ticketid);

        Lucky.LuckyUtils.Log("ticket " + ticket.GetRoutineStartNode() + " " + ticket.GetBeginTime() + " " + ticket.GetTicketId());
        TimeManager.instance.AddGo(new TicketParam(ticket));
        Lucky.LuckyUtils.Log("buy ticket id " + ticket.GetTicketId() + " routtine id" + ticket.GetRoutineId());
        return(new List <TrafficMessage>());
    }