2026-02-24 20:44:16 +00:00
|
|
|
|
using System;
|
|
|
|
|
|
using Volo.Abp.Data;
|
|
|
|
|
|
using Volo.Abp.Identity;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Sozsoft.Platform.Extensions;
|
|
|
|
|
|
|
|
|
|
|
|
public static class AbpIdentityUserExtensions
|
|
|
|
|
|
{
|
|
|
|
|
|
public static string GetFullName(this IdentityUser user)
|
|
|
|
|
|
{
|
|
|
|
|
|
return $"{user.Name} {user.Surname}".Trim();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//IsVerified
|
|
|
|
|
|
public static void SetIsVerified(this IdentityUser user, bool isVerified)
|
|
|
|
|
|
{
|
|
|
|
|
|
user.SetProperty(PlatformConsts.AbpIdentity.User.IsVerified, isVerified);
|
|
|
|
|
|
}
|
|
|
|
|
|
public static bool GetIsVerified(this IdentityUser user)
|
|
|
|
|
|
{
|
|
|
|
|
|
return user.GetProperty<bool>(PlatformConsts.AbpIdentity.User.IsVerified);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//Login End Date
|
|
|
|
|
|
public static void SetLoginEndDate(this IdentityUser user, DateTime? value)
|
|
|
|
|
|
{
|
|
|
|
|
|
user.SetProperty(PlatformConsts.AbpIdentity.User.LoginEndDate, value);
|
|
|
|
|
|
}
|
|
|
|
|
|
public static DateTime? GetLoginEndDate(this IdentityUser user)
|
|
|
|
|
|
{
|
|
|
|
|
|
return user.GetProperty<DateTime?>(PlatformConsts.AbpIdentity.User.LoginEndDate);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//Rocket Username
|
|
|
|
|
|
public static void SetRocketUsername(this IdentityUser user, string rocketUsername)
|
|
|
|
|
|
{
|
|
|
|
|
|
user.SetProperty(PlatformConsts.AbpIdentity.User.RocketUsername, rocketUsername);
|
|
|
|
|
|
}
|
|
|
|
|
|
public static string GetRocketUsername(this IdentityUser user)
|
|
|
|
|
|
{
|
|
|
|
|
|
return user.GetProperty<string>(PlatformConsts.AbpIdentity.User.RocketUsername);
|
|
|
|
|
|
}
|
2026-04-26 19:05:19 +00:00
|
|
|
|
|
|
|
|
|
|
//Work Hour
|
|
|
|
|
|
public static void SetWorkHour(this IdentityUser user, string workHour)
|
|
|
|
|
|
{
|
|
|
|
|
|
user.SetProperty(PlatformConsts.AbpIdentity.User.WorkHour, workHour);
|
|
|
|
|
|
}
|
|
|
|
|
|
public static string GetWorkHour(this IdentityUser user)
|
|
|
|
|
|
{
|
|
|
|
|
|
return user.GetProperty<string>(PlatformConsts.AbpIdentity.User.WorkHour);
|
|
|
|
|
|
}
|
2026-05-04 12:14:16 +00:00
|
|
|
|
|
|
|
|
|
|
//DepartmentId
|
2026-05-04 14:35:18 +00:00
|
|
|
|
public static void SetDepartmentId(this IdentityUser user, Guid departmentId)
|
2026-05-04 12:14:16 +00:00
|
|
|
|
{
|
|
|
|
|
|
user.SetProperty(PlatformConsts.AbpIdentity.User.DepartmentId, departmentId);
|
|
|
|
|
|
}
|
2026-05-04 14:35:18 +00:00
|
|
|
|
public static Guid GetDepartmentId(this IdentityUser user)
|
2026-05-04 12:14:16 +00:00
|
|
|
|
{
|
2026-05-04 14:35:18 +00:00
|
|
|
|
return user.GetProperty<Guid>(PlatformConsts.AbpIdentity.User.DepartmentId);
|
2026-05-04 12:14:16 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//JobPositionId
|
2026-05-04 14:35:18 +00:00
|
|
|
|
public static void SetJobPositionId(this IdentityUser user, Guid jobPositionId)
|
2026-05-04 12:14:16 +00:00
|
|
|
|
{
|
|
|
|
|
|
user.SetProperty(PlatformConsts.AbpIdentity.User.JobPositionId, jobPositionId);
|
|
|
|
|
|
}
|
2026-05-04 14:35:18 +00:00
|
|
|
|
public static Guid GetJobPositionId(this IdentityUser user)
|
2026-05-04 12:14:16 +00:00
|
|
|
|
{
|
2026-05-04 14:35:18 +00:00
|
|
|
|
return user.GetProperty<Guid>(PlatformConsts.AbpIdentity.User.JobPositionId);
|
2026-05-04 12:14:16 +00:00
|
|
|
|
}
|
2026-02-24 20:44:16 +00:00
|
|
|
|
}
|
|
|
|
|
|
|