public int RegisterProfile(RegisterDataContract registerData) { int profileId = 0; using (ProfileRepository profileRepo = new ProfileRepository(new ChatDBDataContext())) { List<tbl_ChatUserProfile> profiles = profileRepo.Get(); if (!ServiceUtils.IsExist<tbl_ChatUserProfile>(profiles, registerData.EmailAddress)) { tbl_ChatUserProfile profile = new tbl_ChatUserProfile { Address = registerData.Address, EmailAddess = registerData.EmailAddress, FullName = registerData.FullName, PhoneNumber = registerData.PhoneNumber }; profileRepo.Create(profile); profileRepo.Save(); profileId = profileRepo.Get(registerData.EmailAddress).id; } else throw new Exception("Profile Exists"); } return profileId; }
public void Send(string groupName, string message) { Clients.All.regroup(); var us = UserHandler.User.Where(x => x.GroupName == groupName); ProfileRepository rep = new ProfileRepository(); rep.SetDbName(groupName); int users = 0; try { users = rep.GetSingle(groupName).Modules.FirstOrDefault(x => x.CodModule == message).Users??0; } catch (Exception) { } if (us!=null && us.Count() > users && users !=0) { //estraggo i più vecchi e ciclo fino ad avere un numero di client var usToDisc = UserHandler.User.Where(x => x.GroupName == groupName).OrderBy(x=>x.TimeConnection).ToArray(); for (int i = 0; i < usToDisc.Count() - 2; i++) { Clients.Client(usToDisc[i].ConnectedIds).forceDisconnection(message); } } }
public ProfileRepository GetProfileRepository() { if (profileRepo == null) { profileRepo = new ProfileRepository(); } return profileRepo; }
public void Activate() { _profileRepository = new ProfileRepository(); _materialsRepository = new MaterialsRepository(); _servicesRepository = new ServicesRepository(); _serviceMaterialRepository = new ServiceMaterialsRepository(); _quotesRepository = new QuotesRepository(); _customersRepository = new CustomersRepository(); }
public static void BeforeMembershipScenarios() { var context = new ShopAnyWareSql(); var userRepository = new UserRepository(context); var roleRepository = new RoleRepository(context); var profileRepository = new ProfileRepository(context); var membershipRepository = new MembershipRepository(); var logger = new FakeLogger(); var emailService = new FakeEmailService(); ScenarioContext.Current.Set(emailService); var membershipService = new MembershipService(logger, emailService, userRepository, roleRepository, profileRepository, membershipRepository); ScenarioContext.Current.Set(membershipService); }
public Player(GameDeskView form, int posX, int posY) { this.form = form; round = 1; roundsNo = 0; /* gameDesk = new GameDesk(form, this); gameDesk.Location = new System.Drawing.Point(posX, posY); gameDesk.Name = "gameDesk"; gameDesk.Size = new System.Drawing.Size(396, 386); // not needed gameDesk.TabIndex = 0; gameDesk.Text = "gameDesk"; form.Controls.Add(gameDesk); */ //profile = new ProfileRepository(form, this); profile = ProfileRepository.Instance; }
public ContactManager(AddressRepository addressRepository, AddressTypeRepository addressTypeRepository, PhoneRepository phoneRepository, PhoneTypeRepository phoneTypeRepository, ProfileAddressRepository profileAddressRepository, ProfilePhoneRepository profilePhoneRepository, ProfileRepository profileRepository) { if (addressRepository == null) throw new ArgumentNullException("addressRepository"); if (addressTypeRepository == null) throw new ArgumentNullException("addressTypeRepository"); if (phoneRepository == null) throw new ArgumentNullException("phoneRepository"); if (phoneTypeRepository == null) throw new ArgumentNullException("phoneTypeRepository"); if (profileAddressRepository == null) throw new ArgumentNullException("profileAddressRepository"); if (profilePhoneRepository == null) throw new ArgumentNullException("profilePhoneRepository"); if (profileRepository == null) throw new ArgumentNullException("profileRepository"); _addressRepository = addressRepository; _addressTypeRepository = addressTypeRepository; _phoneRepository = phoneRepository; _phoneTypeRepository = phoneTypeRepository; _profileAddressRepository = profileAddressRepository; _profilePhoneRepository = profilePhoneRepository; _profileRepository = profileRepository; }
public IProfile CreateAccount(AccountUser usuario) { IProfile result = new Profile(); using (TransactionScope scope = new TransactionScope()) { usuario.Created = DateTime.Now; usuario.City = Security.ClearSQLInjection(usuario.City); usuario.Country = Security.ClearSQLInjection(usuario.Country); usuario.CustomId = Security.ClearSQLInjection(usuario.CustomId); usuario.Email = Security.ClearSQLInjection(usuario.Email); usuario.Name = Security.ClearSQLInjection(usuario.Name); usuario.Password = Security.ClearSQLInjection(usuario.Password); usuario.Picture = Security.ClearSQLInjection(usuario.Picture); usuario.Gender = Security.ClearSQLInjection(usuario.Gender); string emailcrypted = Security.Encrypt(usuario.Email); string passw = PasswordHash.CreateHash(usuario.Password); usuario.Email = emailcrypted; usuario.Password = passw; IUsuario iusuario = _repository.Add(usuario); ProfileRepository profile = new ProfileRepository(_dataBase); IProfile newProfile = new Profile(); newProfile.UserId = iusuario.UsuarioId; newProfile.Upadted = DateTime.Now; newProfile.Picture = Security.ClearSQLInjection(usuario.Picture); result = profile.Add(newProfile); scope.Complete(); } return result; }
/// <summary> /// Permanently delete the profile records associated with the specified <paramref name="gallery" />. /// </summary> /// <param name="gallery">The gallery.</param> /// <exception cref="ArgumentNullException">Thrown when <paramref name="gallery" /> is null.</exception> public static void DeleteProfileForGallery(Gallery gallery) { if (gallery == null) throw new ArgumentNullException("gallery"); using (var repo = new ProfileRepository()) { foreach (var pDto in repo.Where(p => p.FKGalleryId == gallery.GalleryId)) { repo.Delete(pDto); } repo.Save(); } }
internal StorageService(IPluginService pluginService) { _pluginService = pluginService; _profileRepository = new ProfileRepository(); }
public static void BeforeExpressCheckoutScenarios() { var context = new ShopAnyWareSql(); var userRepository = new UserRepository(context); var roleRepository = new RoleRepository(context); var profileRepository = new ProfileRepository(context); var membershipRepository = new MembershipRepository(); var transactionRepo = new TransactionsRepository(); var emailSvc = new FakeEmailService(); var logger = new FakeLogger(); var emailService = new FakeEmailService(); var transactionService = new TransactionService(transactionRepo, emailSvc, logger); ScenarioContext.Current.Set(transactionService); var membershipService = new MembershipService(logger, emailService, userRepository, roleRepository, profileRepository, membershipRepository); ScenarioContext.Current.Set(membershipService); }
public DoctorProfileController() { oProfileRepository = new ProfileRepository(); }
public VaultsService(VaultsRespository repo, ProfileRepository profRepo) { _repo = repo; _profRepo = profRepo; }
/// <summary> /// Persist the specified <paramref name="profile"/> to the data store. /// </summary> /// <param name="profile">The profile to persist to the data store.</param> /// <exception cref="ArgumentNullException">Thrown when <paramref name="profile" /> is null.</exception> public static void Save(IUserProfile profile) { if (profile == null) { throw new ArgumentNullException("profile"); } using (var repo = new ProfileRepository()) { // AlbumProfiles var pDto = (repo.Where(p => p.UserName == profile.UserName && p.SettingName == ProfileNameAlbumProfiles)).FirstOrDefault(); var templateGalleryId = GetTemplateGalleryId(); if (pDto == null) { pDto = new UserGalleryProfileDto { UserName = profile.UserName, FKGalleryId = templateGalleryId, SettingName = ProfileNameAlbumProfiles, SettingValue = profile.AlbumProfiles.Serialize() }; repo.Add(pDto); } else { pDto.SettingValue = profile.AlbumProfiles.Serialize(); } // Media Object Profiles pDto = (repo.Where(p => p.UserName == profile.UserName && p.SettingName == ProfileNameMediaObjectProfiles)).FirstOrDefault(); if (pDto == null) { pDto = new UserGalleryProfileDto { UserName = profile.UserName, FKGalleryId = templateGalleryId, SettingName = ProfileNameMediaObjectProfiles, SettingValue = profile.MediaObjectProfiles.Serialize() }; repo.Add(pDto); } else { pDto.SettingValue = profile.MediaObjectProfiles.Serialize(); } // User Gallery Profiles foreach (IUserGalleryProfile userGalleryProfile in profile.GalleryProfiles) { IUserGalleryProfile ugp = userGalleryProfile; // EnableUserAlbum pDto = (repo.Where(p => p.UserName == profile.UserName && p.FKGalleryId == ugp.GalleryId && p.SettingName == ProfileNameEnableUserAlbum)).FirstOrDefault(); if (pDto == null) { pDto = new UserGalleryProfileDto { UserName = profile.UserName, FKGalleryId = ugp.GalleryId, SettingName = ProfileNameEnableUserAlbum, SettingValue = ugp.EnableUserAlbum.ToString(CultureInfo.InvariantCulture) }; repo.Add(pDto); } else { pDto.SettingValue = ugp.EnableUserAlbum.ToString(CultureInfo.InvariantCulture); } // UserAlbumId pDto = (repo.Where(p => p.UserName == profile.UserName && p.FKGalleryId == ugp.GalleryId && p.SettingName == ProfileNameUserAlbumId)).FirstOrDefault(); if (pDto == null) { pDto = new UserGalleryProfileDto { UserName = profile.UserName, FKGalleryId = ugp.GalleryId, SettingName = ProfileNameUserAlbumId, SettingValue = ugp.UserAlbumId.ToString(CultureInfo.InvariantCulture) }; repo.Add(pDto); } else { pDto.SettingValue = ugp.UserAlbumId.ToString(CultureInfo.InvariantCulture); } } repo.Save(); } }
public UnitOfWork(string connection) { User = new UserRepository(connection); Profile = new ProfileRepository(connection); Courses = new CourseRepository(connection); }
public List <ProfileModel> GetListProfileBy(string dlrRegion) { ProfileRepository _profile = new ProfileRepository(); return(_profile.GetListProfileBy(dlrRegion)); }
public IPagedList <ProfileModel> GetAll(string search, string filter, int page, int pageSize, string order = "", string asc = "") { ProfileRepository _profile = new ProfileRepository(); return(_profile.GetAll(search, filter, page, pageSize, order, asc)); }
public void UpdateProfileByStarsId(ProfileModel model) { ProfileRepository _profile = new ProfileRepository(); _profile.UpdateProfileByStarsId(model); }
public void SaveProfilUploadImage(string photoPath, string starsId) { ProfileRepository _profile = new ProfileRepository(); _profile.SaveProfilUploadImage(photoPath, starsId); }
public ProfileModel GetAnyProfileByStarsId(string StarzId) { ProfileRepository _profile = new ProfileRepository(); return(_profile.GetAnyProfileByStarsId(StarzId)); }
public RepositoryRegistry() { For<ICredentialRepository>() .Use(factory => { return new CredentialRepository(factory.GetInstance<Entities>()); }); For<IProfileRepository>() .Use(factory => { var repository = new ProfileRepository(factory.GetInstance<Entities>()); return repository; }); For<IProfileActivityRepository>() .Use(factory => { var repository = new ProfileActivityRepository(factory.GetInstance<Entities>()); return repository; }); For<IGrunkerRepository>() .Use(factory => { var repository = new GrunkerRepository(factory.GetInstance<Entities>()); return repository; }); For<IActivityTypeRepository>() .Use(factory => { var repository = new ActivityTypeRepository(factory.GetInstance<Entities>()); return repository; }); For<IPictureRepository>() .Use(factory => { var repository = new PictureRepository(factory.GetInstance<Entities>()); return repository; }); For<IGenreRepository>() .Use(factory => { var repository = new GenreRepository(factory.GetInstance<Entities>()); return repository; }); For<IArtistRepository>() .Use(factory => { var repository = new ArtistRepository(factory.GetInstance<Entities>()); return repository; }); For<IAlbumRepository>() .Use(factory => { var repository = new AlbumRepository(factory.GetInstance<Entities>()); return repository; }); For<IPurchaseRepository>() .Use(factory => { var repository = new PurchaseRepository(factory.GetInstance<Entities>()); return repository; }); For<IReviewRepository>() .Use(factory => { var repository = new ReviewRepository(factory.GetInstance<Entities>()); return repository; }); For<IReviewLinkRepository>() .Use(factory => { var repository = new ReviewLinkRepository(factory.GetInstance<Entities>()); return repository; }); For<IStoreDetailsRepository>() .Use(factory => { var repository = new StoreDetailsRepository(HttpContext.Current.Server.MapPath("~/App_Data/storedetails.xml")); return repository; }); For<IStaticTextRepository>() .Use(factory => { var repository = new StaticTextRepository(factory.GetInstance<Entities>()); return repository; }); }
public ProfileBusiness(IUnitOfWork _unitOfWork) { profileRepository = new ProfileRepository(_unitOfWork); profilePermissionRepository = new ProfilePermissionRepository(_unitOfWork); companyRepository = new CompanyRepository(_unitOfWork); }
protected override async void OnStartup(StartupEventArgs e) { base.DispatcherUnhandledException += App_DispatcherUnhandledException; AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException; await Host.StartAsync(); SingleInstanceManager singleInstanceManager = Host.Services.GetRequiredService <SingleInstanceManager>(); _logger.Value.LogInformation("Starting App."); if (!singleInstanceManager.IsFirstInstance) { _logger.Value.LogInformation("I am not the first instance. Shutting down ..."); base.Shutdown(0); return; } base.ShutdownMode = ShutdownMode.OnExplicitShutdown; singleInstanceManager.SecondInstanceStarted += OnSecondInstanceStarted; bool createUi = true; foreach (string arg in e.Args) { switch (arg) { case "-tray": createUi = false; _logger.Value.LogInformation("Launch argument '{0}' found, don't create a UI.", arg); break; default: _logger.Value.LogWarning("Got invalid launch argument '{0}', ignoring.", arg); break; } } _logger.Value.LogTrace("Setting up tray icon."); TrayIconManager trayIconManager = Host.Services.GetRequiredService <TrayIconManager>(); trayIconManager.IconVisible = true; trayIconManager.ItemExitClick += (sender, eventArgs) => _ = App.GracefulShutdownAsync(); trayIconManager.DoubleClick += (sender, eventArgs) => this.ShowCreateMainWindow(); ProfileRepository profileRepository = Host.Services.GetRequiredService <ProfileRepository>(); await profileRepository.LoadProfilesAsync(); if (createUi) { _logger.Value.LogInformation("Creating MainWindow on startup."); this.ShowCreateMainWindow(); } SimConnectManager scm = Host.Services.GetRequiredService <SimConnectManager>(); await scm.StartAsync(); _ = Host.Services.GetRequiredService <DeviceBindingManager>(); }
public WorkoutsController(WorkoutsRepository workoutsRepository, WorkoutUserRelationRepository workoutUserRelationRepository, ProfileRepository profileRepository, SavedWorkoutsRepository savedWorkoutsRepository) { this.workoutsRepository = workoutsRepository; this.workoutUserRelationRepository = workoutUserRelationRepository; this.profileRepository = profileRepository; this.savedWorkoutsRepository = savedWorkoutsRepository; }
public MatchManager() { _profileRepository = new ProfileRepository(); }
public IEnumerable <Profile> getJobSeekerProfile(string userID) { return(ProfileRepository.Get(s => s.JobSeekerID == userID && s.IsDeleted == false).AsEnumerable()); }
public void ExecSave(object param) { ProfileRepository.SaveProfile(this.innerModel); Messenger.Default.Send <string>("profileEdited"); }
/// <summary> /// Retrieves the profile for the specified <paramref name="userName" />. Guaranteed to not return null. /// </summary> /// <param name="userName">Name of the user.</param> /// <returns>An instance of <see cref="IUserProfile" />.</returns> public static IUserProfile RetrieveFromDataStore(string userName) { IUserProfile profile = new UserProfile(); profile.UserName = userName; IUserGalleryProfile gs = null; int prevGalleryId = int.MinValue; using (var repo = new ProfileRepository()) { foreach (var profileDto in (repo.Where(p => p.UserName == userName, p => p.Gallery).OrderBy(p => p.FKGalleryId))) { // Loop through each user profile setting and assign to the relevant property. When we encounter a record with a new gallery ID, // automatically create a new UserGalleryProfile instance and start populating that one. When we are done with the loop we will // have created one UserGalleryProfile instance for each gallery the user has a profile for. #region Check for application-wide profile setting if (profileDto.Gallery.IsTemplate) { // Profile items associated with the template gallery are application-wide and map to properties // on the UserProfile object. switch (profileDto.SettingName.Trim()) { case ProfileNameEnableUserAlbum: case ProfileNameUserAlbumId: throw new DataException(String.Format("It is invalid for the profile setting '{0}' to be associated with a template gallery (Gallery ID {1}).", profileDto.SettingName, profileDto.FKGalleryId)); case ProfileNameAlbumProfiles: var albumProfiles = JsonConvert.DeserializeObject <List <AlbumProfile> >(profileDto.SettingValue.Trim()); if (albumProfiles != null) { profile.AlbumProfiles.AddRange(albumProfiles); } break; case ProfileNameMediaObjectProfiles: var moProfiles = JsonConvert.DeserializeObject <List <MediaObjectProfile> >(profileDto.SettingValue.Trim()); if (moProfiles != null) { profile.MediaObjectProfiles.AddRange(moProfiles); } break; } continue; } #endregion #region Check for new gallery int currGalleryId = profileDto.FKGalleryId; if ((gs == null) || (!currGalleryId.Equals(prevGalleryId))) { // We have encountered settings for a new user gallery profile. Create a new object and add it to our collection. gs = profile.GalleryProfiles.CreateNewUserGalleryProfile(currGalleryId); profile.GalleryProfiles.Add(gs); prevGalleryId = currGalleryId; } #endregion #region Assign property // For each setting in the data store, find the matching property and assign the value to it. switch (profileDto.SettingName.Trim()) { case ProfileNameEnableUserAlbum: gs.EnableUserAlbum = Convert.ToBoolean(profileDto.SettingValue.Trim(), CultureInfo.InvariantCulture); break; case ProfileNameUserAlbumId: gs.UserAlbumId = Convert.ToInt32(profileDto.SettingValue.Trim(), CultureInfo.InvariantCulture); break; case ProfileNameAlbumProfiles: case ProfileNameMediaObjectProfiles: throw new DataException(String.Format("It is invalid for the profile setting '{0}' to be associated with a non-template gallery (Gallery ID {1}).", profileDto.SettingName, profileDto.FKGalleryId)); } #endregion } } return(profile); }
private void ExecDeleteCommand(object obj) { ProfileRepository.DeleteProfile(SelectedProfile.Id); RefreshProfileListFromDisk(); IsDeleteDialogVisible = false; }
public RegisterController() { apRep = new AppUserRepository(); apdRep = new ProfileRepository(); }
public CreateNewPasswordServerAction(IServiceProvider serviceProvider, NewPasswordSecretRepository newPasswordSecretRepository, ProfileRepository profileRepository, ITimeService timeService, TextService textService, IHashService hashService, UniwikiContext uniwikiContext) : base(serviceProvider) { _newPasswordSecretRepository = newPasswordSecretRepository; _profileRepository = profileRepository; _timeService = timeService; _textService = textService; _hashService = hashService; _uniwikiContext = uniwikiContext; }
public List <ProfileModel> GetListProfileByStarsId(List <string> StarsIdList = null) { ProfileRepository _profile = new ProfileRepository(); return(_profile.GetListProfileByStarsId(StarsIdList)); }
public LoginController() { ContactRepository = new ContactRepository(); OfficeRepository = new OfficeRepository(); ProfileRepository = new ProfileRepository(); }
public Profile LoadProfile(string UserName, string Password) { IProfile obj = new ProfileRepository(); return(obj.LoadProfile(UserName, Password)); }
protected ProfileAttribute() { ProfileRepository = new ProfileRepository(); }
public GetProfileServerAction(IServiceProvider serviceProvider, ProfileRepository profileRepository, UniwikiContext uniwikiContext, TextService textService) : base(serviceProvider) { _profileRepository = profileRepository; _uniwikiContext = uniwikiContext; _textService = textService; }
public EditHomeFacultyServerAction(IServiceProvider serviceProvider, ProfileRepository profileRepository, StudyGroupRepository studyGroupRepository) : base(serviceProvider) { _profileRepository = profileRepository; _studyGroupRepository = studyGroupRepository; }
// GET: Employee/GetAllUserDetails public ActionResult EditProfile() { ProfileRepository PostRepo = new ProfileRepository(); return(View(PostRepo.GetMasterUser())); }
public DataManager(IDataContextService dataContext) { ProfileRep = new ProfileRepository(dataContext); }
public LocationController(IServiceProvider serviceProvider, LocationRepository locationRepository, ProfileRepository profileRepository) : base(serviceProvider) { this.locationRepository = locationRepository; this.profileRepository = profileRepository; }
public ProfileController(ILogger <ProfileController> logger, ProfileRepository profileRepository, GoogleProfileDtoAssembler googleAssembler) { _logger = logger; _profileRepository = profileRepository; this.googleAssembler = googleAssembler; }
public ProfileService(ProfileRepository repo) { _repo = repo; }
public ContactManager(AddressRepository addressRepository, AddressTypeRepository addressTypeRepository, PhoneRepository phoneRepository, PhoneTypeRepository phoneTypeRepository, ProfileAddressRepository profileAddressRepository, ProfilePhoneRepository profilePhoneRepository, ProfileRepository profileRepository) { if (addressRepository == null) { throw new ArgumentNullException("addressRepository"); } if (addressTypeRepository == null) { throw new ArgumentNullException("addressTypeRepository"); } if (phoneRepository == null) { throw new ArgumentNullException("phoneRepository"); } if (phoneTypeRepository == null) { throw new ArgumentNullException("phoneTypeRepository"); } if (profileAddressRepository == null) { throw new ArgumentNullException("profileAddressRepository"); } if (profilePhoneRepository == null) { throw new ArgumentNullException("profilePhoneRepository"); } if (profileRepository == null) { throw new ArgumentNullException("profileRepository"); } _addressRepository = addressRepository; _addressTypeRepository = addressTypeRepository; _phoneRepository = phoneRepository; _phoneTypeRepository = phoneTypeRepository; _profileAddressRepository = profileAddressRepository; _profilePhoneRepository = profilePhoneRepository; _profileRepository = profileRepository; }
public UpdateUser() { InitializeComponent(); appUserRepository = new AppUserRepository(); profileRepository = new ProfileRepository(); }
/// <summary> /// Permanently delete the profile records for the specified <paramref name="userName" />. /// The profile cache is cleared. /// </summary> /// <param name="userName">Name of the user.</param> public static void DeleteUserProfile(string userName) { //GetDataProvider().Profile_DeleteProfileForUser(userName); using (var repo = new ProfileRepository()) { foreach (var pDto in repo.Where(p => p.UserName == userName)) { repo.Delete(pDto); } repo.Save(); } HelperFunctions.RemoveCache(CacheItem.Profiles); }