public IActionResult Add(UserViewModelNPINotRequired pUser)
        {
            pUser.Type = ConstantsVar.Installer;
            User _user = lIUserRepository.getUser(pUser.UserId);
            //User _user2 = lIUserRepository.getUserNpi(pUser.Npi);
            User _userNew = UserExtension.UserViewModelToUserNPINotRequired(pUser);

            if ((_user == null))
            {
                _userNew.Phone = RemoveSpecialChars(_userNew.Phone);
                string _User = lIUserRepository.InsertUser(_userNew);
                if (_User == "Username already exists")
                {
                    TempData["Installer"] = JsonConvert.SerializeObject(_userNew);
                    TempData["msg"]       = "<script>Helpers.ShowMessage('User with same Installer Id is already registered, please use different one', 1);</script>";
                    pUser.UserId          = null;
                    return(View(pUser));
                }
            }
            else
            {
                if (_user.UserId == _userNew.UserId)
                {
                    TempData["Installer"] = JsonConvert.SerializeObject(_userNew);
                    TempData["msg"]       = "<script>Helpers.ShowMessage('User with same Installer Id is already registered, please use different one', 1);</script>";
                    pUser.UserId          = null;
                    return(View(pUser));
                }
            }
            return(RedirectToAction("Index"));
        }
        public IActionResult Profile(UserViewModelNPINotRequired pUser)
        {
            pUser.Type = ConstantsVar.Installer;
            if (pUser != null && !string.IsNullOrEmpty(pUser.UserId))
            {
                User luser = lIUserRepository.getUser(pUser.UserId);
                if (luser != null)
                {
                    {
                        User _user = UserExtension.UserViewModelToUserNPINotRequired(pUser);
                        _user.Phone = RemoveSpecialChars(_user.Phone);
                        string _result = lIUserRepository.UpdateUser(_user);
                    }
                }

                else
                {
                    User _user = UserExtension.UserViewModelToUserNPINotRequired(pUser);
                    _user.Phone = RemoveSpecialChars(_user.Phone);
                    string _result = lIUserRepository.UpdateUser(_user);
                }
            }

            //string _result = lIUserRepository.UpdateUser(_user);
            if (HttpContext.Session.GetString("UserType") != null && HttpContext.Session.GetString("UserType").ToString() == ConstantsVar.Installer.ToString())
            {
                return(RedirectToAction("Profile", new { id = pUser.UserId }));
            }
            return(RedirectToAction("Index"));
        }