public ActionResult Add() { try { if (!CheckMemberlogin) { return RedirectToAction("login", "admin"); } else { leftModel(); var model = new AboutViewModel() { aboutClass = abClassd.Get().ToList().OrderBy(a => a.sort) }; return View(model); } } catch (Exception ex) { NlogWrite.Log(ex, 6); return RedirectToAction("login", "admin"); } }
public ActionResult Add() { if (!CheckMemberlogin) { return RedirectToAction("login", "admin"); } else { leftModel(); var model = new AboutViewModel() { aboutClass = abclassd.Get().ToList().OrderBy(a => a.sort) }; return View(model); } }
// GET: about public ActionResult Index(int? kind) { AboutViewModel model = null; if (kind != null) { model = new AboutViewModel() { about = abd.Get().ToList().Where(a => a.isdel == 0 && a.kind == kind).OrderBy(a => a.sort), aboutClass = abClassd.Get().ToList().Where(a=>a.isdel == 0) }; } else { model = new AboutViewModel() { about = abd.Get().ToList().Where(a => a.isdel == 0).OrderBy(a=>a.sort), aboutClass = abClassd.Get().ToList().Where(a => a.isdel == 0) }; } return View(model); }
// GET: adminAbout public ActionResult Read(int page = 1, string find1 = "") { if (!CheckMemberlogin) { return RedirectToAction("login","admin"); } else { leftModel(); ViewBag.searchResult = 0; ViewBag.search = 0; ViewBag.gowhere = Url.Action("Read", "adminAbout"); if (find1 != "") { ViewBag.searchResult = 1; ViewBag.searchText = find1; } var currentpage = page < 1 ? 1 : page; var pagesize = 10; var abouts = abd.Get().ToList().Where(a =>a.isdel == 0 && a.word.Contains(find1)).OrderBy(a => a.sort); var model = new AboutViewModel() { about_pagelist = abouts.ToPagedList(currentpage, pagesize), aboutClass = abClassd.Get().ToList().Where(a => a.isdel == 0) }; return View(model); } }
public ActionResult Edit(int num) { try { if (!CheckMemberlogin) { return RedirectToAction("login", "admin"); } else { leftModel(); var model = new AboutViewModel() { about = abd.Get().ToList().Where(a => a.num == num && a.isdel == 0).OrderBy(a => a.sort), aboutClass = abClassd.Get().ToList() }; return View(model); } } catch (Exception ex) { NlogWrite.Log(ex, 6); return RedirectToAction("login", "admin"); } }