2019-11-25 09:49:12 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
2019-12-17 13:01:59 +00:00
|
|
|
|
|
2019-11-25 09:49:12 +00:00
|
|
|
|
using ASC.Core.Users;
|
2019-12-17 13:01:59 +00:00
|
|
|
|
|
2019-12-03 15:20:21 +00:00
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
2019-11-25 09:49:12 +00:00
|
|
|
|
|
|
|
|
|
namespace ASC.Core.Common.EF
|
|
|
|
|
{
|
|
|
|
|
[Table("core_user")]
|
2019-12-17 13:01:59 +00:00
|
|
|
|
public class User : BaseEntity
|
2019-11-25 09:49:12 +00:00
|
|
|
|
{
|
|
|
|
|
public int Tenant { get; set; }
|
|
|
|
|
|
|
|
|
|
public string UserName { get; set; }
|
|
|
|
|
|
|
|
|
|
public string FirstName { get; set; }
|
|
|
|
|
|
|
|
|
|
public string LastName { get; set; }
|
|
|
|
|
|
|
|
|
|
public Guid Id { get; set; }
|
|
|
|
|
|
|
|
|
|
public bool? Sex { get; set; }
|
|
|
|
|
|
|
|
|
|
[Column("bithdate")]
|
|
|
|
|
public DateTime? Birthdate { get; set; }
|
|
|
|
|
|
|
|
|
|
public EmployeeStatus Status { get; set; }
|
|
|
|
|
|
|
|
|
|
[Column("activation_status")]
|
|
|
|
|
public EmployeeActivationStatus ActivationStatus { get; set; }
|
|
|
|
|
public string Email { get; set; }
|
|
|
|
|
|
|
|
|
|
public DateTime? WorkFromDate { get; set; }
|
|
|
|
|
|
|
|
|
|
public DateTime? TerminatedDate { get; set; }
|
|
|
|
|
|
|
|
|
|
public string Title { get; set; }
|
|
|
|
|
|
|
|
|
|
public string Culture { get; set; }
|
|
|
|
|
|
|
|
|
|
public string Contacts { get; set; }
|
|
|
|
|
|
|
|
|
|
public string Phone { get; set; }
|
|
|
|
|
|
|
|
|
|
[Column("phone_activation")]
|
|
|
|
|
public MobilePhoneActivationStatus PhoneActivation { get; set; }
|
|
|
|
|
|
|
|
|
|
public string Location { get; set; }
|
|
|
|
|
|
|
|
|
|
public string Notes { get; set; }
|
|
|
|
|
|
|
|
|
|
public string Sid { get; set; }
|
|
|
|
|
|
|
|
|
|
[Column("sso_name_id")]
|
|
|
|
|
public string SsoNameId { get; set; }
|
|
|
|
|
|
|
|
|
|
[Column("sso_session_id")]
|
|
|
|
|
public string SsoSessionId { get; set; }
|
|
|
|
|
|
|
|
|
|
public bool Removed { get; set; }
|
|
|
|
|
|
|
|
|
|
[Column("create_on")]
|
|
|
|
|
public DateTime CreateOn { get; set; }
|
|
|
|
|
|
|
|
|
|
[Column("last_modified")]
|
|
|
|
|
public DateTime LastModified { get; set; }
|
|
|
|
|
|
|
|
|
|
public UserSecurity UserSecurity { get; set; }
|
|
|
|
|
|
|
|
|
|
public List<UserGroup> Groups { get; set; }
|
2019-12-17 13:01:59 +00:00
|
|
|
|
|
2020-02-21 12:38:04 +00:00
|
|
|
|
public override object[] GetKeys()
|
2019-12-17 13:01:59 +00:00
|
|
|
|
{
|
|
|
|
|
return new object[] { Id };
|
|
|
|
|
}
|
2019-11-25 09:49:12 +00:00
|
|
|
|
}
|
2019-12-03 15:20:21 +00:00
|
|
|
|
|
|
|
|
|
public static class DbUserExtension
|
|
|
|
|
{
|
|
|
|
|
public static void AddUser(this ModelBuilder modelBuilder)
|
|
|
|
|
{
|
|
|
|
|
modelBuilder.AddUserGroup();
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-11-25 09:49:12 +00:00
|
|
|
|
}
|