Пример #1
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 }));
        }