/// <summary> /// 保存权限更新检查实体数据到本地数据库 /// </summary> /// <param name="entPermissionUpdateState"></param> private static void SavePermCheckByLocal(V_PermissionUpdateState entPermissionUpdateState) { V_PermissionCheck entPermissionCheck = new V_PermissionCheck(); entPermissionCheck.EmployeeID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID; foreach (var item in entPermissionUpdateState.Timer) { DateTime dtPermDate = new DateTime(); switch (item.Key.ToUpper()) { case "T_SYS_USERROLE": entPermissionCheck.UserRoleDate = dtPermDate; if (item.Value != null) { entPermissionCheck.UserRoleDate = item.Value.Value; } break; case "T_SYS_ROLEENTITYMENU": entPermissionCheck.UserRoleDate = dtPermDate; if (item.Value != null) { entPermissionCheck.RoleEntityMenuDate = item.Value.Value; } break; case "T_SYS_ROLEMENUPERMISSION": entPermissionCheck.UserRoleDate = dtPermDate; if (item.Value != null) { entPermissionCheck.RoleMenuPermissionDate = item.Value.Value; } break; case "T_SYS_ENTITYMENUCUSTOMPERM": entPermissionCheck.UserRoleDate = dtPermDate; if (item.Value != null) { entPermissionCheck.EntityMenuCustompermDate = item.Value.Value; } break; } } V_PermissionCheckVM.SaveV_PermissionCheck(SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID, entPermissionCheck); SMT.SAAS.Main.CurrentContext.AppContext.IsPermUpdate = true; }
/// <summary> /// 检查是否需要更新本地权限更新检查实体数据 /// </summary> /// <param name="strEmployeeID">员工ID</param> /// <param name="entPermissionUpdateState">权限检查实体(本地存储)</param> private void GetPermCheckByLocal(string strEmployeeID, V_PermissionUpdateState entPermissionUpdateState) { V_PermissionCheck vLocalPermissionCheck = V_PermissionCheckVM.Get_V_PermissionCheck(strEmployeeID); bool bIsUpdate = false; foreach (var item in entPermissionUpdateState.Timer) { switch (item.Key.ToUpper()) { case "T_SYS_USERROLE": if (item.Value != null) { if (vLocalPermissionCheck.UserRoleDate != item.Value.Value) { vLocalPermissionCheck.UserRoleDate = item.Value.Value; bIsUpdate = true; } } break; case "T_SYS_ROLEENTITYMENU": if (item.Value != null) { if (vLocalPermissionCheck.RoleEntityMenuDate != item.Value.Value) { vLocalPermissionCheck.RoleEntityMenuDate = item.Value.Value; bIsUpdate = true; } } break; case "T_SYS_ROLEMENUPERMISSION": if (item.Value != null) { if (vLocalPermissionCheck.RoleMenuPermissionDate != item.Value.Value) { vLocalPermissionCheck.RoleMenuPermissionDate = item.Value.Value; bIsUpdate = true; } } break; case "T_SYS_ENTITYMENUCUSTOMPERM": if (item.Value != null) { if (vLocalPermissionCheck.EntityMenuCustompermDate != item.Value.Value) { vLocalPermissionCheck.EntityMenuCustompermDate = item.Value.Value; bIsUpdate = true; } } break; } } SMT.SAAS.Main.CurrentContext.AppContext.IsPermUpdate = bIsUpdate; if (bIsUpdate) { V_PermissionCheckVM.SaveV_PermissionCheck(SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID, vLocalPermissionCheck); } }