public CategoryViewModel(IManager manager) { this.manager = manager; this.category = new Category(); this.SaveCommand = new RelayCommand(o => UpdateCategory()); ConfigureValidation(); }
/// <summary> /// Gets all artists by category. /// </summary> /// <param name="category">The category.</param> /// <returns></returns> /// <exception cref="System.ArgumentNullException">Invalid Country provided</exception> public IList<Artist> GetAllArtistsByCategory(Category category) { if (category == null || category.Id == null) throw new ArgumentNullException("Invalid Country provided"); return artistDao.FindByCategoryId(category.Id); }
public Restriction() { Id = 0; Start = new DateTime(); End = new DateTime(); Venue = null; Category = null; }
public Restriction(int id, DateTime start, DateTime end, Venue venue, Category category) { Id = id; Start = start; End = end; Venue = venue; Category = category; }
public CategoryViewModel(Category category, IManager manager) { this.manager = manager; if (category == null) this.category = new Category(); else this.category = category; this.SaveCommand = new RelayCommand(o => UpdateCategory()); ConfigureValidation(); }
private void CreateTestData() { var cat = new Category(COMEDY_ID, COMEDY_LABEL); var categoryDao = new CategoryDao(database); categoryDao.Insert(cat); items = new List<Artist>(); items.Add(new Artist(ARTIST1_ID, ARTIST1_NAME, ARTIST1_COUNTRY, ARTIST1_MAIL, "", "", "", "", cat, false)); items.Add(new Artist(ARTIST2_ID, ARTIST2_NAME, ARTIST2_COUNTRY, ARTIST2_MAIL, "", "", "", "", cat, false)); items.Add(new Artist(ARTIST3_ID, ARTIST3_NAME, ARTIST3_COUNTRY, ARTIST3_MAIL, "", "", "", "", cat, false)); }
public bool Insert(Category o) { if (o == null || o.Id == null || o.Label == null) return false; var command = _database.CreateCommand(SQL_INSERT); _database.DefineParameter(command, "@id", DbType.String, o.Id); _database.DefineParameter(command, "@label", DbType.String, o.Label); return _database.ExecuteNonQuery(command) == 1; }
public Artist(int id, string name, string country, string email, string description, string homepage, string picture, string video, Category category, bool deleted) { Id = id; Name = name; Country = country; Email = email; Homepage = homepage; Description = description; VideoUrl = video; PictureUrl = picture; Category = category; IsDeleted = deleted; }
private void CreateTestData() { var loc = new Location(LOCATION_ID, LOCATION); var locationDao = new LocationDao(database); locationDao.Insert(loc); var venue = new Venue(VENUE_ID, VENUE_LABEL, VENUE_SPECTATORS, loc, 0, 0); var venueDao = new VenueDao(database); venueDao.Insert(venue); var category = new Category(CATEGORY_ID, CATEGORY_LABEL); var categoryDao = new CategoryDao(database); categoryDao.Insert(category); items = new List<Restriction>(); items.Add(new Restriction(1, RESTRICTION1_START, RESTRICTION1_STOP, venue, category)); items.Add(new Restriction(2, RESTRICTION2_START, RESTRICTION2_STOP, venue, category)); items.Add(new Restriction(3, RESTRICTION3_START, RESTRICTION3_STOP, venue, category)); items.Add(new Restriction(4, RESTRICTION4_START, RESTRICTION4_STOP, venue, category)); }
private void CreateTestData() { var loc = new Location(LOCATION_ID, LOCATION); var locationDao = new LocationDao(database); locationDao.Insert(loc); var venue = new Venue(VENUE_ID, VENUE_LABEL, VENUE_SPECTATORS, loc, 0, 0); var venueDao = new VenueDao(database); venueDao.Insert(venue); var category = new Category(CATEGORY_ID, CATEGORY_LABEL); var categoryDao = new CategoryDao(database); categoryDao.Insert(category); var artist = new Artist(ARTIST_ID, ARTIST_NAME, ARTIST_COUNTRY, ARTIST_MAIL, "", "", "", "", category, false); var artistDao = new ArtistDao(database); artistDao.Insert(artist); items = new List<Performance>(); items.Add(new Performance(1, PERFORMANCE1_START, artist, venue)); items.Add(new Performance(2, PERFORMANCE2_START, artist, venue)); items.Add(new Performance(3, PERFORMANCE3_START, artist, venue)); items.Add(new Performance(4, PERFORMANCE4_START, artist, venue)); }
public List<Artist> GetAllArtistsByCategory(Category category) { return new List<Artist>(viewBL.GetAllArtistsByCategory(category)); }
public void UpdateCategory(Category category) { if (category == null) throw new ArgumentNullException("Invalid category"); if (categoryDao.FindById(category.Id) != null) { if (!categoryDao.Update(category)) throw new CategoryException("Cannot update category!"); } else { CreateCategory(category); } }
public void RemoveCategory(Category category) { if (category == null) throw new ArgumentNullException("Invalid category!"); if (!categoryDao.Delete(category.Id)) throw new CategoryException("Cannot remove category!"); }
public void CreateCategory(Category category) { if (category == null) throw new ArgumentNullException("Invalid category!"); if (!categoryDao.Insert(category)) throw new CategoryException("Cannot insert category!"); }
public bool CategoryExists(Category category) { if (category == null) return false; return categoryDao.FindById(category.Id) != null; }