public UserDetailsController(IUserDetails UserDetails, ICompanyDetails CompanyDetails, IRole Role, IUserAuthentication UserAuthentication) { _IUserDetails = UserDetails; _ICompanyDetails = CompanyDetails; _IRole = Role; _IUserAuthentication = UserAuthentication; }
public LoginController(IConfiguration config, IUserDetails userDetailsRepo, ILoginService loginService, IDistributedCache distributedCache) { _config = config; _userDetailsRepo = userDetailsRepo; _loginService = loginService; _distributedCache = distributedCache; }
public async Task <IUserDetails> UpdateDetails(IUserDetails userDetails) { try { if (userDetails == null || userDetails.UserName == null) { throw new ArgumentNullException(nameof(userDetails)); } using var cnn = _createdDbConnection(); cnn.Open(); string query = $"UPDATE UserDetails SET {_getSqlUpdateFields(typeof(UserDetails))}" .Replace("UserName=@UserName,", ""); query += " WHERE UserName=@UserName"; if (await cnn.ExecuteAsync(query, userDetails.Encrypt(_encryptionKey)) != 1) { throw new Exception($"ExecuteAsync failed: {query}"); } return(userDetails); } catch (Exception ex) { _log?.WriteError(nameof(UserRepository), nameof(UpdateDetails), userDetails.UserName, null, ex); throw; } }
public static void OnLoad1Step( IUserDetails form, EventArgs args) { IUser user = form.CurrentEntity as IUser; form.lblLicenseCount.Text = MySlx.Security.GetLicenseInfoMsg(user.Type); bool isEnabled = EnableUI(user); form.UserName.Enabled = isEnabled; form.lbxUserType.Enabled = isEnabled; form.chkLoginActive.Enabled = isEnabled; form.cbxIsUserManager.Enabled = isEnabled; form.slxUserManager.Enabled = isEnabled; form.pnName.Enabled = isEnabled; form.pklDivision.Enabled = isEnabled; form.pklREegion.Enabled = isEnabled; form.btnChangePassword.Enabled = EnablePassword(user); if(user.Type == UserType.AddOn) { form.cbxIsUserManager.Enabled = false; } if(user.Type == UserType.Template) { form.lbxUserType.Enabled = false; form.chkLoginActive.Enabled = false; form.QFSLXEmail.Enabled = false; form.pklUserTitle.Enabled = false; form.btnChangePassword.Enabled = false; form.cbxIsUserManager.Enabled = false; } if(user.Type == UserType.WebViewer) { form.cbxIsUserManager.Enabled = false; } }
private void SetupUser(IUserDetails userDetailsProvider) { var userDetailParameters = new List<string>() { "Username", "Password", "Email Address", "Local Repository Path", "Remote Repository URL" }; var userDetailList = new List<string>(); foreach (var userDetail in userDetailParameters) { Console.WriteLine(string.Format("Enter {0}:", userDetail)); userDetailList.Add(Console.ReadLine()); } userDetailsProvider.SetUsername(userDetailList[0]); userDetailsProvider.SetPassword(userDetailList[1]); userDetailsProvider.SetEmailAddress(userDetailList[2]); userDetailsProvider.SetRepoPath(userDetailList[3]); userDetailsProvider.SetRepoURL(userDetailList[4]); }
public bool Validate(IUserDetails IUserDetailsObj) { // EstimatorDbContext db = new EstimatorDbContext(); string cs = ConfigurationManager.ConnectionStrings["EstimatorDbContext"].ConnectionString; // UserDetail userDetails = new UserDetail(); using (SqlConnection cn = new SqlConnection(cs)) { SqlCommand cmd = cn.CreateCommand(); cmd.CommandText = "EXECUTE sp_ValidateUser @UserName, @UserPassword"; cmd.Parameters.Add("@UserName", SqlDbType.NVarChar, 200).Value = IUserDetailsObj.UserName; cmd.Parameters.Add("@UserPassword", SqlDbType.NVarChar, 200).Value = IUserDetailsObj.UserPassword; cmd.CommandType = System.Data.CommandType.StoredProcedure; cn.Open(); SqlDataReader dr = cmd.ExecuteReader(); if (dr.Read()) { //IUserDetailsObj.UserId return(true); } else { return(false); } } }
public Task <ImageSource> DownloadImageFor(IUserDetails user, CancellationToken cancellationToken = default) { ImageSource imageSource = new BitmapImage(); imageSource.Freeze(); if (user is null) { return(Task.FromResult(imageSource)); } var uri = user.ProfileUrl; var imageFile = GetImageFileFor(user); return(_downloadClient.GetStreamAsync(uri).ContinueWith(task => { if (File.Exists(imageFile)) { File.Delete(imageFile); } Image.FromStream(task.Result).GetThumbnailImage(200, 191, null, IntPtr.Zero).Save(imageFile, ImageFormat.Jpeg); return GetImageFor(user); }, cancellationToken)); }
public static void CopyUserDetails (IUserDetails source, IUserDetails destination) { destination.FirstName = source.FirstName; destination.LastName = source.LastName; destination.EmailAddress = source.EmailAddress; destination.TelephoneNumber = source.TelephoneNumber; destination.UserID = source.UserID; destination.CompanyName = source.CompanyName; }
public ProfileViewModel() { _userDetails = new UserDetailsRepository(); EditProfileCommand = new Command(OnEditProfileClicked); SaveProfileCommand = new Command(OnSaveClicked); VisibilityStart(); DisplayUser(); }
public CarpoolService( ICarpoolDetails carpoolDetails, IAddressDetails addressDetails, ICampusDetails campusDetails, IUserDetails userDetails) { _carpoolDetails = carpoolDetails; _addressDetails = addressDetails; _campusDetails = campusDetails; _userDetails = userDetails; }
public bool Save(IUserDetails entity) { var toReturn = new List<long>(); if (entity.ID == 0) { entity.ID = TestBluevoltPOCDB.NextID; toReturn.Add(entity.ID); } else { toReturn.Add(entity.ID); TestBluevoltPOCDB.UserDetails.Remove(TestBluevoltPOCDB.UserDetails.First(br => br.ID == entity.ID)); } TestBluevoltPOCDB.UserDetails.Add(entity); return true; ; }
internal static IUserDetails Encrypt(this IUserDetails src, string encryptionKey) { var decrypted = new UserDetails { UserName = src.UserName, Address = EncryptField(src.Address, encryptionKey), City = EncryptField(src.City, encryptionKey), Country = EncryptField(src.Country, encryptionKey), Email = EncryptField(src.Email, encryptionKey), FirstName = EncryptField(src.FirstName, encryptionKey), LastName = EncryptField(src.LastName, encryptionKey), PostalCode = EncryptField(src.PostalCode, encryptionKey) }; return(decrypted); }
public static void OnLoad1Step(IUserDetails form, EventArgs args) { IUser user = form.CurrentEntity as IUser; form.lblLicenseCount.Text = MySlx.Security.GetLicenseInfoMsg(user.Type); bool isEnabled = EnableUI(user); form.UserName.Enabled = isEnabled; form.lbxUserType.Enabled = isEnabled; form.chkLoginActive.Enabled = isEnabled; form.cbxIsUserManager.Enabled = isEnabled; form.slxUserManager.Enabled = isEnabled; form.pnName.Enabled = isEnabled; form.pklDivision.Enabled = isEnabled; form.pklREegion.Enabled = isEnabled; form.btnChangePassword.Enabled = EnablePassword(user); if (user.Type == UserType.AddOn) { form.cbxIsUserManager.Enabled = false; } if (user.Type == UserType.Template) { form.lbxUserType.Enabled = false; form.chkLoginActive.Enabled = false; form.QFSLXEmail.Enabled = false; form.pklUserTitle.Enabled = false; form.btnChangePassword.Enabled = false; form.cbxIsUserManager.Enabled = false; } if (user.Type == UserType.WebViewer) { form.cbxIsUserManager.Enabled = false; } if (user.Id.ToString().TrimEnd() != "ADMIN") { if (form.lbxUserType.Items.Count == 9) { // removes the Administrator type form.lbxUserType.Items.RemoveAt(8); } } }
public static void OnLoad1Step( IUserDetails form, EventArgs args) { IUser user = form.CurrentEntity as IUser; form.lblLicenseCount.Text = MySlx.Security.GetLicenseInfoMsg(user.Type); bool isEnabled = EnableUI(user); form.UserName.Enabled = isEnabled; form.lbxUserType.Enabled = isEnabled; form.chkLoginActive.Enabled = isEnabled; form.cbxIsUserManager.Enabled = isEnabled; form.slxUserManager.Enabled = isEnabled; form.pnName.Enabled = isEnabled; form.pklDivision.Enabled = isEnabled; form.pklREegion.Enabled = isEnabled; form.btnChangePassword.Enabled = EnablePassword(user); if(user.Type == UserType.AddOn) { form.cbxIsUserManager.Enabled = false; } if(user.Type == UserType.Template) { form.lbxUserType.Enabled = false; form.chkLoginActive.Enabled = false; form.QFSLXEmail.Enabled = false; form.pklUserTitle.Enabled = false; form.btnChangePassword.Enabled = false; form.cbxIsUserManager.Enabled = false; } if(user.Type == UserType.WebViewer) { form.cbxIsUserManager.Enabled = false; } if(user.Id.ToString().TrimEnd() != "ADMIN") { if (form.lbxUserType.Items.Count == 9) { // removes the Administrator type form.lbxUserType.Items.RemoveAt(8); } } }
public void Initialize() { _mockProductRepository = new Mock <IProductRepository>(); // _product= new Product _productService = new ProductInventory(_mockProductRepository.Object); _orderService = new OrderService(); _paymentGateway = new UserPaymentDetails(); var products = new List <Product> { new Product { ProductId = "100", ProductName = "Product_1", Price = 100m, Quantity = 10 }, new Product { ProductId = "101", ProductName = "Product_2", Price = 10m, Quantity = 20 }, new Product { ProductId = "102", ProductName = "Product_3", Price = 101m, Quantity = 15 }, new Product { ProductId = "103", ProductName = "Product_4", Price = 103m, Quantity = 10 }, new Product { ProductId = "104", ProductName = "Product_5", Price = 120m, Quantity = 20 }, new Product { ProductId = "105", ProductName = "Product_6", Price = 13m, Quantity = 10 }, }; _mockProductRepository.Setup(mock => mock.GetAllProducts()).Returns(products); //_mockProductRepository.Setup(mock=>mock.) //_mockEmployeeRepository.Setup(mock => mock.GetById(5)) // .Returns(employees.FirstOrDefault(e => e.Id == 5)); }
public async Task Invoke(HttpContext httpContext, IUserDetails userDetails, MilkServiceContext context) { //Alternative method //var userDetails = httpContext.RequestServices.GetService<IUserDetails>(); if (httpContext.Request.Headers.TryGetValue("Token", out StringValues stoken)) { var token = stoken.SingleOrDefault(); var userdetails = (from u in context.User join session in context.UserSession on u.Id equals session.UserId where session.Token.Equals(token) select new UserDetails { Id = u.Id, FirstName = u.FirstName, LastName = u.LastName, Email = u.Email, MobileNo = u.MobileNo, Address = u.Address, UserRole = u.UserRole, PINCode = u.Pincode, }).FirstOrDefault(); if (userdetails != null) { //userDetails = iMapper.Map<User, UserDetails>(user); userDetails.Id = userdetails.Id; userDetails.FirstName = userdetails.FirstName; userDetails.LastName = userdetails.LastName; userDetails.Email = userdetails.Email; userDetails.MobileNo = userdetails.MobileNo; userDetails.Address = userdetails.Address; userDetails.UserRole = userdetails.UserRole; userDetails.PINCode = userdetails.PINCode; } } await _next.Invoke(httpContext); }
public UserManagementService(IUserDetails userDetails, IHashingService hashingService) { this.userDetails = userDetails; this.hashingService = hashingService; }
public void BindUserDetails(IUserDetails user) { UserDetails = user; UserDetailsAlt = user as UserDetail; }
public UserDetailsPresenter(IUserDetails view, INavigationWorkflow navigation) { this._view = view; this._navigation = navigation; }
public UserController(IUserDetails userDetails) { ud = userDetails; }
private void CopyUserDetailsInfo(IUserDetails source, UserDetail userDetails) { UserDetailsHelper.CopyUserDetails(source, userDetails); userDetails.AccountType = AccountType.StandardAccount; userDetails.AccountNumber = txtAccountNumber.Text; userDetails.CompanyName = txtCompanyName.Text; }
private string GetImageFileFor(IUserDetails user) { return(Path.Combine(_userImagesDir, $"photo-{user.Id}.jpg")); }
public ClaimRequirementFilter(UserRoles role, IUserDetails userDetails, IUserRepository userRepository) { _role = role; _userDetails = userDetails; _userRepository = userRepository; }
public void BindUserDetails(IUserDetails user) { if (user != null) { UserDetailsHelper.CopyUserDetails(user, this); } else { ClearControls(); } }
public UserController(IUserService userService, IMapper mapper, IUserDetails userDetails) { _userService = userService; _mapper = mapper; _userDetails = userDetails; }
public static bool IsEmptyObject(this IUserDetails model) { return(model.Id == 0); }
public static bool IsObjectNull(this IUserDetails model) { return(model == null); }
public HomeController(IOptions <ApplicationSettings> options, IUserDetails userDetails) { _userDetails = userDetails; _options = options; }
public bool Save(IUserDetails userDetails) { return new UserDetailsDao().Save(userDetails); }
public UserDetailsController(IUserDetails userService) { iuserService = userService; }
public bool Save(IUserDetails userDetails) { return _dummyDao.Save(userDetails); }
public AccountController(IUserAuthentication userAuthentication, IUserDetails UserDetails, ICommon iCommon) { _IUserAuthentication = userAuthentication; _IUserDetails = UserDetails; _ICommon = iCommon; }
public UserController() { ud = new UserDetails(); }
public static void btnSave_OnClickStep( IUserDetails form, EventArgs args) { IUser user = form.CurrentEntity as IUser; user.Save(); }
public CreateAccountViewModel() { _userDetails = new UserDetailsRepository(); ConfirmNewAccountCommand = new Command(OnCreateConfirmClicked); }
public UserMasterController(IRole role, IUserAuthentication userAuthentication, IUserDetails userAuth) { _IRole = role; _IUserAuthentication = userAuthentication; _IUserDetails = userAuth; }
public void BindUserDetails(User user) { UserDetails = new UserDecorator(user); UserDetailsAlt = null; }
public bool Save(IUserDetails entities) { throw new System.NotImplementedException(); }
public void Save(IUserDetails user) { _commonDao.SaveOrUpdateObject(user); }
public bool Remove(IUserDetails entity) { _dbobj.SpDeleteUser(entity.ID); return true; }
public bool Remove(IUserDetails userDetails) { return new UserDetailsDao().Remove(userDetails); }
public bool Save(IUserDetails entity) { _dbobj.SpAddUpdateUsers(entity.ID,entity.UserName,entity.Password,entity.FirstName,entity.LastName,entity.Gender,entity.Phone,entity.Email,entity.CreatedBy,entity.UpdatedBy); return true; }
public async Task <IActionResult> GetAllPhysiologicalSignals([FromQuery(Name = "fromDate")] DateTime fromDate) { string userId = HttpContext.User.Claims.Single(x => x.Type == "id").Value; string role = HttpContext.User.Claims.Single(x => x.Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/role").Value; if (role == Role.ParticipantRole) { IUserDetails requestingUser = await _coadaptService.Participant.GetParticipantByUserIdAsync(userId); return(fromDate == DateTime.MinValue ? Ok(await _coadaptService.PhysiologicalSignal.GetPhysiologicalSignalsByParticipantIdAsync(requestingUser.Id)) : Ok(await _coadaptService.PhysiologicalSignal.GetPhysiologicalSignalsAfterDateByParticipantIdAsync(fromDate, requestingUser.Id))); } if (role == Role.AdministratorRole) { return(fromDate == DateTime.MinValue ? Ok(await _coadaptService.PhysiologicalSignal.GetPhysiologicalSignalsAsync()) : Ok(await _coadaptService.PhysiologicalSignal.GetPhysiologicalSignalsAfterDateAsync(fromDate))); } var participants = await _coadaptService.Participant.GetAllParticipantsAsync(); var filteredPhysiologicalSignals = new List <PhysiologicalSignal>(); foreach (var participant in participants) { if (role == Role.SubAdministratorRole) { if (!await ParticipantInOrganizationOfUserIdAsync(participant.Id, userId)) { continue; } if (fromDate == DateTime.MinValue) { filteredPhysiologicalSignals.AddRange(await _coadaptService.PhysiologicalSignal.GetPhysiologicalSignalsByParticipantIdAsync(participant.Id)); } else { filteredPhysiologicalSignals.AddRange(await _coadaptService.PhysiologicalSignal.GetPhysiologicalSignalsAfterDateByParticipantIdAsync(fromDate, participant.Id)); } } else if (role == Role.SupervisorRole) { if (!await ParticipantInStudiesOfUserIdAsync(participant.Id, userId)) { continue; } if (fromDate == DateTime.MinValue) { filteredPhysiologicalSignals.AddRange(await _coadaptService.PhysiologicalSignal.GetPhysiologicalSignalsByParticipantIdAsync(participant.Id)); } else { filteredPhysiologicalSignals.AddRange(await _coadaptService.PhysiologicalSignal.GetPhysiologicalSignalsAfterDateByParticipantIdAsync(fromDate, participant.Id)); } } else if (role == Role.TherapistRole) { if (!await ParticipantMonitoredByTherapistOfUserIdAsync(participant, userId)) { continue; } if (fromDate == DateTime.MinValue) { filteredPhysiologicalSignals.AddRange(await _coadaptService.PhysiologicalSignal.GetPhysiologicalSignalsByParticipantIdAsync(participant.Id)); } else { filteredPhysiologicalSignals.AddRange(await _coadaptService.PhysiologicalSignal.GetPhysiologicalSignalsAfterDateByParticipantIdAsync(fromDate, participant.Id)); } } } return(Ok(filteredPhysiologicalSignals)); }
public UserDetailsService() { _IUserDetails = new UserDetailsProvider(); }
public UserController(IUserDetails userDetails, IMapper mapper) { _userDetails = userDetails; _mapper = mapper; }
public LoginViewModel() { NewAccountCommand = new Command(OnCreateClicked); LoginCommand = new Command(OnLoginClicked); _userDetails = new UserDetailsRepository(); }
public ImageSource GetImageFor(IUserDetails user) { var imageFile = GetImageFileFor(user); return(GetImageFrom(File.Exists(imageFile) ? imageFile : null, 191, 200)); }
public UserService(IUserDetails userDetails) => _userDetails = userDetails;
public bool Remove(IUserDetails entity) { throw new System.NotImplementedException(); }
public bool Remove(IUserDetails userDetails) { return _dummyDao.Remove(userDetails); }