检查关联培训

This commit is contained in:
2026-11-19 16:31:11 +08:00
parent 461bca785b
commit 8490311e94
22 changed files with 442 additions and 132 deletions
@@ -1,4 +1,6 @@
using System.Collections.Generic;
using System;
using Model;
using System.Collections.Generic;
using System.Linq;
namespace BLL
@@ -117,5 +119,49 @@ namespace BLL
return lst;
}
#region BoundTree
/// <summary>
/// 加载培训教材
/// </summary>
/// <param name="myList"></param>
/// <param name="menuId"></param>
/// <param name="depth"></param>
public static void BoundTree(List<JQueryFeature> myList, string menuId, int depth)
{
var dt = GetNewTraining(menuId);
if (dt.Count() > 0)
{
foreach (var dr in dt)
{
myList.Add(new JQueryFeature(dr.CompanyTrainingId, dr.CompanyTrainingName, depth, false));
BoundTree(myList, dr.CompanyTrainingId, depth + 1);
}
}
else
{
var item = Funs.DB.Training_CompanyTrainingItem.Where(x => x.CompanyTrainingId == menuId).OrderBy(x => x.CompanyTrainingItemCode);
if (item.Count() > 0)
{
foreach (var dr in item)
{
myList.Add(new JQueryFeature(dr.CompanyTrainingItemId, dr.CompanyTrainingItemName, depth, true));
}
}
}
}
/// <summary>
/// 得到菜单方法
/// </summary>
/// <param name="parentId"></param>
/// <returns></returns>
public static List<Model.Training_CompanyTraining> GetNewTraining(string parentId)
{
return (from x in Funs.DB.Training_CompanyTraining where x.SupCompanyTrainingId == parentId orderby x.CompanyTrainingCode select x).ToList(); ;
}
#endregion
}
}