//
        // GET: /Platform/SysController/Edit/5

        public ActionResult Edit(Guid?id)
        {
            var item = new SysController();

            if (id.HasValue)
            {
                item = _sysControllerService.GetById(id.Value);
            }
            ViewBag.SysAreaId    = new SelectList(_sysAreaService.GetAllEnt(), "Id", "AreaDisplayName", item.SysAreaId);
            ViewBag.SysActionsId = new MultiSelectList(_sysActionService.GetAllEnt(), "Id", "ActionDisplayName",
                                                       item.SysControllerSysActions != null
                                                           ? item.SysControllerSysActions.Where(a => !a.Deleted).Select(a => a.SysActionId) : null);
            return(View(item));
        }
Exemple #2
0
        //
        // GET: /Platform/SysAction/

        public ActionResult Index(string keyword, string ordering, int pageIndex = 1)
        {
            var model =
                _sysActionService.GetAllEnt()
                .Select(
                    a =>
                    new { a.ActionDisplayName, a.ActionName, a.SystemId, a.CreatedDate, a.Remark, a.Id }).Search(keyword);

            if (!string.IsNullOrEmpty(ordering))
            {
                model = model.OrderBy(ordering, null);
            }

            if (!string.IsNullOrEmpty(Request["report"]))
            {
                //导出
                var reportModel = new Report(model.ToReportSource());
                return(new ReportResult(reportModel));
            }

            return(View(model.ToPagedList(pageIndex)));
        }