Example #1
0
 /// <summary>
 /// Creates a new channel in the database. Is called from CreateChannel window.
 /// </summary>
 /// <param name="channel"></param>
 /// <returns></returns>
 public ActionResult CreateNewChannel(GuiChannel channel, int? userId, SelectedGenrePostModel model)
 {
     if (userId.HasValue)
     {
         channel.OwnerId = userId.Value;
         int channelId;
         if (model.ChosenGenres == null) model.ChosenGenres = new List<int>();
         using (RentItServiceClient proxy = new RentItServiceClient())
         {
             channelId = proxy.CreateChannel(channel.Name, userId.Value, channel.Description, model.ChosenGenres.ToArray());
         }
         return RedirectToAction("SelectChannel", new { channelId = channelId, userId = userId });
     }
     return RedirectToAction("Index", "Home");
 }