diff --git a/EMIEWebPortal.Controllers/Controllers/UserController.cs b/EMIEWebPortal.Controllers/Controllers/UserController.cs index 3df994f..23e60c7 100644 --- a/EMIEWebPortal.Controllers/Controllers/UserController.cs +++ b/EMIEWebPortal.Controllers/Controllers/UserController.cs @@ -645,7 +645,9 @@ private string InsertUser(UserMapping user) /// result of insert operation 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; @@ -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); @@ -988,4 +990,4 @@ public JsonResult ChangeEMIEAdminCredentials(string newpassword) #endregion } -} \ No newline at end of file +}