Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Update UserController.cs #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions EMIEWebPortal.Controllers/Controllers/UserController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,9 @@ private string InsertUser(UserMapping user)
/// <returns>result of insert operation</returns>
private int CreateNewUser(UserMapping user)
{
var logonId = user.User.Email.Split('@');
var logonId = User.Identity.Name;
var Index = logonId.Split('\\');
logonId = Index[1];

User newUser = new User();
newUser.UserName = user.User.UserName;
Expand All @@ -655,7 +657,7 @@ private int CreateNewUser(UserMapping user)
newUser.ModifiedById = user.User.CreatedById;
newUser.ModifiedDate = DateTime.Now;
newUser.IsActive = user.IsActive;
newUser.LoginId = logonId[0].ToString();
newUser.LoginId = logonId;

DbEntity.Users.Add(newUser);

Expand Down Expand Up @@ -988,4 +990,4 @@ public JsonResult ChangeEMIEAdminCredentials(string newpassword)

#endregion
}
}
}