// // GET: /Platform/iSysHelpClass/ public ActionResult Index(string keyword, string ordering, int pageIndex = 1, bool search = false) { var model = _iSysHelpClassService.GetAll() .Select( a => new { a.Name, a.SystemId, a.CreatedDate, a.Remark, a.Id }).Search(keyword); if (search) { model = model.Search(Request.QueryString); } if (!string.IsNullOrEmpty(ordering)) { model = model.OrderBy(ordering, null); } return(View(model.ToPagedList(pageIndex))); }
/// <summary> /// </summary> /// <param name="id"> /// </param> /// <returns> /// </returns> public async Task <IActionResult> Edit(string id) { var item = new SysHelp(); if (!string.IsNullOrEmpty(id)) { item = await _iSysHelpService.FindAsync(id); } ViewBag.SysHelpClassId = _iSysHelpClassService.GetAll(a => a.Enable).ToSystemIdSelectList(item.SysHelpClassId); return(View(item)); }
// // GET: /Platform/SysHelp/Edit/5 /// <summary> /// /// </summary> /// <param name="id"></param> /// <returns></returns> public ActionResult Edit(string id) { var item = new SysHelp(); if (!string.IsNullOrEmpty(id)) { item = _sysHelp.GetById(id); } ViewBag.SysHelpClassId = _iSysHelpClassService.GetAll(a => a.Enable).ToSystemIdSelectList(item.SysHelpClassId); return(View(item)); }
/// <summary> /// </summary> /// <param name="keyword"> /// </param> /// <param name="ordering"> /// </param> /// <param name="pageIndex"> /// </param> /// <param name="search"> /// </param> /// <returns> /// </returns> public async Task <IActionResult> Index(string keyword, string ordering, int pageIndex = 1, bool search = false, bool toExcelFile = false) { var model = _iSysHelpClassService.GetAll() .Select( a => new { a.Name, a.SystemId, a.Enable, CreatedBy = a.UserCreatedBy.UserName, a.CreatedDateTime, UpdatedBy = a.UserUpdatedBy.UserName, a.UpdatedDateTime, a.Remark, a.Id }).Search(keyword); if (search) { model = model.Search(Request.Query); } if (!string.IsNullOrEmpty(ordering)) { model = model.OrderBy(ordering); } if (toExcelFile) { return(model.ToExcelFile()); } return(View(model.PageResult(pageIndex, 20))); }
public async Task <IViewComponentResult> InvokeAsync() { var model = _ISysHelpClassService.GetAll(a => a.SystemId.StartsWith("800")); return(View(model)); }