public static bool HasChannelTracks(int channelId) { using (RentItServiceClient proxy = new RentItServiceClient()) { return proxy.GetTrackByChannelId(channelId).Length > 0; } }
public static GuiChannel ConvertChannel(Channel c) { GuiChannel chan = new GuiChannel() { Id = c.Id, Description = c.Description, Plays = c.Hits != null ? c.Hits.Value : 0, Name = c.Name, StreamUri = c.StreamUri, OwnerId = c.OwnerId, }; using (RentItServiceClient proxy = new RentItServiceClient()) { //Get number of subscribers chan.Subscribers = proxy.GetSubscriberCount(chan.Id); //Get the channels chan.Tracks = ConvertTracks(proxy.GetTrackByChannelId(c.Id)); //Get the genres chan.Genres = ConvertGenres(proxy.GetGenresForChannel(c.Id)); } return chan; }
public ActionResult EditTracks(int channelId, int? userId) { if (userId.HasValue) { List<GuiTrack> guiTracks; using (RentItServiceClient proxy = new RentItServiceClient()) { Track[] tracks = proxy.GetTrackByChannelId(channelId); guiTracks = Utilities.GuiClassConverter.ConvertTracks(tracks); } return View("TrackList", new Tuple<List<GuiTrack>, int, int>(guiTracks, channelId, userId.Value)); } return RedirectToAction("Index", "Home"); }