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

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

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

            db.Lexturys.Add(ticket);

            db.SaveChanges();
            db.Dispose();
            MessageBox.Show("Добавили " + ticket.Title);
        }
Exemplo n.º 3
0
 public LexturyViewModel(Lextury ticket)
 {
     this.lextury = ticket;
 }