Ejemplo n.º 1
0
        public ActionResult DeleteEp(Guid epId)
        {
            //string userEmail = Session["LoginEmail"].ToString();
            string userEmail = "*****@*****.**";

            if (userEmail == null)
            {
                return(RedirectToAction("Index", "UserProfile"));
            }

            businessLogics = new BusinessLogics();

            if (businessLogics.IsAccountContainsThisEp(userEmail, epId))
            {
                var result = businessLogics.DeleteEp(epId);

                /*
                 * 0 = No Album found. Operation failed.
                 * 1 = Operation done successfully.
                 * 2 = Operation Faild while deleting album. Internal error occured.
                 * 3 = An Record Couldn't deleted from AlbumTrackMaster Table due to internal error.
                 * 4 = Operation Failed in the level of AlbumTrackMaster Label.
                 * 5 = Error while deleting a solo track that belongs to only the album
                 * 6 = Track fetching failed.
                 * 7 = Error occured while deleting a valid track
                 * 8 = A track from the album is already submitted to the store. can't delete album
                 * 9 = Error while updating the associated purchase record. User can't create an album with the valid purchase.
                 */
                if (result != 1)
                {
                    TempData["ErrorMsg"] = "Error occured while deleting Ep";
                }
                return(RedirectToAction("Index", "UserProfile"));
            }
            else
            {
                TempData["ErrorMsg"] = "You are trying to remove an Ep that doesn't belongs to you";
                return(RedirectToAction("Index", "UserProfile"));
            }
        }