public ActionResult Edit() { var item = new SysDepartment(); var Depart = _iSysDepartmentSysUserService.GetAll(a => a.SysUserId == _iUserInfo.UserId).FirstOrDefault(); if (Depart != null) { var DepartId = Depart.SysDepartmentId; if (!string.IsNullOrEmpty(DepartId)) { item = _iDepartmentService.GetById(DepartId); } ViewBag.DepartName = Depart.SysDepartment.Name; } ViewBag.TrainingType1 = _trainingTypeService.GetAll(a => a.Position == Position.肢).ToList(); ViewBag.TrainingType2 = _trainingTypeService.GetAll(a => a.Position == Position.肢).ToList(); ViewBag.TrainingType3 = _trainingTypeService.GetAll(a => a.Position == Position.躯干).ToList(); return(View(item)); }
public ActionResult Index(string keyword, string ordering, int pageIndex = 1) { var model = _trainingTypeService.GetAll() .Select( a => new { a.Name, a.Position, a.CreatedDate, a.Remark, a.Id }).Search(keyword); if (!string.IsNullOrEmpty(ordering)) { model = model.OrderBy(ordering, null); } return(View(model.ToPagedList(pageIndex))); }