private void Cbx_department_selection_Unchecked(object sender, RoutedEventArgs e) { CheckBox selectedCheckBox = sender as CheckBox; if (handleDepartmentSelection) { JobDepartment selectedJobDepartment = (JobDepartment)selectedCheckBox.DataContext; companyReviewFilter.removeDepartment(selectedJobDepartment.departmentName); handleDepartmentSelection = false; handleDepartmentCheckbox(selectedCheckBox); handleDepartmentSelection = true; } }
private void populateDepartmentsAndLocations(CompanyReview companyReview) { List <string> allCompanyReviewedDepartments = new List <string> { "Select all" }; List <string> allCompanyReviewedLocations = new List <string> { "Select all" }; List <Review> reviewsForDL; if (companyReview != null) { reviewsForDL = companyReview.reviews; } else { reviewsForDL = reviews.reviews; } allCompanyReviewedDepartments.AddRange((from n in reviewsForDL select n.jobDepartment).Distinct().OrderBy(x => x).ToList()); jobDepartments = new List <JobDepartment>(); if (allCompanyReviewedDepartments.Count > 0) { foreach (string department in allCompanyReviewedDepartments) { JobDepartment jobDepartment = new JobDepartment { departmentName = department, isSelected = true }; jobDepartments.Add(jobDepartment); } } Cmb_Departments.ItemsSource = jobDepartments; allCompanyReviewedLocations.AddRange((from n in reviewsForDL select n.jobLocation).Distinct().OrderBy(x => x).ToList()); jobLocations = new List <JobLocation>(); if (allCompanyReviewedLocations.Count > 0) { foreach (string location in allCompanyReviewedLocations) { JobLocation jobLocation = new JobLocation { location = location, isSelected = true }; jobLocations.Add(jobLocation); } } Cmb_Locations.ItemsSource = jobLocations; }
public void UpdateKillScore(GameObject perpetrator, GameObject victim) { if (perpetrator == null) { return; } var perPlayer = perpetrator.Player(); var victimPlayer = victim.Player(); if (perPlayer == null || victimPlayer == null) { return; } var playerName = perPlayer.Name; if (playerScores.ContainsKey(playerName)) { playerScores[playerName]++; } JobDepartment perpetratorDept = SpawnPoint.GetJobDepartment(perPlayer.Job); if (!departmentScores.ContainsKey(perpetratorDept)) { departmentScores.Add(perpetratorDept, 0); } JobDepartment victimDept = SpawnPoint.GetJobDepartment(victimPlayer.Job); if (perpetratorDept == victimDept) { departmentScores[perpetratorDept]--; } else { departmentScores[perpetratorDept]++; } }
public void UpdateKillScore(GameObject perpetrator, GameObject victim) { if (perpetrator == null) { return; } var playerName = Get(perpetrator).Name; if (playerScores.ContainsKey(playerName)) { playerScores[playerName]++; } JobType perpetratorJob = perpetrator.GetComponent <PlayerScript>().JobType; JobDepartment perpetratorDept = SpawnPoint.GetJobDepartment(perpetratorJob); if (!departmentScores.ContainsKey(perpetratorDept)) { departmentScores.Add(perpetratorDept, 0); } if (victim == null) { return; } JobType victimJob = victim.GetComponent <PlayerScript>().JobType; JobDepartment victimDept = SpawnPoint.GetJobDepartment(victimJob); if (perpetratorDept == victimDept) { departmentScores[perpetratorDept]--; } else { departmentScores[perpetratorDept]++; } }
protected override void OnDeathActions() { if (CustomNetworkManager.Instance._isServer) { PlayerNetworkActions pna = gameObject.GetComponent <PlayerNetworkActions>(); PlayerMove pm = gameObject.GetComponent <PlayerMove>(); ConnectedPlayer player = PlayerList.Instance.Get(gameObject); string killerName = "stressfull work"; if (LastDamagedBy != null) { killerName = PlayerList.Instance.Get(LastDamagedBy).Name; } if (killerName == player.Name) { PostToChatMessage.Send(player.Name + " commited suicide", ChatChannel.System); //Killfeed } else if (killerName.EndsWith(player.Name)) { // chain reactions PostToChatMessage.Send( player.Name + " screwed himself up with some help (" + killerName + ")", ChatChannel.System); //Killfeed } else { PlayerList.Instance.UpdateKillScore(LastDamagedBy, gameObject); string departmentKillText = ""; if (LastDamagedBy != null) { JobDepartment killerDepartment = SpawnPoint.GetJobDepartment(LastDamagedBy.GetComponent <PlayerScript>().JobType); JobDepartment victimDepartment = SpawnPoint.GetJobDepartment(gameObject.GetComponent <PlayerScript>().JobType); if (killerDepartment == victimDepartment) { departmentKillText = ", losing " + killerDepartment.GetDescription() + " 1 point for team killing!"; } else { departmentKillText = ", 1 point to " + killerDepartment.GetDescription() + "!"; } } //TDM demo killfeed PostToChatMessage.Send(killerName + " has killed " + player.Name + departmentKillText, ChatChannel.System); //Combat demo killfeed //PostToChatMessage.Send(killerName + " has killed " + gameObject.name, ChatChannel.System); } pna.ValidateDropItem("rightHand", true, transform.position); pna.ValidateDropItem("leftHand", true, transform.position); if (isServer) { EffectsFactory.Instance.BloodSplat(transform.position, BloodSplatSize.large); } pna.RpcSpawnGhost(); pm.isGhost = true; pm.allowInput = true; RpcPassBullets(gameObject); PlayerDeathMessage.Send(gameObject); //FIXME Remove for next demo pna.RespawnPlayer(10); } }
private void handleDepartmentCheckbox(CheckBox selectedCheckBox) { JobDepartment selectedJobDepartment = (JobDepartment)selectedCheckBox.DataContext; bool isSelectAllCheckbox = false; if (selectedJobDepartment.departmentName == "Select all") { isSelectAllCheckbox = true; } foreach (JobDepartment eachDepartment in jobDepartments) { if (eachDepartment.departmentName == "Select all" && (eachDepartment.isSelected == true) && (isSelectAllCheckbox == false)) { eachDepartment.isSelected = !eachDepartment.isSelected; continue; } if (isSelectAllCheckbox) { eachDepartment.isSelected = (bool)selectedCheckBox.IsChecked; } } bool isAllDepartmentSelected = (from n in jobDepartments where n.isSelected == false select n).Count() == 1; if (isAllDepartmentSelected) { JobDepartment selectAllDepartment = (from n in jobDepartments where n.departmentName == "Select all" select n).ToList()[0]; selectAllDepartment.isSelected = true; } foreach (JobDepartment department in jobDepartments) { if (department.isSelected == true) { if (department.departmentName == "Select all") { companyReviewFilter.addDepartment("All departments"); break; } else { companyReviewFilter.addDepartment(department.departmentName); } } } ObservableCollection <CompanyReview> tempReviews = companyReviewFilter.filterByCriteria(); Itc_reviews.ItemsSource = tempReviews; if (tempReviews.Count > 0) { isNoDataVisible = false; } else { isNoDataVisible = true; } Itc_FilterTags.ItemsSource = companyReviewFilter.getUIFilterTags(); }
public static void InitializeRestDataAsync(ApplicationDbContext context) { //Initialize Job Department Data if (context.JobDepartment.Any()) { } else { var departments = new JobDepartment[] { new JobDepartment { Id = 1, Name = "Business Opeartion" }, new JobDepartment { Id = 2, Name = "Engineering" }, new JobDepartment { Id = 3, Name = "IT Infrastructure" } }; foreach (JobDepartment s in departments) { context.JobDepartment.Add(s); } context.SaveChanges(); } //Initialize Job Experience Data if (context.JobExperience.Any()) { } else { var experiences = new JobExperience[] { new JobExperience { Id = 1, Name = "Intern" }, new JobExperience { Id = 2, Name = "Junior" }, new JobExperience { Id = 3, Name = "Experiences" } }; foreach (JobExperience s in experiences) { context.JobExperience.Add(s); } context.SaveChanges(); } //Initialize Job Location Data if (context.JobLocation.Any()) { } else { var locations = new JobLocation[] { new JobLocation { Id = 1, City = "San Diego" }, new JobLocation { Id = 2, City = "Huston" } }; foreach (JobLocation l in locations) { context.JobLocation.Add(l); } context.SaveChanges(); } //Initialize Job Data if (context.Job.Any()) { } else { var jobs = new Job[] { new Job { Id = 1, DeId = 2, ExId = 1, LId = 1, Name = "Summer 2019 .Net Engineer Intern", Description = JobDescription, PostDate = new DateTime(2018, 12, 25), Status = true }, new Job { Id = 2, DeId = 2, ExId = 1, LId = 1, Name = "Summer 2019 Software Engineer Intern", Description = JobDescription, PostDate = new DateTime(2019, 01, 15), Status = true }, new Job { Id = 3, DeId = 1, ExId = 2, LId = 2, Name = "Energy Market Analyst", Description = JobDescription, PostDate = new DateTime(2019, 01, 20), Status = true } }; foreach (Job j in jobs) { context.Job.Add(j); } context.SaveChanges(); } if (context.JobRequirement.Any()) { } else { var requirements = new JobRequirement[] { new JobRequirement { Id = 1, JobId = 1, Skill = "C#" }, new JobRequirement { Id = 2, JobId = 1, Skill = "SQL" }, new JobRequirement { Id = 3, JobId = 1, Skill = "Computer Science" }, new JobRequirement { Id = 4, JobId = 1, Skill = "ASP.NET CORE" }, new JobRequirement { Id = 5, JobId = 1, Skill = "Algorithm" }, new JobRequirement { Id = 6, JobId = 1, Skill = "Bachelor" }, new JobRequirement { Id = 7, JobId = 1, Skill = "MVC" }, new JobRequirement { Id = 8, JobId = 1, Skill = "Software Engineer" }, new JobRequirement { Id = 9, JobId = 1, Skill = "Java" }, new JobRequirement { Id = 10, JobId = 1, Skill = "C++" } }; foreach (var item in requirements) { context.JobRequirement.Add(item); } context.SaveChanges(); } }