Esempio n. 1
0
        public ActionResult NewsEdit(string articleId)
        {
            if (articleId.IsNullOrEmpty())
            {
                return(View());
            }

            var model = _newService.GetArticle(int.Parse(articleId));

            ArticleModel viewModel = null;

            if (model != null)
            {
                viewModel = new ArticleModel();
                model.CopyTo(viewModel);
                var category = _newService.GetCategory(model.CategoryID);
                viewModel.CategoryName = category != null ? category.Name : "";
            }
            return(View(viewModel));
        }