コード例 #1
0
        public virtual ActionResult Edit(ArticleModel model)
        {
            if (ModelState.IsValid)
            {
                Status status;
                if (model.Update(out status))
                {
                    ModelState.AddModelError("Error", "Successfully updated system article");
                }
                else
                {
                    ModelState.AddModelError("Error", status.Message());
                }
            }
            else
            {
                ModelState.AddModelError("Error", "Please update the required fields");
            }

            return(View(model));
        }