Beispiel #1
0
        public ActionResult Delete(PlaylistItemModel playlistItemModel)
        {
            try
            {
                if (Application.Delete(playlistItemModel.OperationResult, (PlaylistDTO)playlistItemModel.Playlist.ToDTO()))
                {
                    return(JsonResultSuccess(new { uri = ReadUrlDictionary() }));
                }
            }
            catch (Exception exception)
            {
                playlistItemModel.OperationResult.ParseException(exception);
            }

            return(JsonResultOperationResult(playlistItemModel.OperationResult));
        }
        public ActionResult Delete(PlaylistItemModel playlistItemModel)
        {
            try
            {
                if (Application.Delete(playlistItemModel.OperationResult, (PlaylistDTO)playlistItemModel.Playlist.ToDTO()))
                {
                    return(RedirectToUrlDictionary());
                }
            }
            catch (Exception exception)
            {
                playlistItemModel.OperationResult.ParseException(exception);
            }

            playlistItemModel.IsSecurityOperations = IsSecurityOperations;

            return(View(playlistItemModel));
        }
Beispiel #3
0
        public ActionResult Create(PlaylistItemModel playlistItemModel)
        {
            try
            {
                if (ValidateModelState(Application.Repository))
                {
                    if (Application.Create(playlistItemModel.OperationResult, (PlaylistDTO)playlistItemModel.Playlist.ToDTO()))
                    {
                        return(JsonResultSuccess(new { uri = ReadUrlDictionary() }));
                    }
                }
            }
            catch (Exception exception)
            {
                playlistItemModel.OperationResult.ParseException(exception);
            }

            return(JsonResultOperationResult(playlistItemModel.OperationResult));
        }
        public ActionResult Create()
        {
            PlaylistItemModel playlistItemModel = new PlaylistItemModel()
            {
                IsSecurityOperations = this.IsSecurityOperations,
                Playlist             = new PlaylistViewModel(),
                ControllerAction     = "Create"
            };

            try
            {
                IsCreate(playlistItemModel.OperationResult);
            }
            catch (Exception exception)
            {
                playlistItemModel.OperationResult.ParseException(exception);
            }

            return(View(playlistItemModel));
        }
        public ActionResult Delete(int?playlistId)
        {
            PlaylistItemModel playlistItemModel = new PlaylistItemModel()
            {
                IsSecurityOperations = this.IsSecurityOperations,
                Playlist             = new PlaylistViewModel(),
                ControllerAction     = "Delete"
            };

            try
            {
                PlaylistDTO playlistDTO = Application.GetById(playlistItemModel.OperationResult, new object[] { playlistId });
                if (playlistDTO != null)
                {
                    playlistItemModel.Playlist = new PlaylistViewModel(playlistDTO);
                }
            }
            catch (Exception exception)
            {
                playlistItemModel.OperationResult.ParseException(exception);
            }

            return(View(playlistItemModel));
        }