Пример #1
0
        public ActionResult Delete(ArtistItemModel artistItemModel)
        {
            try
            {
                if (Application.Delete(artistItemModel.OperationResult, (ArtistDTO)artistItemModel.Artist.ToDTO()))
                {
                    return(JsonResultSuccess(new { uri = ReadUrlDictionary() }));
                }
            }
            catch (Exception exception)
            {
                artistItemModel.OperationResult.ParseException(exception);
            }

            return(JsonResultOperationResult(artistItemModel.OperationResult));
        }
Пример #2
0
        public ActionResult Delete(ArtistItemModel artistItemModel)
        {
            try
            {
                if (Application.Delete(artistItemModel.OperationResult, (ArtistDTO)artistItemModel.Artist.ToDTO()))
                {
                    return(RedirectToUrlDictionary());
                }
            }
            catch (Exception exception)
            {
                artistItemModel.OperationResult.ParseException(exception);
            }

            artistItemModel.IsSecurityOperations = IsSecurityOperations;

            return(View(artistItemModel));
        }
Пример #3
0
        public ActionResult Create(ArtistItemModel artistItemModel)
        {
            try
            {
                if (ValidateModelState(Application.Repository))
                {
                    if (Application.Create(artistItemModel.OperationResult, (ArtistDTO)artistItemModel.Artist.ToDTO()))
                    {
                        return(JsonResultSuccess(new { uri = ReadUrlDictionary() }));
                    }
                }
            }
            catch (Exception exception)
            {
                artistItemModel.OperationResult.ParseException(exception);
            }

            return(JsonResultOperationResult(artistItemModel.OperationResult));
        }
Пример #4
0
        public ActionResult Create()
        {
            ArtistItemModel artistItemModel = new ArtistItemModel()
            {
                IsSecurityOperations = this.IsSecurityOperations,
                Artist           = new ArtistViewModel(),
                ControllerAction = "Create"
            };

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

            return(View(artistItemModel));
        }
Пример #5
0
        public ActionResult Delete(int?artistId)
        {
            ArtistItemModel artistItemModel = new ArtistItemModel()
            {
                IsSecurityOperations = this.IsSecurityOperations,
                Artist           = new ArtistViewModel(),
                ControllerAction = "Delete"
            };

            try
            {
                ArtistDTO artistDTO = Application.GetById(artistItemModel.OperationResult, new object[] { artistId });
                if (artistDTO != null)
                {
                    artistItemModel.Artist = new ArtistViewModel(artistDTO);
                }
            }
            catch (Exception exception)
            {
                artistItemModel.OperationResult.ParseException(exception);
            }

            return(View(artistItemModel));
        }