public PartialViewResult LeftMenu(int id, string viewName = "_LeftMenu") { List <ColoPay.Model.SysManage.SysNode> AllNodeList = sm.GetTreeListByTypeCache(4, true, MvcApplication.IsAutoConn); ColoPay.Model.SysManage.SysNode nodeModel = AllNodeList.FirstOrDefault(c => c.NodeID == id); ViewBag.NodeName = nodeModel == null ? "" : nodeModel.TreeText; List <ColoPay.Model.SysManage.SysNode> NodeList = AllNodeList.Where(c => c.ParentID == id).ToList(); return(PartialView(viewName, NodeList)); }
/// <summary> /// 得到一个对象实体 /// </summary> public ColoPay.Model.SysManage.SysNode DataRowToModel(DataRow row) { ColoPay.Model.SysManage.SysNode model = new ColoPay.Model.SysManage.SysNode(); if (row != null) { if (row["NodeID"] != null && row["NodeID"].ToString() != "") { model.NodeID = int.Parse(row["NodeID"].ToString()); } if (row["TreeText"] != null) { model.TreeText = row["TreeText"].ToString(); } if (row["ParentID"] != null && row["ParentID"].ToString() != "") { model.ParentID = int.Parse(row["ParentID"].ToString()); } if (row["ParentPath"] != null) { model.ParentPath = row["ParentPath"].ToString(); } if (row["Location"] != null) { model.Location = row["Location"].ToString(); } if (row["OrderID"] != null && row["OrderID"].ToString() != "") { model.OrderID = int.Parse(row["OrderID"].ToString()); } if (row["Comment"] != null) { model.Comment = row["Comment"].ToString(); } if (row["Url"] != null) { model.Url = row["Url"].ToString(); } if (row["PermissionID"] != null && row["PermissionID"].ToString() != "") { model.PermissionID = int.Parse(row["PermissionID"].ToString()); } if (row["ImageUrl"] != null) { model.ImageUrl = row["ImageUrl"].ToString(); } if (row["ModuleID"] != null && row["ModuleID"].ToString() != "") { model.ModuleID = int.Parse(row["ModuleID"].ToString()); } if (row["KeShiDM"] != null && row["KeShiDM"].ToString() != "") { model.KeShiDM = int.Parse(row["KeShiDM"].ToString()); } if (row["KeshiPublic"] != null) { model.KeshiPublic = row["KeshiPublic"].ToString(); } if (row["TreeType"] != null && row["TreeType"].ToString() != "") { model.TreeType = int.Parse(row["TreeType"].ToString()); } if (row["Enabled"] != null && row["Enabled"].ToString() != "") { if ((row["Enabled"].ToString() == "1") || (row["Enabled"].ToString().ToLower() == "true")) { model.Enabled = true; } else { model.Enabled = false; } } } return(model); }