Exemplo n.º 1
0
        public ActionResult Delete(int?trackId, int?masterAlbumId = null, int?masterGenreId = null, int?masterMediaTypeId = null)
        {
            TrackItemModel trackItemModel = new TrackItemModel()
            {
                IsSecurityOperations = this.IsSecurityOperations,
                Track            = new TrackViewModel(),
                ControllerAction = "Delete",
                MasterAlbumId    = masterAlbumId, MasterGenreId = masterGenreId, MasterMediaTypeId = masterMediaTypeId
            };

            try
            {
                TrackDTO trackDTO = Application.GetById(trackItemModel.OperationResult, new object[] { trackId });
                if (trackDTO != null)
                {
                    trackItemModel.Track = new TrackViewModel(trackDTO);
                }
            }
            catch (Exception exception)
            {
                trackItemModel.OperationResult.ParseException(exception);
            }

            return(PartialView(trackItemModel));
        }
Exemplo n.º 2
0
        public ActionResult Delete(TrackItemModel trackItemModel)
        {
            try
            {
                if (Application.Delete(trackItemModel.OperationResult, (TrackDTO)trackItemModel.Track.ToDTO()))
                {
                    return(JsonResultSuccess(new { uri = ReadUrlDictionary() }));
                }
            }
            catch (Exception exception)
            {
                trackItemModel.OperationResult.ParseException(exception);
            }

            return(JsonResultOperationResult(trackItemModel.OperationResult));
        }
Exemplo n.º 3
0
        public ActionResult Delete(TrackItemModel trackItemModel)
        {
            try
            {
                if (Application.Delete(trackItemModel.OperationResult, (TrackDTO)trackItemModel.Track.ToDTO()))
                {
                    return(RedirectToUrlDictionary());
                }
            }
            catch (Exception exception)
            {
                trackItemModel.OperationResult.ParseException(exception);
            }

            trackItemModel.IsSecurityOperations = IsSecurityOperations;

            return(View(trackItemModel));
        }
Exemplo n.º 4
0
        public ActionResult Update(TrackItemModel trackItemModel)
        {
            try
            {
                if (ValidateModelState(Application.Repository))
                {
                    if (Application.Update(trackItemModel.OperationResult, (TrackDTO)trackItemModel.Track.ToDTO()))
                    {
                        return(JsonResultSuccess(new { uri = ReadUrlDictionary() }));
                    }
                }
            }
            catch (Exception exception)
            {
                trackItemModel.OperationResult.ParseException(exception);
            }

            return(JsonResultOperationResult(trackItemModel.OperationResult));
        }
Exemplo n.º 5
0
        public ActionResult Create(int?masterAlbumId = null, int?masterGenreId = null, int?masterMediaTypeId = null)
        {
            TrackItemModel trackItemModel = new TrackItemModel()
            {
                IsSecurityOperations = this.IsSecurityOperations,
                Track            = new TrackViewModel(),
                ControllerAction = "Create",
                MasterAlbumId    = masterAlbumId, MasterGenreId = masterGenreId, MasterMediaTypeId = masterMediaTypeId
            };

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

            return(PartialView(trackItemModel));
        }
Exemplo n.º 6
0
        public ActionResult Update(TrackItemModel trackItemModel)
        {
            try
            {
                if (ValidateModelState(Application.Repository))
                {
                    if (Application.Update(trackItemModel.OperationResult, (TrackDTO)trackItemModel.Track.ToDTO()))
                    {
                        return(RedirectToUrlDictionary());
                    }
                }
            }
            catch (Exception exception)
            {
                trackItemModel.OperationResult.ParseException(exception);
            }

            trackItemModel.IsSecurityOperations = IsSecurityOperations;

            return(View(trackItemModel));
        }