Exemple #1
0
 public ActionResult ShowAlbumTrackDetail(Guid albumId, Guid trackId, int?StoreSubmissionStatus)
 {
     if (Session["LoginEmail"] != null)
     {
         string userEmail = Session["LoginEmail"].ToString();
         businessLogics = new BusinessLogics();
         var singlesOfThisAlbum = businessLogics.GetTrackDetailsOfAlbum(albumId);
         if ((businessLogics.IsAccountContainsThisAlbum(userEmail, albumId) &&
              singlesOfThisAlbum.Any(solo => solo.Id == trackId)) ||
             User.IsInRole("superadmin") ||
             User.IsInRole("admin"))
         {
             ViewBag.TrackDetail           = singlesOfThisAlbum.Where(track => track.Id == trackId).SingleOrDefault();
             ViewBag.Category              = "Album";
             ViewBag.AlbumDetail           = businessLogics.GetAlbumById(albumId);
             ViewBag.StoreSubmissionStatus = StoreSubmissionStatus;
             return(View("ShowTrackDetail"));
         }
         else
         {
             TempData["ErrorMsg"] = "Something suspecious occured";
             return(RedirectToAction("Index", "UserProfile"));
         }
     }
     else
     {
         return(RedirectToAction("Index", "UserProfile"));
     }
 }
Exemple #2
0
        public ActionResult EditTrackDetailsForAlbum(Guid albumId, Guid trackId)
        {
            businessLogics = new BusinessLogics();
            logic          = new GeneralLogics();
            string userEmail = Session["LoginEmail"].ToString();

            if (userEmail != null && businessLogics.IsAccountContainsThisAlbum(userEmail, albumId))
            {
                var albumDetails = businessLogics.GetAlbumDetail(albumId, trackId);
                if (albumDetails != null)
                {
                    if (albumDetails.StoreSubmissionStatus == 0)
                    {
                        var albumPurchase = businessLogics.GetAlbumById((Guid)albumDetails.Album_Id);
                        if (albumPurchase.PurchaseRecord.Usage_Exp_Date > logic.CurrentIndianTime())
                        {
                            var trackDetail = businessLogics.GetTrackById(trackId);
                            if (trackDetail != null)
                            {
                                ViewBag.Title       = "Edit Track";
                                ViewBag.TrackDetail = trackDetail;
                                ViewBag.TrackId     = trackDetail.Id;
                                return(View("EditTrack"));
                            }
                            else
                            {
                                TempData["ErrorMsg"] = "Error while fetching track details";
                            }
                        }
                        else
                        {
                            TempData["ErrorMsg"] = "Your purchase has expired. you can't modify the track";
                        }
                    }
                    else
                    {
                        TempData["ErrorMsg"] = "The track is already submitted to store. You can't edit this track";
                    }
                }
                else
                {
                    TempData["ErrorMsg"] = "Track is not valid";
                }
            }
            else
            {
                TempData["ErrorMsg"] = "You are trying to modify a track details that doesn't belongs to you";
            }
            return(RedirectToAction("ShowIndividualAlbumSongs", "Album", new { albumId = albumId }));
        }
Exemple #3
0
        public ActionResult ShowIndividualAlbumSongs(Guid albumId)
        {
            businessLogics = new BusinessLogics();

            var album = businessLogics.GetAlbumById(albumId);

            ViewBag.Album = album;

            //get the list of all tracks of the same album
            ViewBag.details = businessLogics.GetAllTracksWithAlbumDetails(albumId);

            ViewBag.IsAlbumFull = businessLogics.IsAlbumFull(albumId);

            return(View("DisplayAlbum"));
        }
Exemple #4
0
        public ActionResult EditOnlyAlbum(Guid albumId)
        {
            string userEmail = Session["LoginEmail"].ToString();

            //string userEmail = "*****@*****.**";

            businessLogics = new BusinessLogics();

            if (userEmail != null)
            {
                if (businessLogics.IsAccountContainsThisAlbum(userEmail, albumId))
                {
                    ViewBag.Title = "Edit Album";

                    var albumObject = businessLogics.GetAlbumById(albumId);
                    if (albumObject != null)
                    {
                        ViewBag.AlbumDetail = albumObject;
                    }
                    else
                    {
                        ViewBag.ErrorMsg = "No album found with the Id provided";
                    }
                    return(View("AddorEditAlbum"));
                }
                else
                {
                    TempData["ErrorMsg"] = "You are trying to modify an Album that does not belongs to you";
                    return(RedirectToAction("Index", "UserProfile"));
                }
            }
            else
            {
                return(RedirectToAction("Index", "UserProfile"));
            }
        }