protected CustomerUnsubscribedSmsNotificationEntity(SerializationInfo info, StreamingContext context) : base(info, context) { if (SerializationHelper.Optimization != SerializationOptimization.Fast) { _customerProfile = (CustomerProfileEntity)info.GetValue("_customerProfile", typeof(CustomerProfileEntity)); if (_customerProfile != null) { _customerProfile.AfterSave += new EventHandler(OnEntityAfterSave); } _lookup = (LookupEntity)info.GetValue("_lookup", typeof(LookupEntity)); if (_lookup != null) { _lookup.AfterSave += new EventHandler(OnEntityAfterSave); } _smsReceived = (SmsReceivedEntity)info.GetValue("_smsReceived", typeof(SmsReceivedEntity)); if (_smsReceived != null) { _smsReceived.AfterSave += new EventHandler(OnEntityAfterSave); } base.FixupDeserialization(FieldInfoProviderSingleton.GetInstance()); } // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor // __LLBLGENPRO_USER_CODE_REGION_END }
protected RoleAccessControlObjectEntity(SerializationInfo info, StreamingContext context) : base(info, context) { if (SerializationHelper.Optimization != SerializationOptimization.Fast) { _accessControlObject = (AccessControlObjectEntity)info.GetValue("_accessControlObject", typeof(AccessControlObjectEntity)); if (_accessControlObject != null) { _accessControlObject.AfterSave += new EventHandler(OnEntityAfterSave); } _lookup = (LookupEntity)info.GetValue("_lookup", typeof(LookupEntity)); if (_lookup != null) { _lookup.AfterSave += new EventHandler(OnEntityAfterSave); } _lookup_ = (LookupEntity)info.GetValue("_lookup_", typeof(LookupEntity)); if (_lookup_ != null) { _lookup_.AfterSave += new EventHandler(OnEntityAfterSave); } _role = (RoleEntity)info.GetValue("_role", typeof(RoleEntity)); if (_role != null) { _role.AfterSave += new EventHandler(OnEntityAfterSave); } base.FixupDeserialization(FieldInfoProviderSingleton.GetInstance()); } // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor // __LLBLGENPRO_USER_CODE_REGION_END }
protected WellMedAttestationEntity(SerializationInfo info, StreamingContext context) : base(info, context) { if (SerializationHelper.Optimization != SerializationOptimization.Fast) { _eventCustomerResult = (EventCustomerResultEntity)info.GetValue("_eventCustomerResult", typeof(EventCustomerResultEntity)); if (_eventCustomerResult != null) { _eventCustomerResult.AfterSave += new EventHandler(OnEntityAfterSave); } _file = (FileEntity)info.GetValue("_file", typeof(FileEntity)); if (_file != null) { _file.AfterSave += new EventHandler(OnEntityAfterSave); } _lookup = (LookupEntity)info.GetValue("_lookup", typeof(LookupEntity)); if (_lookup != null) { _lookup.AfterSave += new EventHandler(OnEntityAfterSave); } base.FixupDeserialization(FieldInfoProviderSingleton.GetInstance()); } // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor // __LLBLGENPRO_USER_CODE_REGION_END }
protected HostImageEntity(SerializationInfo info, StreamingContext context) : base(info, context) { if (SerializationHelper.Optimization != SerializationOptimization.Fast) { _file = (FileEntity)info.GetValue("_file", typeof(FileEntity)); if (_file != null) { _file.AfterSave += new EventHandler(OnEntityAfterSave); } _lookup = (LookupEntity)info.GetValue("_lookup", typeof(LookupEntity)); if (_lookup != null) { _lookup.AfterSave += new EventHandler(OnEntityAfterSave); } _prospects = (ProspectsEntity)info.GetValue("_prospects", typeof(ProspectsEntity)); if (_prospects != null) { _prospects.AfterSave += new EventHandler(OnEntityAfterSave); } base.FixupDeserialization(FieldInfoProviderSingleton.GetInstance()); } // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor // __LLBLGENPRO_USER_CODE_REGION_END }
protected AccountCallQueueSettingEntity(SerializationInfo info, StreamingContext context) : base(info, context) { if (SerializationHelper.Optimization != SerializationOptimization.Fast) { _account = (AccountEntity)info.GetValue("_account", typeof(AccountEntity)); if (_account != null) { _account.AfterSave += new EventHandler(OnEntityAfterSave); } _callQueue = (CallQueueEntity)info.GetValue("_callQueue", typeof(CallQueueEntity)); if (_callQueue != null) { _callQueue.AfterSave += new EventHandler(OnEntityAfterSave); } _lookup = (LookupEntity)info.GetValue("_lookup", typeof(LookupEntity)); if (_lookup != null) { _lookup.AfterSave += new EventHandler(OnEntityAfterSave); } base.FixupDeserialization(FieldInfoProviderSingleton.GetInstance()); } // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor // __LLBLGENPRO_USER_CODE_REGION_END }
public void SelectCoalesce_EmptyValue3_ShouldBeReplaced() { const string sqlInsert = @"INSERT [dbo].[Lookup] ([Key], [Value], [DisplayValue] ) VALUES (@Key, @Value, @DisplayValue)"; const string sqlCreate = @" CREATE TABLE [dbo].[Lookup] ( [Id] INT IDENTITY (1, 1) NOT NULL PRIMARY KEY, [Key] NVARCHAR(50) NOT NULL, [Value] NVARCHAR(50) NOT NULL, [DisplayValue] NVARCHAR(MAX) NULL )"; const string sqlSelect = @" SELECT [Key] , [Value] , COALESCE([DisplayValue],[Value]) as [DisplayValue] FROM [dbo].[Lookup] "; var newLookup = new LookupEntity { Key = "New", Value = "New Value" }; using var connection = new MemoryDbConnection(); connection.Execute(sqlCreate); connection.Execute(sqlInsert, newLookup); var result = connection.QuerySingle <LookupEntity>(sqlSelect); result.DisplayValue.Should().Be(result.Value); }
private LookupEntity PopulateLookupItemFromDataReader(IDataReader dataReader) { LookupEntity item = new LookupEntity(); item.ID = GetInt("ID", dataReader); item.Description = GetString("Description", dataReader); return(item); }
/// <summary> setups the sync logic for member _lookup</summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> private void SetupSyncLookup(IEntity2 relatedEntity) { if (_lookup != relatedEntity) { DesetupSyncLookup(true, true); _lookup = (LookupEntity)relatedEntity; base.PerformSetupSyncRelatedEntity(_lookup, new PropertyChangedEventHandler(OnLookupPropertyChanged), "Lookup", EventCustomerResultBloodLabParserEntity.Relations.LookupEntityUsingBloodLabId, true, new string[] { }); } }
public Lookup(LookupEntity ObjEntity, string lookupName) { Init(lookupName); Fields = ObjEntity; if (Fields.ID != null && Fields.ID != default(Guid)) { IsNew = false; } }
/// <summary> setups the sync logic for member _lookup</summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> private void SetupSyncLookup(IEntity2 relatedEntity) { if (_lookup != relatedEntity) { DesetupSyncLookup(true, true); _lookup = (LookupEntity)relatedEntity; base.PerformSetupSyncRelatedEntity(_lookup, new PropertyChangedEventHandler(OnLookupPropertyChanged), "Lookup", LoginSettingsEntity.Relations.LookupEntityUsingAuthenticationModeId, true, new string[] { }); } }
/// <summary> setups the sync logic for member _lookup_</summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> private void SetupSyncLookup_(IEntity2 relatedEntity) { if (_lookup_ != relatedEntity) { DesetupSyncLookup_(true, true); _lookup_ = (LookupEntity)relatedEntity; base.PerformSetupSyncRelatedEntity(_lookup_, new PropertyChangedEventHandler(OnLookup_PropertyChanged), "Lookup_", RoleAccessControlObjectEntity.Relations.LookupEntityUsingScopeId, true, new string[] { }); } }
/// <summary> setups the sync logic for member _lookup</summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> private void SetupSyncLookup(IEntity2 relatedEntity) { if (_lookup != relatedEntity) { DesetupSyncLookup(true, true); _lookup = (LookupEntity)relatedEntity; base.PerformSetupSyncRelatedEntity(_lookup, new PropertyChangedEventHandler(OnLookupPropertyChanged), "Lookup", AccessObjectScopeOptionEntity.Relations.LookupEntityUsingScopeId, true, new string[] { }); } }
/// <summary> setups the sync logic for member _lookup</summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> private void SetupSyncLookup(IEntity2 relatedEntity) { if (_lookup != relatedEntity) { DesetupSyncLookup(true, true); _lookup = (LookupEntity)relatedEntity; base.PerformSetupSyncRelatedEntity(_lookup, new PropertyChangedEventHandler(OnLookupPropertyChanged), "Lookup", PaymentInstructionsEntity.Relations.LookupEntityUsingPaymentFrequencyId, true, new string[] { }); } }
/// <summary> setups the sync logic for member _lookup</summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> private void SetupSyncLookup(IEntity2 relatedEntity) { if (_lookup != relatedEntity) { DesetupSyncLookup(true, true); _lookup = (LookupEntity)relatedEntity; base.PerformSetupSyncRelatedEntity(_lookup, new PropertyChangedEventHandler(OnLookupPropertyChanged), "Lookup", CriticalQuestionEntity.Relations.LookupEntityUsingControlType, true, new string[] { }); } }
/// <summary> setups the sync logic for member _lookup</summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> private void SetupSyncLookup(IEntity2 relatedEntity) { if (_lookup != relatedEntity) { DesetupSyncLookup(true, true); _lookup = (LookupEntity)relatedEntity; base.PerformSetupSyncRelatedEntity(_lookup, new PropertyChangedEventHandler(OnLookupPropertyChanged), "Lookup", AccountCallQueueSettingEntity.Relations.LookupEntityUsingSuppressionTypeId, true, new string[] { }); } }
/// <summary> setups the sync logic for member _lookup</summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> private void SetupSyncLookup(IEntity2 relatedEntity) { if (_lookup != relatedEntity) { DesetupSyncLookup(true, true); _lookup = (LookupEntity)relatedEntity; base.PerformSetupSyncRelatedEntity(_lookup, new PropertyChangedEventHandler(OnLookupPropertyChanged), "Lookup", MergeCustomerUploadLogEntity.Relations.LookupEntityUsingStatusId, true, new string[] { }); } }
/// <summary> Initializes the class members</summary> protected virtual void InitClassMembers() { _lookup = null; PerformDependencyInjection(); // __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers // __LLBLGENPRO_USER_CODE_REGION_END OnInitClassMembersComplete(); }
/// <summary> Initializes the class members</summary> protected virtual void InitClassMembers() { _eventCustomerCriticalQuestion = null; _eventCustomersCollectionViaEventCustomerCriticalQuestion = null; _lookup = null; PerformDependencyInjection(); // __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers // __LLBLGENPRO_USER_CODE_REGION_END OnInitClassMembersComplete(); }
protected CriticalQuestionEntity(SerializationInfo info, StreamingContext context) : base(info, context) { if (SerializationHelper.Optimization != SerializationOptimization.Fast) { _eventCustomerCriticalQuestion = (EntityCollection <EventCustomerCriticalQuestionEntity>)info.GetValue("_eventCustomerCriticalQuestion", typeof(EntityCollection <EventCustomerCriticalQuestionEntity>)); _eventCustomersCollectionViaEventCustomerCriticalQuestion = (EntityCollection <EventCustomersEntity>)info.GetValue("_eventCustomersCollectionViaEventCustomerCriticalQuestion", typeof(EntityCollection <EventCustomersEntity>)); _lookup = (LookupEntity)info.GetValue("_lookup", typeof(LookupEntity)); if (_lookup != null) { _lookup.AfterSave += new EventHandler(OnEntityAfterSave); } base.FixupDeserialization(FieldInfoProviderSingleton.GetInstance()); } // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor // __LLBLGENPRO_USER_CODE_REGION_END }
// Base Override Methods public override IEnumerable <BaseLookupEntity> Read() { // Clear old result set and settings _dOOdad.FlushData(); // Reload the records and return them sorted and translated return(base.ReloadRecords( _dOOdad.LoadAll, () => { _dOOdad.Sort = _dOOdad.GetAutoKeyColumn(); }, () => { var entity = new LookupEntity(); entity.Description = string.Format("Cycles for {0}", _dOOdad.YEAR); return entity.PopulateLookupEntity(_dOOdad.CurrentRow.ItemArray, true); }, _dOOdad.MoveNext)); }
protected LoginSettingsEntity(SerializationInfo info, StreamingContext context) : base(info, context) { if (SerializationHelper.Optimization != SerializationOptimization.Fast) { _lookup = (LookupEntity)info.GetValue("_lookup", typeof(LookupEntity)); if (_lookup != null) { _lookup.AfterSave += new EventHandler(OnEntityAfterSave); } _userLogin = (UserLoginEntity)info.GetValue("_userLogin", typeof(UserLoginEntity)); if (_userLogin != null) { _userLogin.AfterSave += new EventHandler(OnEntityAfterSave); } base.FixupDeserialization(FieldInfoProviderSingleton.GetInstance()); } // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor // __LLBLGENPRO_USER_CODE_REGION_END }
public async Task <LookupEntity> GetLookupsAsync() { LookupEntity lookupEntity = new LookupEntity(); lookupEntity.Colleges = await _context.Set <College>() .Include(c => c.CollegeLicenses) .Include(c => c.CollegePractices) .ToListAsync(); lookupEntity.JobNames = await _context.Set <JobName>().ToListAsync(); lookupEntity.Licenses = await _context.Set <License>() .Include(l => l.CollegeLicenses) .ToListAsync(); lookupEntity.OrganizationTypes = await _context.Set <OrganizationType>().ToListAsync(); lookupEntity.Practices = await _context.Set <Practice>() .Include(p => p.CollegePractices) .ToListAsync(); lookupEntity.Statuses = await _context.Set <Status>().ToListAsync(); lookupEntity.Countries = await _context.Set <Country>().ToListAsync(); lookupEntity.Provinces = await _context.Set <Province>().ToListAsync(); lookupEntity.StatusReasons = await _context.Set <StatusReason>().ToListAsync(); lookupEntity.PrivilegeGroups = await _context.Set <PrivilegeGroup>().ToListAsync(); lookupEntity.PrivilegeTypes = await _context.Set <PrivilegeType>().ToListAsync(); lookupEntity.Vendors = await _context.Set <Vendor>().ToListAsync(); return(lookupEntity); }
public async Task <ActionResult <LookupEntity> > GetLookups() { LookupEntity lookupEntity = new LookupEntity(); lookupEntity.Colleges = await _lookupService.GetLookupsAsync <short, College>(c => c.CollegeLicenses, c => c.CollegePractices); lookupEntity.JobNames = await _lookupService.GetLookupsAsync <short, JobName>(); lookupEntity.Licenses = await _lookupService.GetLookupsAsync <short, License>(l => l.CollegeLicenses); lookupEntity.OrganizationTypes = await _lookupService.GetLookupsAsync <short, OrganizationType>(); lookupEntity.Practices = await _lookupService.GetLookupsAsync <short, Practice>(p => p.CollegePractices); lookupEntity.Statuses = await _lookupService.GetLookupsAsync <short, Status>(); lookupEntity.Countries = await _lookupService.GetLookupsAsync <string, Country>(); lookupEntity.Provinces = await _lookupService.GetLookupsAsync <string, Province>(); lookupEntity.StatusReasons = await _lookupService.GetLookupsAsync <short, StatusReason>(); return(Ok(new ApiOkResponse <LookupEntity>(lookupEntity))); }
/// <summary> Removes the sync logic for member _lookup</summary> /// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param> /// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param> private void DesetupSyncLookup(bool signalRelatedEntity, bool resetFKFields) { base.PerformDesetupSyncRelatedEntity(_lookup, new PropertyChangedEventHandler(OnLookupPropertyChanged), "Lookup", CustomerUnsubscribedSmsNotificationEntity.Relations.LookupEntityUsingStatusId, true, signalRelatedEntity, "CustomerUnsubscribedSmsNotification", resetFKFields, new int[] { (int)CustomerUnsubscribedSmsNotificationFieldIndex.StatusId }); _lookup = null; }
/// <summary> Removes the sync logic for member _lookup</summary> /// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param> /// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param> private void DesetupSyncLookup(bool signalRelatedEntity, bool resetFKFields) { base.PerformDesetupSyncRelatedEntity(_lookup, new PropertyChangedEventHandler(OnLookupPropertyChanged), "Lookup", PaymentInstructionsEntity.Relations.LookupEntityUsingPaymentFrequencyId, true, signalRelatedEntity, "PaymentInstructions", resetFKFields, new int[] { (int)PaymentInstructionsFieldIndex.PaymentFrequencyId }); _lookup = null; }
public async Task <List <AchievementEntity> > AddSpecialAchievements(Participant player, LookupEntity ourChampion, SummonerInfoEntity summonerInfo, Guid seasonInfoId, Match riotMatch, MatchSubmissionView view, int currentGame) { var achievements = new List <AchievementEntity>(); var teamName = "N/a"; var currentTeamId = (await _teamPlayerRepository.GetBySummonerAndSeasonIdAsync(summonerInfo.Id, seasonInfoId))?.TeamRosterId; if (currentTeamId != null) { var playerTeam = await _teamRosterRepository.GetByTeamIdAsync(currentTeamId.Value); if (playerTeam.TeamName == view.HomeTeamName || playerTeam.TeamName == view.AwayTeamName) { teamName = playerTeam.TeamName; } } if (player.Stats.LargestMultiKill >= 5) { var achivement = new AchievementEntity { Id = Guid.NewGuid(), UserId = summonerInfo.UserId, AchievedDate = DateTime.Today, AchievedTeam = teamName, Achievement = $"Penta-kill on {ourChampion.Value} in game {currentGame}" }; achievements.Add(achivement); } var blueTeamPlayers = riotMatch.Participants.Where(x => x.TeamId == 100); var redTeamPlayers = riotMatch.Participants.Where(x => x.TeamId == 200); var blueTotalKills = blueTeamPlayers.Sum(y => y.Stats.Kills); var redTotalKills = redTeamPlayers.Sum(y => y.Stats.Kills); var isBlue = player.TeamId == 100; if (isBlue && redTotalKills == 0 || !isBlue && blueTotalKills == 0) { var blueTeam = riotMatch.Teams.First(x => x.TeamId == 100); var redTeam = riotMatch.Teams.First(x => x.TeamId == 200); if (blueTeam.DragonKills == 0 && blueTeam.BaronKills == 0 && blueTeam.TowerKills == 0 && !isBlue || redTeam.DragonKills == 0 && redTeam.BaronKills == 0 && redTeam.TowerKills == 0 && isBlue) { var achivement = new AchievementEntity { Id = Guid.NewGuid(), UserId = summonerInfo.UserId, AchievedDate = DateTime.Today, AchievedTeam = teamName, Achievement = $"Perfect Game on {ourChampion.Value} in game {currentGame}" }; achievements.Add(achivement); } } try { var oldAchievements = (await _achievementRepository.GetAchievementsForUserAsync(summonerInfo.UserId)).ToList(); var tempList = new List <AchievementEntity>(achievements); foreach (var newAchievement in tempList) { var match = oldAchievements.FirstOrDefault(x => x.Equals(newAchievement)); if (match != null) { achievements.Remove(newAchievement); } } } catch (Exception) { //ignore } return(achievements); }
/// <summary> Removes the sync logic for member _lookup</summary> /// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param> /// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param> private void DesetupSyncLookup(bool signalRelatedEntity, bool resetFKFields) { base.PerformDesetupSyncRelatedEntity(_lookup, new PropertyChangedEventHandler(OnLookupPropertyChanged), "Lookup", CriticalQuestionEntity.Relations.LookupEntityUsingControlType, true, signalRelatedEntity, "CriticalQuestion", resetFKFields, new int[] { (int)CriticalQuestionFieldIndex.ControlType }); _lookup = null; }
/// <summary> Removes the sync logic for member _lookup</summary> /// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param> /// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param> private void DesetupSyncLookup(bool signalRelatedEntity, bool resetFKFields) { base.PerformDesetupSyncRelatedEntity(_lookup, new PropertyChangedEventHandler(OnLookupPropertyChanged), "Lookup", AccountCallQueueSettingEntity.Relations.LookupEntityUsingSuppressionTypeId, true, signalRelatedEntity, "AccountCallQueueSetting", resetFKFields, new int[] { (int)AccountCallQueueSettingFieldIndex.SuppressionTypeId }); _lookup = null; }
/// <summary> Removes the sync logic for member _lookup</summary> /// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param> /// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param> private void DesetupSyncLookup(bool signalRelatedEntity, bool resetFKFields) { base.PerformDesetupSyncRelatedEntity(_lookup, new PropertyChangedEventHandler(OnLookupPropertyChanged), "Lookup", AccessObjectScopeOptionEntity.Relations.LookupEntityUsingScopeId, true, signalRelatedEntity, "AccessObjectScopeOption", resetFKFields, new int[] { (int)AccessObjectScopeOptionFieldIndex.ScopeId }); _lookup = null; }
/// <summary> Removes the sync logic for member _lookup</summary> /// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param> /// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param> private void DesetupSyncLookup(bool signalRelatedEntity, bool resetFKFields) { base.PerformDesetupSyncRelatedEntity(_lookup, new PropertyChangedEventHandler(OnLookupPropertyChanged), "Lookup", MergeCustomerUploadLogEntity.Relations.LookupEntityUsingStatusId, true, signalRelatedEntity, "MergeCustomerUploadLog", resetFKFields, new int[] { (int)MergeCustomerUploadLogFieldIndex.StatusId }); _lookup = null; }