public ActionResult ModifyGuide(办事指南 model) { try { 办事指南 model1 = 办事指南管理.查找办事指南(model.Id); List<string> pathname = new List<string>(); if (model1.内容主体.附件 != null && model1.内容主体.附件.Count() != 0) { pathname = model1.内容主体.附件; } string[] path = Request.Form["path"].ToString().Split('|'); for (int i = 0; i < path.Length - 1; i++) { if (System.IO.File.Exists(Server.MapPath(@path[i]))) { pathname.Add(path[i]); } } if (model.内容主体.发布时间 == default(DateTime)) { model.内容主体.发布时间 = DateTime.Now; } model.内容主体.附件 = pathname; 办事指南管理.更新办事指南(model); return Content("<script>alert('修改成功!');window.location='/单位用户后台/GuideList';</script>"); } catch { return Redirect("/单位用户后台/GuideList"); } }
public ActionResult AddGuide(办事指南 model) { try { List<string> pathname = new List<string>(); string[] path = Request.Form["path"].ToString().Split('|'); for (int i = 0; i < path.Length - 1; i++) { if (System.IO.File.Exists(Server.MapPath(@path[i]))) { pathname.Add(path[i]); } } if (model.内容主体.发布时间 == default(DateTime)) { model.内容主体.发布时间 = DateTime.Now; } model.内容主体.附件 = pathname; 办事指南管理.添加办事指南(model); return Content("<script>if(confirm('成功添加办事指南,点击确定继续添加,点击取消进入查看')){window.location='/单位用户后台/GuideAdd'}else{window.location='/单位用户后台/GuideList'};</script>"); } catch { return Redirect("/单位用户后台/GuideAdd"); } }
public static bool 添加办事指南(办事指南 content) { return Mongo.添加(content); }
public ActionResult GuideAdd() { 办事指南 guid = new 办事指南(); return View(guid); }
public static bool 更新办事指南(办事指南 content) { return Mongo.更新(content); }