/// <summary> /// 删除栏目与菜单之间的关联关系 /// </summary> /// <param name="keyValue">菜单Id</param> /// <param name="ColumnId">栏目ID</param> /// <returns></returns> public ActionResult RemoveAssociation(string ModuleId, string ColumnId) { try { AppSettingAssociationBLL associationBLL = new AppSettingAssociationBLL(); AppSettingAssociationEntity association = associationBLL.GetEntity(ModuleId, ColumnId); //========因页面上的授权都改为了级联添加,删除也要做成级联删除===hm====// //1、先找查询出所有的菜单,然后递归找出所有的子级菜单 List <MenuConfigEntity> menuConfigEntities = new MenuConfigBLL().GetAllList(); List <MenuConfigEntity> childMenus = new List <MenuConfigEntity>(); childMenus.Add(menuConfigEntities.FirstOrDefault(p => p.ModuleId == ModuleId)); //当前项也要删除 MenuTreeHelper.FindAllChild(menuConfigEntities, childMenus, ModuleId); //找出所有的下级菜单 //====================END==============================// associationBLL.Remove(childMenus.Select(x => x.ModuleId).ToList(), ColumnId); //判断该菜单是不是安卓终端的,是的话就更新版本 var module = new MenuConfigBLL().GetEntity(ModuleId); if (module.PaltformType == 1) { MenuAuthorizeEntity menuAuthorize = authorizeBLL.GetEntityByDeptId(association.DeptId); if (menuAuthorize != null) { authorizeBLL.SaveForm(menuAuthorize.Id, menuAuthorize);//此处单纯的改变一下版本号 } } return(Success("操作成功。")); } catch (Exception ex) { return(Error("操作失败:" + ex.Message)); } }
/// <summary> /// 获取菜单关联配置信息 /// </summary> /// <param name="keyValue">菜单ID</param> /// <param name="columnId">栏目ID</param> /// <returns></returns> public ActionResult GetAssociationSettingFormJson(string keyValue, string columnId) { AppSettingAssociationBLL settingBLL = new AppSettingAssociationBLL(); AppSettingAssociationEntity entity = settingBLL.GetEntity(keyValue, columnId); //!! 这里的keyvalue是菜单Id return(Json(entity, JsonRequestBehavior.AllowGet)); }
public ActionResult EditAssociationFrom(string keyValue, string ColumnId, int platform) { AppSettingAssociationBLL associationBLL = new AppSettingAssociationBLL(); AppSettingAssociationEntity entity = associationBLL.GetEntity(keyValue, ColumnId); MenuConfigEntity menuConfig = new MenuConfigBLL().GetEntity(keyValue); ViewBag.ModuleName = menuConfig.ModuleName; if (menuConfig.ParentId == "0" || menuConfig.ParentId == "1" || menuConfig.ParentId == "2") { ViewBag.ParentName = entity.ColumnName; } else { ViewBag.ParentName = menuConfig.ParentName; } return(View(entity)); }