0
我与我的HR数据库有类似的问题。MVC 4将应用程序用户配置文件与联系人表记录进行匹配
我正在使用Google ID登录 - UserProfile表为应用程序用户和Contact表存储所有员工。
因为用户也可以访问他们的记录(更新他们的个人详细信息)并且会提交假期请求,所以我需要将UserProfile.UserProfileID与Contact.ContactID进行匹配。
登录 - 当创建一个新的UserProfileID并且新建联系人(由HR部门)创建时也应该如此。
有什么建议吗?
贝娄是UserProfile和Contact的模型。 用户配置
public class UserProfileViewModel
{
[Key]
public int ID { get; set; }
[Display(Name = "User Name")]
public string UserName { get; set; }
[Display(Name = "First Name")]
public string FirstName { get; set; }
[Display(Name = "Last Name")]
public string LastName { get; set; }
[DisplayFormat(NullDisplayText = "", DataFormatString = "{0:dd/MM/yyyy hh:mm tt}")]
public DateTime? LastLogon { get; set; }
[Display(Name = "Roles")]
public string[] UserRoles { get; set; }
public string DisplayName { get; set; }
}
联系
public class Contact
{
public int ID { get; set; }
public int? TitleID { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public DateTime? DOB { get; set; }
public int? GenderID { get; set; }
public int? CategoryID { get; set; }
public int? SiteID { get; set; }
.... }
谢谢