Exemplo n.º 1
0
        private void GiveItem()
        {
            Count--;
            db = new TicketsContext();
            db.AirTickets.Load();
            AirTicket ticket = new AirTicket();

            ticket       = db.AirTickets.Find(Id);
            ticket.Count = Count;
            db.SaveChanges();
            db.Dispose();
        }
Exemplo n.º 2
0
        private void AddItem()
        {
            db = new TicketsContext();
            db.AirTickets.Load();
            Random    rand   = new Random();
            AirTicket ticket = new AirTicket();

            ticket.Title = Title;
            ticket.Count = rand.Next(1, 100);
            ticket.Date  = Date;
            ticket.Type  = Type;

            db.AirTickets.Add(ticket);
            db.SaveChanges();
            db.Dispose();
            Console.WriteLine("che nit" + ticket.Title);
        }
Exemplo n.º 3
0
 public AirTicketViewModel(AirTicket ticket)
 {
     this.airTicket = ticket;
 }