public ActionResult Index(string keyword, string ordering, int pageIndex = 1) { var model = _iCmsCategoryService.GetAll() .Select( a => new { a.Name, a.SystemId, a.CreatedDate, a.Remark, a.Id }).Search(keyword); if (!string.IsNullOrEmpty(ordering)) { model = model.OrderBy(ordering, null); } else { model = model.OrderBy(a => a.SystemId); } return(View(model.ToPagedList(pageIndex))); }
public ActionResult Edit(string id, string parameter) { var item = new CmsArtical(); if (!string.IsNullOrEmpty(id)) { item = _iCmsArticalService.GetById(id); } ViewBag.Category = _iCmsCategoryService.GetAll(a => a.Enable && a.SystemId == parameter).FirstOrDefault(); ViewBag.CmsCategoryId = new SelectList(_iCmsCategoryService.GetAll(a => a.Enable && a.SystemId.Substring(0, 3) == parameter && a.SystemId.Length > 3).Select(a => new { a.Id, a.Name }), "Id", "Name", item.CmsCategoryId); return(View(item)); }
public APIResult <List <TypeClassModel> > GetExclusive(string Type) { var model = _iCmsCategoryService.GetAll(a => a.Enable && a.SystemId.Length > 3); if (Type == "找服务") { model = model.Where(a => a.SystemId.Substring(0, 3) == "900"); } else if (Type == "找合作") { model = model.Where(a => a.SystemId.Substring(0, 3) == "800"); } var result = model.OrderBy(a => a.SystemId).Select(a => new TypeClassModel { Id = a.Id, Name = a.Name }).ToList(); return(new APIResult <List <TypeClassModel> >(result)); }
public ActionResult Menu() { var area = (string)RouteData.DataTokens["area"]; var model = _sysControllerService.GetAll(a => a.Display && a.Enable && a.SysControllerSysActions.Any( b => b.SysRoleSysControllerSysActions.Any( c => c.SysRole.Users.Any( d => d.UserId == _iUserInfo.UserId))) && a.SysArea.AreaName.Equals(area)).ToList(); ViewBag.CmsCategory = _iCmsCategoryService.GetAll(a => a.Enable && a.SystemId.Length == 3).OrderBy(a => a.SystemId).ToList(); return(View(model)); }