Ejemplo n.º 1
0
        public IActionResult Edit(int id)
        {
            var _Base_ArticleTag_Entity = _base_ArticleTag_DataService.GetArticleTag(id);

            VM_ArticleTag entity = new VM_ArticleTag()
            {
                Id             = _Base_ArticleTag_Entity == null ? 0 : _Base_ArticleTag_Entity.Id,
                ArticleTagCode = _Base_ArticleTag_Entity == null ? "" : _Base_ArticleTag_Entity.ArticleTagCode,
                ArticleTagName = _Base_ArticleTag_Entity == null ? "" : _Base_ArticleTag_Entity.ArticleTagName
            };

            return(View(entity));
        }
Ejemplo n.º 2
0
        public IActionResult Edit(VM_ArticleTag entity)
        {
            if (ModelState.IsValid)
            {
                var _Base_ArticleTag_Entity = new Entity.Sub.Base_ArticleTag_Entity()
                {
                    Id             = entity.Id,
                    ArticleTagCode = entity.ArticleTagCode,
                    ArticleTagName = entity.ArticleTagName
                };

                if (entity.Id > 0)
                {
                    _base_ArticleTag_DataService.UpdateArticleTag(_Base_ArticleTag_Entity);
                }
                else
                {
                    //创建
                    entity.Id = _base_ArticleTag_DataService.InsertArticleTag(_Base_ArticleTag_Entity);
                }
            }

            return(RedirectToAction("Index"));
        }