void Start() { player = GameObject.Find("Partner").GetComponent <SpriteRenderer>(); playerData = GameObject.Find("PlayerData").GetComponent <PlayerData>(); timeClock = GameObject.Find("ClockMain").GetComponent <TimeClock>(); activeTimeSet = GameObject.Find("PlayerData").GetComponent <ActiveTimeSet>(); }
public override void Update(GameClock time) { base.Update(time); //update all timers TimeClock.Update(time); }
public async Task <IActionResult> Edit(int id, [Bind("ID,ClockIn,InLunch,OutLunch,ClockOut,TotalHrs")] TimeClock timeClock) { if (id != timeClock.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(timeClock); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TimeClockExists(timeClock.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(timeClock)); }
public async System.Threading.Tasks.Task <IActionResult> Edit(int id, [Bind("TimeClockId,ClockIn,ClockOut,HoursWorked,EmployeeId,Summary,ShopOrderNumber,MachineId,Id")] TimeClock timeClock) { if (id != timeClock.TimeClockId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(timeClock); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TimeClockExists(timeClock.TimeClockId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["EmployeeId"] = new SelectList(_context.Employee, "EmployeeId", "EmployeeId", timeClock.EmployeeId); return(View(timeClock)); }
private void CellLeftClickMethod(object sender, RoutedEventArgs e) { var clickedCell = (Cell)e.OriginalSource; if (clickedCell.IsFlag || Turn == Constats.GameOver || !clickedCell.IsEnabled) { return; } if (Turn == Constats.FirstMove) { DeployMines(clickedCell); TimeClock.Start(); } if (clickedCell.IsMine) { TriggerGameOver(clickedCell); } else { Turn++; OpenCell(clickedCell); } if (Turn == Settings.RowCount * Settings.ColumnCount - Settings.MineCount) { TimeClock.Stop(); MessageBox.Show("YOU WON!"); Turn = Constats.GameOver; } }
public ActionResult ClockIn(TimeClock model) { var userId = User.Identity.GetUserId(); if (model.Id == 0) { var timeIn = new TimeClock { TimeIn = DateTime.UtcNow, ApplicationUserId = userId, TimeOut = DateTime.MaxValue }; _context.TimeClocks.Add(timeIn); _context.SaveChanges(); TempData["PunchITMessage"] = "Your working hours starts now. Have a wonderful day."; return(Redirect("TimeInput")); } var timeOut = _context.TimeClocks.FirstOrDefault(t => t.Id == model.Id && t.ApplicationUserId == userId); timeOut.TimeOut = DateTime.UtcNow; _context.SaveChanges(); return(Redirect("TimeInput")); }
/// <summary> /// Start from floor 0, go up to maximum floor of passengers, and /// then back to floor 0. /// </summary> /// <param name="timeClock"></param> /// <param name="trip"></param> public void RunElevatorRoundTrip( ref TimeClock timeClock, Trip trip, ref int roryTime, ref int lastTripFinishTime, int tripIndex) { int maximumValue = 0; // need to go to each floor of passengers, unload passengers if (trip.students.Count() > 0) { maximumValue = trip.students.Max(s => s.Floor); } if (trip.teachers.Count() > 0) { int value2 = trip.teachers.Max(s => s.Floor); if (value2 > maximumValue) { maximumValue = value2; } } updateRoryTime(trip.students, ref roryTime, tripIndex); updateRoryTime(trip.teachers, ref roryTime, tripIndex); // need to go back to floor 0 lastTripFinishTime = timeClock.Time + maximumValue; timeClock.Time += 2 * maximumValue; }
public ActionResult ClockIn() { var userId = User.Identity.GetUserId(); var timeIn = new TimeClock(); var timeclock = _context.TimeClocks.Where(t => t.ApplicationUserId == userId).OrderByDescending(u => u.TimeIn).Take(1).ToList(); foreach (var entry in timeclock) { var difference = DateTime.MaxValue - entry.TimeOut; double hoursDiff = difference.TotalDays; if (hoursDiff == 0) { var timediff = DateTime.UtcNow - entry.TimeIn; double diffInHours = timediff.TotalHours; if (diffInHours > 4.5) { TempData["PunchITMessage"] = $"Whoa, You must be Tired by now. You are a dedicated Employee and working for a continuous {diffInHours} hours."; } else { TempData["PunchITMessage"] = $"Keep Up the good Work! You are working for {diffInHours} hours."; } timeIn.Id = entry.Id; timeIn.TimeIn = entry.TimeIn; timeIn.ApplicationUserId = entry.ApplicationUserId; return(View(timeIn)); } } TempData["PunchITMessage"] = $"Welcome {userId}, it is a beautiful day. Let's enjoy it with work"; return(View(timeIn)); }
private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { ComboBox combobox = sender as ComboBox; List <TimeClockItem> list = listBox.Items.Cast <TimeClockItem>().ToList(); for (int i = 0; i < list.Count; i++) { if (list[i].ComboBox.Equals(combobox)) { list[i].SelectedName = combobox.SelectedValue.ToString(); for (int j = 0; j < Constants.TimeZonesNames.Count; j++) { if (Constants.TimeZonesNames[j].Equals(combobox.SelectedValue.ToString())) { list[i].Offset = j - 11; list[i].TextBlock.Text = list[i].Offset.ToString(); AddThread(list[i]); TimeClock temp = new TimeClock(list[i].Offset, list[i].SelectedName, UserManager.GetCurrentUser()); EntityWrapper.AddTimeClock(temp); list[i].Guid = temp.Guid; break; } } } } combobox.IsEnabled = false; addButton.IsEnabled = true; }
protected override void OnInstall() { this.delaytime = float.Parse(base.m_SkillData.Args[0]); this.hitratio = float.Parse(base.m_SkillData.Args[1]); this.range = float.Parse(base.m_SkillData.Args[2]); this.clockindex = TimeClock.Register("SkillAlone1042", this.delaytime, new Action(this.OnAttack)); }
public async System.Threading.Tasks.Task <IActionResult> ClockIn(TimeClock timeClock) { if (ModelState.IsValid) { timeClock = new TimeClock(); string empId = User.FindFirst(ClaimTypes.NameIdentifier).Value; Employee loggedInEmployee = _context.Employee.Where(i => i.ApplicationId == empId).SingleOrDefault(); timeClock.EmployeeId = loggedInEmployee.EmployeeId; timeClock.ClockIn = DateTime.Now; if (timeClock.ClockOut == null) { throw new System.ArgumentException("You need to clock out first!"); //return RedirectToAction("ClockIn", "TimeClocks"); } else { _context.Add(timeClock); await _context.SaveChangesAsync(); return(RedirectToAction("Index", "Home")); //return RedirectToAction("ClockIn", "TimeClocks"); } } ViewData["EmployeeId"] = new SelectList(_context.Employee, "EmployeeId", "EmployeeId", timeClock.EmployeeId); return(View(timeClock)); }
// Start is called before the first frame update void Start() { player = GetComponent <Rigidbody>(); _audioSource = GetComponent <AudioSource>(); _scriptTimeClock = timeTxt.GetComponent <TimeClock>(); Physics.gravity = gravityMultiplier * new Vector3(0, -9.81f, 0); }
protected override void OnInstall() { Debug.Log("1076 create"); this.bulletid = int.Parse(base.m_SkillData.Args[0]); this.delaytime = float.Parse(base.m_SkillData.Args[1]); this.hitratio = float.Parse(base.m_SkillData.Args[2]); this.clockindex = TimeClock.Register("SkillAlone1076", this.delaytime, new Action(this.OnAttack)); }
/// <summary> /// Start from floor 0, go up to maximum floor of passengers, and /// then back to floor 0. /// </summary> /// <param name="timeClock"></param> /// <param name="trip"></param> public void RunElevatorRoundTrip( ref TimeClock timeClock, Trip trip, ref int roryTime, ref int lastTripFinishTime, int tripIndex) { int maximumValue = 0; // need to go to each floor of passengers, unload passengers if (trip.students.Count() > 0) { maximumValue = trip.students.Max(s => s.Floor); } if (trip.teachers.Count() > 0) { int value2 = trip.teachers.Max(s => s.Floor); if (value2 > maximumValue) { maximumValue = value2; } } /* * maximumValue = Math.Max(trip.students.Max(s => s.Floor), * trip.teachers.Max(s => s.Floor)); */ var foundRoryPassenger = trip.students.Where(s => s.isRory).Count(); if (foundRoryPassenger > 0) { var rory = trip.students.Where(s => s.isRory); foreach (Passenger p in rory) { roryTime = tripIndex; break; } } var foundRoryPassenger2 = trip.teachers.Where(s => s.isRory).Count(); if (foundRoryPassenger2 > 0) { var rory = trip.teachers.Where(s => s.isRory); foreach (Passenger p in rory) { roryTime = tripIndex; break; } } // need to go back to floor 0 lastTripFinishTime = timeClock.Time + maximumValue; timeClock.Time += 2 * maximumValue; }
public MainWindow() { InitializeComponent(); Server server = new Server(); this.DataContext = server; TimeClock timeClock = new TimeClock(); Console.WriteLine(timeClock.GetNetworkTime()); }
public async Task <IActionResult> Create([Bind("ID,ClockIn,InLunch,OutLunch,ClockOut,TotalHrs")] TimeClock timeClock) { if (ModelState.IsValid) { _context.Add(timeClock); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(timeClock)); }
// Use this for initialization void Start() { t = maxT; gm = GetComponent <GameManager>(); cm = GetComponent <CardManager>(); tc = transform.Find("Clock").GetComponent <TimeClock>(); for (int i = 0; i < clockPos.Length; i++) { clockPos[i] = transform.Find("ClockPos/" + (i + 1).ToString()); } }
public void Release() { Time.timeScale = 1f; this.Bullet.Release(); this.PlayerBullet.Release(); this.Effect.Release(); this.Form.Release(); this.GoodsCreate.Release(); if (this._Path != null) { this._Path.DeInit(); } this.Game.Release(); this.EntityCache.Release(); this.Entity.DeInit(); this.Mode.DeInit(); this.MapEffect.Release(); LocalModelManager.Instance.Drop_Drop.ClearGoldDrop(); CInstance <TipsManager> .Instance.Clear(); Updater.GetUpdater().OnRelease(); Updater.UpdaterDeinit(); Goods1151.DoorData.DeInit(); Object.DestroyImmediate(GameNode.m_Battle); GameNode.MapCacheNode.DestroyChildren(); GameLogic.Hold.Sound.DeInit(); if (this._MapCreator != null) { this._MapCreator.Deinit(); } if (this._Entity != null) { Object.DestroyImmediate(this._Entity.gameObject); this._Entity = null; } TimerBase <Timer> .Unregister(); TimeClock.Clear(); GameNode.m_HP.DestroyChildren(); this._Game = null; this._Bullet = null; this._PlayerBullet = null; this._Effect = null; this._MapEffect = null; this._EntityCache = null; this._MapCreator = null; this._Path = null; this._GoodsCreate = null; this._Mode = null; this._Form = null; Goods1151.DoorData = null; GC.Collect(); }
public MainForm(Postgres postgres) { this.postgres = postgres; timeClock = new TimeClock(postgres); InitializeComponent(); sessionKeyTextBox.MaxLength = 4; getShippers(); }
public async System.Threading.Tasks.Task <IActionResult> Create([Bind("TimeClockId,ClockIn,ClockOut,HoursWorked,EmployeeId")] TimeClock timeClock) { if (ModelState.IsValid) { _context.Add(timeClock); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["EmployeeId"] = new SelectList(_context.Employee, "EmployeeId", "EmployeeId", timeClock.EmployeeId); return(View(timeClock)); }
private void StartNewGame() { Turn = 0; AdjustGrid(); FillCells(); MinesLeft = Settings.MineCount; RefreshMineInfoTextBox(); TimeClock.Reset(); }
public int TimeClockBreakStatus(TimeClock model) { using (var connection = base.GetConnection) { var sql = "[Subzz_Users].[Users].[InsertClockInInfo]"; var queryParams = new DynamicParameters(); queryParams.Add("@UserId", model.UserId); queryParams.Add("@Date", null); queryParams.Add("@ClockInTime", null); queryParams.Add("@ClockOutTime", null); queryParams.Add("@Activity", model.Activity); queryParams.Add("@Status", 1); connection.ExecuteScalar <int>(sql, queryParams, commandType: System.Data.CommandType.StoredProcedure); } return(1); }
public int InsertClockOutTimeNew(TimeClock model) { using (var connection = base.GetConnection) { var sql = "[Subzz_Users].[Users].[InsertTimeClockInfo]"; var queryParams = new DynamicParameters(); queryParams.Add("@UserId", model.UserIdd); queryParams.Add("@UpdatedOn", model.UpdatedOn); queryParams.Add("@ActivityTime", model.ActivityTime); queryParams.Add("@BreakTime", null); queryParams.Add("@ReturnFromBreakTime", null); queryParams.Add("@Activity", model.Activity); queryParams.Add("@ParentId", null); connection.ExecuteScalar <int>(sql, queryParams, commandType: System.Data.CommandType.StoredProcedure); } return(1); }
void FindComponents() { ageText = GameObject.Find("AgeText").GetComponent <Text>(); weightText = GameObject.Find("WeightText").GetComponent <Text>(); stageText = GameObject.Find("StageText").GetComponent <Text>(); careMistakesText = GameObject.Find("CareMistakesText").GetComponent <Text>(); foodButton = GameObject.Find("Food").GetComponent <Image>(); toiletButton = GameObject.Find("Toilet").GetComponent <Image>(); sleepButton = GameObject.Find("Sleep").GetComponent <Image>(); sickButton = GameObject.Find("Bandage").GetComponent <Image>(); tiredButton = GameObject.Find("Rest").GetComponent <Image>(); happinessSlider = GameObject.Find("Happiness").GetComponent <Slider>(); disciplineSlider = GameObject.Find("Discipline").GetComponent <Slider>(); monsterData = GameObject.Find("PlayerData").GetComponent <MonsterData>(); timeClock = GameObject.Find("ClockMain").GetComponent <TimeClock>(); }
private void Direction_MouseDown(object sender, MouseEventArgs e) { ImgBtn imgBtn = sender as ImgBtn; imgBtn.btnClickDown(); String directName = imgBtn.Name; directName = directName.Remove(0, 3); directionType = (DirectionType)Enum.Parse(typeof(DirectionType), directName, true); if (timeClock == null) { timeClock = new TimeClock(timMain.Interval, 1); } timeClock.PressButtonEnable = true; timMain.Enabled = true; shapeOperManager.MovePlus(directionType); ShowNeedleInfo(); picDrawBackGround.Image = shapeOperManager.GetShapeBitmap(); }
public async Task <IEnumerable <TimeClock> > GetTimeClockData(TimeClock model) { using (var connection = base.GetConnection) { try { var sql = "[Subzz_Users].[Users].[GetTimeClockData]"; var queryParams = new DynamicParameters(); queryParams.Add("@UserId", model.UserId); return(await connection.QueryAsync <TimeClock>(sql, queryParams, commandType : System.Data.CommandType.StoredProcedure)); } catch (Exception ex) { } finally { } } return(null); }
public string CheckTimeClockStatus(TimeClock model) { using (var connection = base.GetConnection) { try { var sql = "[Subzz_Users].[Users].[CheckTimeCLockStatus]"; var queryParams = new DynamicParameters(); queryParams.Add("@UserId", model.UserId); return(connection.ExecuteScalar <string>(sql, queryParams, commandType: System.Data.CommandType.StoredProcedure)); } catch (Exception ex) { } finally { } return(null); } }
public async System.Threading.Tasks.Task <IActionResult> ClockOut(int id, [Bind("TimeClockId,ClockIn,ClockOut,HoursWorked,EmployeeId,MachineId,ShopOrderNumber,Task,Summary,Id,TaskId")] TimeClock timeClock) { if (id != timeClock.TimeClockId) { return(NotFound()); } if (ModelState.IsValid) { try { timeClock.ClockOut = DateTime.Now; timeClock.HoursWorked = timeClock.ClockOut.Subtract(timeClock.ClockIn); timeClock.Summary = timeClock.Summary; timeClock.Task = timeClock.Task; timeClock.Id = timeClock.Id; timeClock.MachineId = timeClock.MachineId; timeClock.ShopOrderNumber = timeClock.ShopOrderNumber; //ViewData["ShopOrderNumber"] = new SelectList(_context.ShopOrder, "ShopOrderNumber", "ShopOrderNumber"); _context.Update(timeClock); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TimeClockExists(timeClock.TimeClockId)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index", "TimeClocks")); } //ViewData["EmployeeId"] = new SelectList(_context.Employee, "EmployeeId", "EmployeeId", timeClock.EmployeeId); return(View(timeClock)); }
public ActionResult Clock(ClockInViewModel viewModel) { try { ViewBag.ClockInResult = false; var emp = db.Employees.SearchByCardNumberOrId(viewModel.Credentials); if (emp.Disabled) { ViewBag.ClockMessage = "This isn't an active employee."; return(View()); } var empId = emp.EmployeeId; var tc = new TimeClock(db); if (tc.ClockInOrOut(empId)) { ViewBag.ClockMessage = "Welcome, " + emp.FirstName + "! You have clocked in."; ViewBag.ClockInResult = true; } else { ViewBag.ClockMessage = "You have clocked out, " + emp.FirstName + ". Have a nice day!"; } } catch (NullReferenceException) { ViewBag.ClockMessage = "There's no one assigned to that number."; } catch (Exception) { ViewBag.ClockMessage = "Something happened! 8("; } return(View()); }
private void TriggerGameOver(Cell triggeredCell) { Turn = Constats.GameOver; triggeredCell.TriggerPrimaryExplosion(); for (int i = 0; i < CellCanvas.Children.Count; i++) { var cell = (Cell)CellCanvas.Children[i]; if (cell.ID != triggeredCell.ID && !cell.IsFlag && cell.IsMine) { cell.TriggerSecondaryExplosion(); } else if (cell.ID != triggeredCell.ID && cell.IsFlag && !cell.IsMine) { cell.MarkWrongFlag(); } } TimeClock.Stop(); MessageBox.Show("GAME OVER!"); }