public TicketVM() { _ticketholderList = Ticket.GetTicketholders(); _ticketTypeList = TicketType.GetTicketTypes(); SelectedTicketholder = new Ticket(); NewTicketType = new TicketType(); }
//ophalen uit model public SettingsVM() { _types = ContactPersonType.GetTypes(); _changeTypes = ContactPersonType.GetTypes(); _festival = Festival.GetFestival(); _tickettypes = TicketType.GetTicketTypes(); _stagetypes = Stage.GetStages(); _Bands = Band.GetBands(); _genres = Genre.GetGenres(); _changeGenres = Genre.GetGenres(); }
private void NewTicketType() { TicketType tt = new TicketType(); tt.Name = _selectedTicketType.Name; tt.Price = _selectedTicketType.Price; tt.AvailableTickets = _selectedTicketType.AvailableTickets; TicketType.InsertTicketType(tt); MessageBox.Show("de nieuwe ticket " + _selectedTicketType.Name + " is toegevoegd"); _tickettypes = TicketType.GetTicketTypes(); OnPropertyChanged("TicketTypes"); }
private void EditTicketType() { TicketType tt = new TicketType(); tt.ID = _selectedTicketType.ID; tt.Name = _selectedTicketType.Name; tt.Price = _selectedTicketType.Price; tt.AvailableTickets = _selectedTicketType.AvailableTickets; TicketType.UpdateTicketType(tt); MessageBox.Show("De instellingen voor " + _selectedTicketType.Name + " zijn aangepast"); _tickettypes = TicketType.GetTicketTypes(); OnPropertyChanged("TicketTypes"); }
private void DeleteTicketType() { TicketType tt = new TicketType(); tt.Name = _selectedTicketType.Name; tt.Price = _selectedTicketType.Price; tt.AvailableTickets = _selectedTicketType.AvailableTickets; TicketType.DeleteTicketType(tt); MessageBox.Show("De ticket " + _selectedTicketType.Name + "is verwijderd"); MessageBox.Show("Indien er hier tickets mee gemaakt zijn, zijn deze niet meer geldig"); _tickettypes = TicketType.GetTicketTypes(); OnPropertyChanged("TicketTypes"); }
public void SaveTicketType() { try { string sql = "INSERT INTO Tickettypes(Name,Price,Available) VALUES (@Name,@Price,@Available)"; DbParameter parName = Database.AddParameter("@Name", NewTicketType.Name); DbParameter parPrice = Database.AddParameter("@Price", NewTicketType.Price); DbParameter parAvailable = Database.AddParameter("@Available", NewTicketType.AvailableTickets); Database.ModifyData(sql, parName, parPrice, parAvailable); TicketTypeList.Add(NewTicketType); TicketTypeList = TicketType.GetTicketTypes(); MessageBox.Show("Tickettype werd succesvol toegevoegd"); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
//gegevens ophalen public TicketingVM() { _tickettypes = TicketType.GetTicketTypes(); _tickets = Ticket.GetTickets(); }
//opnieuw inladen datagrid //dit werkt momenteel niet als een window gesloten wordt. public void refresh() { _tickettypes = TicketType.GetTicketTypes(); _lineUPs = LineUp.GetLineUp(); }
public MainPageVM() { _tickettypes = TicketType.GetTicketTypes(); _lineUPs = LineUp.GetLineUp(); }