Example #1
0
        public IActionResult CreateArticlePartial(int format = 0, int year = 0, int section = 0)
        {
            var magazineCategory = new MagazineCategory();

            magazineCategory.Id = format;

            var magazine = new Magazine();

            magazine.Category       = magazineCategory;
            magazine.PublishYear    = year;
            magazine.PublishSection = String.Format("{0}", section);

            var model = new Article();

            model.Magazine = magazine;

            var tags = _magService.GetAllTags();

            if (!tags.IsOk())
            {
                return(PartialView("Layout/_ErrorHandling", string.Format("Hiba a lekérés során ({0} : {1})", tags.Status, tags.Message)));
            }

            var authors = _magService.GetAllAuthors();

            if (!authors.IsOk())
            {
                return(PartialView("Layout/_ErrorHandling", string.Format("Hiba a lekérés során ({0} : {1})", authors.Status, authors.Message)));
            }

            var mapper = _mapper.Map <ArticleVM>(model).Map(tags.Data).Map(authors.Data);

            // Only grid string query values will be visible here.
            return(PartialView("Partials/_AddArticle", mapper));
        }