private ActionResult GetArtists(string query, ArtistRole role) { int totalCount; var result = _unitOfWork.Repository<Artist>().Query() .Filter(a => a.PrimaryRole == role && a.Name.ToLower().StartsWith(query.ToLower())) .OrderBy(a => a.OrderBy(artist => artist.Name)) .GetPage(1, 20, out totalCount).Select(a => a.Name); return Json(result, JsonRequestBehavior.AllowGet); }
public string GetArtistName(ArtistRole role) { string artist = string.Empty; if (this.Artists !=null && this.Artists.Any(ma => ma.Role == role)) { artist = string.Join(",", this.Artists.Where(ma => ma.Role == role).Select(ma => ma.Artist.Name)); } return artist; }
public string GetNameByRole(ArtistRole role) { string name = string.Empty; switch (role) { case ArtistRole.Hero: name = this.Hero; break; case ArtistRole.Heroin: name = this.Heroin; break; case ArtistRole.Director: name = this.Director; break; case ArtistRole.Producer: name = this.Producer; break; case ArtistRole.MusicDirector: name = this.MusicDirector; break; case ArtistRole.Writer: break; case ArtistRole.ScreenPlayWriter: break; case ArtistRole.CharacterArtist: break; default: break; } return name; }