public ActionResult Edit(UpdateArticleModel model, int id, string status, int categoryId,string returnUrl="")
        {
            if (ModelState.IsValid)
            {
                var r = Archive.UpdateArticle(id, model.Title, model.Detail, model.Sort,
                    categoryId, model.Tags, model.Image, status);
                if (r.Key)
                {
                    TempData["success"] = "文章保存成功";
                    if (!string.IsNullOrWhiteSpace(returnUrl))
                    {
                        return Redirect(System.Web.HttpUtility.UrlDecode(returnUrl));
                    }
                    return RedirectToAction("Index");
                }

                TempData["error"] = "修改文章失败";
            }
            return View(model);
        }
示例#2
0
        public ActionResult Edit(UpdateArticleModel model, int id, string status, int categoryId)
        {
            if (ModelState.IsValid)
            {
                var r = Archive.UpdateArticle(id, model.Title, model.Detail, model.Sort,
                    categoryId, model.Tags, model.Image, status);
                if (r.Key)
                {
                    TempData["success"] = "文章保存成功";
                    return RedirectToAction("Index");
                }

                TempData["error"] = "修改文章失败";
            }
            return View(model);
        }