public SYSTEM_USER_ROLE GetUserRole() { var userRole = new SYSTEM_USER_ROLE() { DateFrom = this.DATE_FROM, DateTo = this.DATE_TO }; return(userRole); }
public bool AddUserToRole(string userId, SelectRoleEditorViewModel roleName) { //var idResult = _userManager.AddToRole(userId, roleName.RoleName); //add new role var userRole = new SYSTEM_USER_ROLE { UserId = userId, RoleId = _roleManager.FindByName(roleName.RoleName).Id, DateFrom = roleName.DATE_FROM, DateTo = roleName.DATE_TO }; _db.SYSTEM_USER_ROLEs.Add(userRole); _db.SaveChanges(); return(true); }
public SelectRoleEditorViewModel(SYSTEM_USER_ROLE role) { this.RoleName = role.Role.Name; this.DATE_FROM = role.DateFrom; this.DATE_TO = role.DateTo; }