/// <summary> /// 根据部门获取该部门所关联的WBS定义信息 /// </summary> /// <param name="wbsType">wbs节点类别</param> /// <param name="DeptID">部门ID</param> /// <returns>返回S_D_WBSAttrDefine集合</returns> public static List <S_D_WBSAttrDefine> GetWBSAttrFromDept(WBSNodeType wbsType, string DeptID) { var entities = FormulaHelper.GetEntities <BaseConfigEntities>(); var result = entities.S_D_WBSAttrDeptInfo.Where(d => d.DeptID == DeptID). Select(d => d.S_D_WBSAttrDefine).Where(d => d.Type == wbsType.ToString()); return(result.ToList()); }
/// <summary> /// 验证WBS结构下是否可增加子节点 /// </summary> /// <param name="childWBSType">子节点类型</param> /// <returns>boolean值</returns> public bool ValidateChildren(WBSNodeType childWBSType) { var childCode = this.ChildCode.Split(',').FirstOrDefault(s => s == childWBSType.ToString()); if (String.IsNullOrEmpty(childCode)) { return(false); } else { return(true); } }
/// <summary> /// 增加WBS结构对象 /// </summary> /// <param name="nodeType">WBS节点类别</param> public void AddWBSSturct(WBSNodeType nodeType) { string wbsNodeType = nodeType.ToString(); if (this.S_T_WBSStructInfo.FirstOrDefault(d => d.Code == wbsNodeType) != null) { return; } var structInfo = new S_T_WBSStructInfo(); structInfo.ID = FormulaHelper.CreateGuid(); structInfo.Code = wbsNodeType; structInfo.Name = EnumBaseHelper.GetEnumDescription(typeof(WBSNodeType), wbsNodeType); this.S_T_WBSStructInfo.Add(structInfo); }
/// <summary> /// 根据WBS类型来获取WBS属性定义对象列表(无缓存,实时数据附带关联的部门信息) /// </summary> /// <param name="wbsType">WBS类型枚举</param> /// <returns>WBS属性集合</returns> public static List <S_D_WBSAttrDefine> GetWBSAttrList(WBSNodeType wbsType) { return(GetWBSAttrList(wbsType.ToString())); }
/// <summary> /// 根据WBS类型来获取WBS属性定义,并转换成枚举 /// </summary> /// <param name="wbsType">WBS类型枚举</param> /// <returns>含有text,value 列的枚举DataTable</returns> public static DataTable GetWBSEnum(WBSNodeType wbsType) { return(GetWBSEnum(wbsType.ToString())); }