特种设备修改,车辆管理人员管理合并,考试接口创建试卷和答题使用redis

This commit is contained in:
2024-04-02 14:28:52 +08:00
parent 1b96387adc
commit d87b2d5be9
49 changed files with 4175 additions and 179 deletions
+42 -7
View File
@@ -20,13 +20,17 @@ namespace BLL
var list = (from x in Funs.DB.Sys_Menu where x.SuperMenu == superMenu orderby x.SortIndex select x).ToList();
return list;
}
public static Model.Sys_Menu GetSys_MenuById(string MenuId)
/// <summary>
/// 根据MenuId获取菜单名称项
/// </summary>
/// <param name="menuId"></param>
/// <returns></returns>
public static Model.Sys_Menu GetSupMenuBySuperMenu(string superMenu)
{
return Funs.DB.Sys_Menu.FirstOrDefault(e => e.MenuId == MenuId);
}
/// <summary>
/// 根据MenuId获取菜单名称项
/// </summary>
/// <param name="menuId"></param>
/// <returns></returns>
public static Model.Sys_Menu GetSupMenuBySuperMenu(string superMenu)
{
return Funs.DB.Sys_Menu.FirstOrDefault(x => x.SuperMenu == superMenu);
}
@@ -91,6 +95,37 @@ namespace BLL
}
return lists;
}
}
public static void UpdateSys_Menu(Model.Sys_Menu newtable)
{
Model.Sys_Menu table = Funs.DB.Sys_Menu.FirstOrDefault(e => e.MenuId == newtable.MenuId);
if (table != null)
{
table.MenuId = newtable.MenuId;
table.IsUsed = newtable.IsUsed;
table.MenuName = newtable.MenuName;
table.Icon = newtable.Icon;
table.Url = newtable.Url;
table.SortIndex = newtable.SortIndex;
table.SuperMenu = newtable.SuperMenu;
table.MenuType = newtable.MenuType;
table.IsOffice = newtable.IsOffice;
table.IsEnd = newtable.IsEnd;
Funs.DB.SubmitChanges();
}
}
public static void SetAllIsUsed(string MenuType)
{
var q = from x in Funs.DB.Sys_Menu
where x.MenuType == MenuType
select x;
foreach (var p in q)
{
p.IsUsed = false;
}
db.SubmitChanges();
}
}
}