// Add/Del Employee Page private void AddEmployeeSubmit_Click(object sender, RoutedEventArgs e) { var store = Dbs.GetStores().FirstOrDefault(x => x.StoreId == CurrentEmployee.StoreId); var name = AddEmployeeName.Text; var pin = AddEmployeePIN.Text; if (AddEmployeePIN.Background != Brushes.Transparent) { AddEmployeePIN.Background = Brushes.Transparent; } if (store.Employees.Any(x => x.PIN == pin)) { AddEmployeePIN.Background = Brushes.DarkRed; return; } decimal.TryParse(AddEmployeeWage.Text, out var wage); var manFunc = new ManagerFunctions(Dbs); try { manFunc.AddEmployee(name, pin, wage, ManAccess, store); } catch { AddEmployeeMsg.Content = "Failed to add!"; AddEmployeeMsg.Visibility = Visibility.Visible; return; } AddEmployeeMsg.Content = "Successfully added!"; AddEmployeeMsg.Visibility = Visibility.Visible; }
public ActionResult ManDeniedTimesheet() { ManagerViewModel theManager = new ManagerViewModel(); theManager.desiredStatus = "denied"; theManager.pendingTimesheets = ManagerFunctions.weeksFromstatus("denied"); theManager.names = ManagerFunctions.getEmployeeNames(theManager.pendingTimesheets); return(View("ManTimesheet", theManager)); }
// Use this for initialization void Start() { //Time.timeScale = 5; //Sets Target Frame Rate ManagerFunctions.SetTargetFrameRate(MaximumFPS); //Gets All SpawnPoint Game objects From The Scene. Spawns = GameObject.FindObjectsOfType <SpawnPoint>(); }
private void ManagerShowHours_Click(object sender, RoutedEventArgs e) { ManagerPage.Visibility = Visibility.Hidden; var store = Dbs.GetStores().FirstOrDefault(x => x.StoreNumber == StoreNum); var manFunc = new ManagerFunctions(Dbs); var disp = manFunc.ShowHours(store); ManagerHoursData.ItemsSource = disp; ManagerHoursPage.Visibility = Visibility.Visible; }
private IEnumerator RoundPlaying() { ManagerFunctions.EnableScoreBoard(false, ScorePanel); // As soon as the round begins playing let the players control the tanks. ManagerFunctions.EnableTankControls(Tanks); ManagerFunctions.EnableAgentControls(Agents); CountDownText.text = string.Empty; MessageText.text = string.Empty; while (NextState == null) { // While there is not one tank left... while (GameObject.FindObjectsOfType <TankHealth>().Length > 1) { if (Input.GetButtonDown("Pause")) { PauseMenu.SetActive(true); SetGameTimeScale(0.0f); } FrameCount += Time.deltaTime; if (FrameCount > MineSpawnDelay) { SpawnRandomMine(); FrameCount = 0; } if (ManagerFunctions.GetActiveTanks() < 1 && !SpeedButton.activeInHierarchy) { SpeedButton.SetActive(true); } yield return(null); } if (CurrentRound < NumOfRounds) { ManagerFunctions.AddScoreToFinalTank(); NextState = RoundBreak(); } else { ManagerFunctions.AddScoreToFinalTank(); NextState = GameEnding(); } yield return(null); } }
public ActionResult ChangeStatus(ManagerViewModel contextVM) { ManagerFunctions.changeStatus(contextVM.pendingTimesheets[contextVM.passedItem]); Debug.WriteLine(contextVM.desiredStatus); if (contextVM.desiredStatus == "approved") { return(RedirectToAction("ManApprovedTimesheet")); } else if (contextVM.desiredStatus == "denied") { return(RedirectToAction("ManDeniedTimesheet")); } else { return(RedirectToAction("ManPendingTimesheet")); } }
//This function is responsible for starting a new round. public void StartNewRound() { SetGameTimeScale(1.0f); if (SpeedButton.activeInHierarchy) { SpeedButton.SetActive(false); } //Active all tanks. ManagerFunctions.TanksRoundReset(Tanks); ManagerFunctions.AgentsRoundReset(Agents); //Disable all tank controls. ManagerFunctions.DisableTankControls(Tanks); ManagerFunctions.DisableAgentControls(Agents); ClearMines(); ClearShells(); }
public void ReturnToMenu() { StopAllCoroutines(); StartNewRound(); ManagerFunctions.ResetSpawnPoints(Spawns); NameManager.Instance.InitNames(); ScoreManager.Instance.ClearScores(); Camera MainCamera = GameObject.FindObjectOfType <Camera>(); DestroyTanks(); PauseMenu.SetActive(false); MenuCanvas.SetActive(true); MainMenu.SetActive(true); ConfigMenu.SetActive(false); }
private IEnumerator GameEnding() { //// As soon as the round begins playing let the players control the tanks. ManagerFunctions.ResetSpawnPoints(Spawns); NameManager.Instance.InitNames(); ManagerFunctions.EnableScoreBoard(true, ScorePanel); ScoreManager.Instance.ClearScores(); StartNewRound(); PlayerScore[] TankScores = GameObject.FindObjectsOfType <PlayerScore>(); PlayerScore WinningTank = TankScores[0]; foreach (PlayerScore S in TankScores) { if (S.Score > WinningTank.Score) { WinningTank = S; } } MessageText.text = WinningTank.GetComponent <PlayerName>().GetCurrentName() + " WINS"; WinningTank.gameObject.transform.position = new Vector3(0.0f, 1.0f, 0.0f); Camera MainCamera = GameObject.FindObjectOfType <Camera>(); MainCamera.GetComponent <Animator>().SetTrigger("WinIn"); MenuButton.SetActive(true); StopAllCoroutines(); yield return(null); }
private void AddEmployeeDel_Click(object sender, RoutedEventArgs e) { try { var name = AddEmployeeName.Text; var store = Dbs.GetStores().FirstOrDefault(x => x.StoreId == CurrentEmployee.StoreId); var manFunc = new ManagerFunctions(Dbs); manFunc.DelEmployee(name, store); } catch { if (AddEmployeePIN.Background != Brushes.Transparent) { AddEmployeePIN.Background = Brushes.Transparent; } AddEmployeeMsg.Content = "Failed to deleted!"; AddEmployeeMsg.Visibility = Visibility.Visible; return; } AddEmployeeMsg.Content = "Successfully deleted!"; AddEmployeeMsg.Visibility = Visibility.Visible; }
private IEnumerator RoundBreak() { TimeLeft = 10; CurrentRound++; StartNewRound(); ManagerFunctions.EnableScoreBoard(true, ScorePanel); while (TimeLeft > 1) { TimeLeft -= Time.deltaTime; if (TimeLeft > 3) { CountDownText.text = string.Empty; MessageText.text = "ROUND " + CurrentRound.ToString(); } else { if (ScorePanel.activeInHierarchy) { ManagerFunctions.EnableScoreBoard(false, ScorePanel); } CountDownText.text = (TimeLeft).ToString("0"); MessageText.text = string.Empty; } yield return(null); } NextState = RoundPlaying(); yield return(null); }