// // GET: /ScreenStats/ScreenRecStats/ public ActionResult Index() { int count; var list = _rep.QueryByPage(0, PageSize, out count, null, Sort).Select(Map).ToList(); ViewBag.RecordCount = count; ViewBag.PageSize = PageSize; var nums = new List <ListItem> { new ListItem("全部设备", "") }; nums.AddRange(_rep.Distinct(t => t.DeviceNum).Select(t => new ListItem(t, t))); ViewBag.DeviceNums = nums.ToArray(); return(View(list)); }
public ViewResult Search() { ViewBag.ScreenTypes = CommonHelper.GetEnumSelectList(typeof(ScreenTypeEnum)); ViewBag.Owners = _rep.Distinct(t => t.Owner).OrderBy(t => t).Select(t => new ListItem(t.ToString(), t.ToString())).ToArray(); var l = GetBasicDdlByName("付款状态").ToList(); l.Insert(0, new ListItem("全部", "")); ViewBag.ddlStatus = l.ToArray(); return(View()); }
public ActionResult AddOrEdit(int?id) { ViewBag.hTypes = _rep.Distinct(t => t.HitchType).Where(t => !string.IsNullOrWhiteSpace(t)).Select(t => new ListItem(t, t)).ToArray(); ViewBag.hStatuses = (from object e in Enum.GetValues(typeof(HitchStatusEnum)) select new ListItem(e.ToString(), ((int)e).ToString())).ToArray(); ViewBag.Accepters = _rep.Distinct(t => t.Accepter).Where(t => !string.IsNullOrWhiteSpace(t)).OrderBy(t => t).Select(t => new ListItem(t, t)).ToArray(); ViewBag.Handlers = _rep.Distinct(t => t.Handler).Where(t => !string.IsNullOrWhiteSpace(t)).OrderBy(t => t).Select(t => new ListItem(t, t)).ToArray(); ViewBag.isAuth = _isAuth; if (id == null) { return(View()); } var model = _rep.Get(t => t._id == id); if (model == null) { return(HttpNotFound()); } return(View(model)); }
// // GET: /ComfortDegree/ComfortDegreeStats/ public ActionResult Index() { int count; var list = _rep.QueryByPage(0, PageSize, out count); ViewBag.RecordCount = count; ViewBag.PageSize = PageSize; var nums = new List <ListItem> { new ListItem("全部车号", "") }; nums.AddRange(_rep.Distinct(t => t.VehNo).Select(t => new ListItem(t, t))); ViewBag.ddlVehNo = nums.ToArray(); var lines = new List <ListItem> { new ListItem("全部线路", "") }; lines.AddRange(_rep.Distinct(t => t.LineName).Select(t => new ListItem(t, t))); ViewBag.ddlLine = lines.ToArray(); var levels = new List <ListItem> { new ListItem("全部站级", "") }; levels.AddRange( _rep.Distinct(t => t.LevelId).OrderBy(t => t).Select(t => new ListItem(t.ToString(), t.ToString()))); ViewBag.ddlLevel = levels.ToArray(); ViewBag.ddlUpdown = new List <ListItem> { new ListItem("上下行", ""), new ListItem("上行", "0"), new ListItem("下行", "1") }.ToArray(); ViewBag.ddlIsSame = new[] { new ListItem("全部审核结果", ""), new ListItem("结果一致", "true"), new ListItem("结果不一致", "false") }; return(View(list)); }