public SystemDetailsModel UpdateSystemDetails(SystemDetailsModel model) { var entity = _unitOfWork.Repository <UserEntity>().Set .FirstOrDefault(x => x.Id == _authUser.Id); entity.FirstName = model.FirstName; entity.LastName = model.LastName; if (entity.Password != model.Password) { var salt = _cryptoContext.GenerateSaltAsBase64(); var password = Convert.ToBase64String(_cryptoContext.DeriveKey(model.Password, salt)); entity.Salt = salt; entity.Password = password; } _unitOfWork.Repository <UserEntity>().Update(entity); return(model); }
public void GetSystemDetails() { dataSystem = new SystemDetailsModel(); dataSystem.WINDOWS_VERSION = Environment.OSVersion.ToString(); dataSystem.MACHINE_NAME = Environment.MachineName.ToString(); dataSystem.DOTNET_RUNTIMES = GetDotNetVersions(); dataSystem.INTERNET_EXPLORER_VERSION = GetInternetExplorerVersion(); dataSystem.WINDOWS_CURRENT_USER = System.Security.Principal.WindowsIdentity.GetCurrent().Name; PrinterSettings settings = new PrinterSettings(); dataSystem.DEFAULT_PRINTER = settings.PrinterName; dataSystem.DEFAULT_BROWSER = GetDefaultBrowserName(); dataSystem.ADOBE_FLASH_VERSION = GetAdobeFlushPlayerVersion(); dataSystem.MICROSOFT_OFFICE_VERSION = GetOfficeVersion(); dataSystem.PDF_VIEWER = GetPDFViewerStatus(); SystemDetails = dataSystem; }
public IActionResult PutSystemDetails([FromBody] SystemDetailsModel model) { var response = _profileService.UpdateSystemDetails(model); return(Ok(response)); }