コード例 #1
0
        //POST
        protected override DriverResult Editor(FaqPart part, IUpdateModel updater, dynamic shapeHelper)
        {
            var model = new EditFaqViewModel();

            if (updater.TryUpdateModel(model, Prefix, null, null))
            {
                if (string.IsNullOrWhiteSpace(model.Question))
                {
                    updater.AddModelError(Prefix, T("Error"));
                }
            }
            if (part.ContentItem.Id != 0)
            {
                _faqService.UpdateFaqForContentItem(part.ContentItem, model);
            }

            return(Editor(part, shapeHelper));
        }