/// <summary> ///左侧导航栏 /// </summary> /// <returns></returns> public ActionResult Left() { SysResourceManager bll = new SysResourceManager(); var list = bll.QueryLeft(); return(PartialView(list)); }
public ActionResult Add(SysResource info) { SysResourceManager bll = new SysResourceManager(); Completion db = new Completion(); SysResource inf = db.SysResource.ToList().OrderBy(x => x.CreateTime).LastOrDefault(); int ResNum = Convert.ToInt32(inf.ResNum) + 1; string code = ResNum.ToString(); SysResource info1 = new SysResource { ResNum = code, ResName = info.ResName, Url = info.Url, IsDelete = 0, CreateTime = DateTime.Now, UpdateTime = DateTime.Now, Remark = info.Remark }; var ss = bll.Add(info1); if (ss) { return(Json(ss, JsonRequestBehavior.DenyGet)); } return(Json(info, JsonRequestBehavior.DenyGet)); }
/// <summary> /// 穿梭框 /// </summary> /// <returns></returns> public ActionResult Show(SysResource ss) { string RoleNum = "SA_00000"; List <SysRelation> list = new SysRelationManager().Where(x => x.RoleNum == RoleNum); List <SysResource> list1 = new SysResourceManager().Where(x => x.ResName == ss.ResName); foreach (var item in list) { list1.Remove(item.SysResource); } List <string> SysRelatiolist = new List <string>(); foreach (var item in list) { SysRelatiolist.Add(item.ResNum.ToString()); } var SysResourceList = list1.Select(x => new { value = x.ResNum, title = x.ResName }); var info = new { SysResource = SysResourceList, SysRelatio = SysRelatiolist }; return(Json("", JsonRequestBehavior.AllowGet)); }
public ActionResult UpdateSysResource(string id) { SysResourceManager bll = new SysResourceManager(); var ss = bll.GetByPK(id); return(PartialView(ss)); }
public ActionResult Add() { List <SysResource> list = new SysResourceManager().GetAll(); SysResource info = new SysResource() { ResNum = "0", ResName = "--请选择--" }; list.Insert(0, info); ViewBag.ResourceList = new SelectList(list, "ResNum", "ResName"); return(PartialView()); }
/// <summary> /// 表格查询 /// </summary> /// <returns></returns> public ActionResult QLeft(int page = 1, int limit = 10) { SysResourceManager bll = new SysResourceManager(); var list = bll.GetAll(); var list1 = list.Skip((page - 1) * limit).Take(limit).Select(x => new { x.ResName, }); var info = new { count = list.Count, code = 0, data = list1 }; return(Json(info, JsonRequestBehavior.AllowGet)); }