public ActionResult Delete(int?albumId, int?masterArtistId = null)
        {
            AlbumItemModel albumItemModel = new AlbumItemModel()
            {
                IsSecurityOperations = this.IsSecurityOperations,
                Album            = new AlbumViewModel(),
                ControllerAction = "Delete",
                MasterArtistId   = masterArtistId
            };

            try
            {
                AlbumDTO albumDTO = Application.GetById(albumItemModel.OperationResult, new object[] { albumId });
                if (albumDTO != null)
                {
                    albumItemModel.Album = new AlbumViewModel(albumDTO);
                }
            }
            catch (Exception exception)
            {
                albumItemModel.OperationResult.ParseException(exception);
            }

            return(PartialView(albumItemModel));
        }
        public ActionResult Delete(AlbumItemModel albumItemModel)
        {
            try
            {
                if (Application.Delete(albumItemModel.OperationResult, (AlbumDTO)albumItemModel.Album.ToDTO()))
                {
                    return(JsonResultSuccess(new { uri = ReadUrlDictionary() }));
                }
            }
            catch (Exception exception)
            {
                albumItemModel.OperationResult.ParseException(exception);
            }

            return(JsonResultOperationResult(albumItemModel.OperationResult));
        }
Exemple #3
0
        public ActionResult Delete(AlbumItemModel albumItemModel)
        {
            try
            {
                if (Application.Delete(albumItemModel.OperationResult, (AlbumDTO)albumItemModel.Album.ToDTO()))
                {
                    return(RedirectToUrlDictionary());
                }
            }
            catch (Exception exception)
            {
                albumItemModel.OperationResult.ParseException(exception);
            }

            albumItemModel.IsSecurityOperations = IsSecurityOperations;

            return(View(albumItemModel));
        }
        public ActionResult Create(AlbumItemModel albumItemModel)
        {
            try
            {
                if (ValidateModelState(Application.Repository))
                {
                    if (Application.Create(albumItemModel.OperationResult, (AlbumDTO)albumItemModel.Album.ToDTO()))
                    {
                        return(JsonResultSuccess(new { uri = ReadUrlDictionary() }));
                    }
                }
            }
            catch (Exception exception)
            {
                albumItemModel.OperationResult.ParseException(exception);
            }

            return(JsonResultOperationResult(albumItemModel.OperationResult));
        }
        public ActionResult Create(int?masterArtistId = null)
        {
            AlbumItemModel albumItemModel = new AlbumItemModel()
            {
                IsSecurityOperations = this.IsSecurityOperations,
                Album            = new AlbumViewModel(),
                ControllerAction = "Create",
                MasterArtistId   = masterArtistId
            };

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

            return(PartialView(albumItemModel));
        }