public ActionResult Edit(int id) { var model = Moduls.ModulInfoToVModel(Moduls.GetModulInfo(id)); if (model.PId != 0) { model.PName = Moduls.GetModulInfo(model.PId).ModulName; } return(View(model)); }
public ActionResult Index(int?page) { int pageIndex = page.HasValue ? page.Value : 1; int pageSize = PageConfig.BackstagePageSize; int count, pageCount; var result = Moduls.ModulInfosToVModels(Moduls.GetModulPageList(pageIndex, pageSize, null, null, out pageCount, out count)); result.ForEach(n => { if (n.PId != 0) { var modulinfo = Moduls.GetModulInfo(n.PId); if (modulinfo != null) { n.PName = modulinfo.ModulName; } } }); PagedList <ModulVModel> pl = result.ToPagedList(pageIndex, pageSize); pl.TotalItemCount = count; pl.CurrentPageIndex = pageIndex; return(View(pl)); }
public ActionResult Edit(int id) { var model = Moduls.ModulInfoToVModel(Moduls.GetModulInfo(id)); return(View(model)); }