Exemplo n.º 1
0
        public void insertData(CreateTokenModel createTokenModel)
        {
            tokenNumber = random.Next(10000000, 20000000);
            Journey journey = new Journey();
            Token   token   = new Token();

            journey.JourneyDate   = createTokenModel.JourneyDate;
            journey.JourneyStart  = createTokenModel.JourneyStart;
            journey.JourneyEnd    = createTokenModel.JourneyEnd;
            journey.CoatchType    = createTokenModel.CoatchType;
            journey.TimeOfJourney = createTokenModel.TimeOfJourney;
            journey.TokenNumber   = tokenNumber;
            token.TokenNumber     = tokenNumber;

            railwayDbContexts.Token.Add(token);
            railwayDbContexts.SaveChanges();
            railwayDbContexts.Journey.Add(journey);
            railwayDbContexts.SaveChanges();
            //UpdateTicketStatus(journey.CoatchType);
        }
Exemplo n.º 2
0
        public Journey GetDetails()
        {
            Journey journey = railwayDbContexts.Journey.FirstOrDefault(y => y.TokenNumber == tokenNumber);

            return(journey);
        }