public async Task <IActionResult> Edit(int id, [Bind("Id,StartDate,EndDate," + "SpecialEvents,SpecialShabassos,Months,Parshios,StartTime,EndTime,EventDescription")] YearlyEvents yearlyEvents) { if (id != yearlyEvents.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(yearlyEvents); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!YearlyEventsExists(yearlyEvents.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(yearlyEvents)); }
public static void StartEvent(YearlyEvents yearlyEvent) { switch (yearlyEvent) { case YearlyEvents.AdvanceTime: AdvanceTime(); break; case YearlyEvents.NewYear: YearlyNewYear(); break; case YearlyEvents.Spring: YearlySpring(); break; case YearlyEvents.MidSummer: YearlyMidSummer(); break; case YearlyEvents.Harvest: YearlyHarvest(); break; case YearlyEvents.Christmas: YearlyChristmas(); break; } }
void Start() { gameManager = GameObject.FindGameObjectWithTag("GameManager").GetComponent <GameManager>(); yearlyEvents = GameObject.FindGameObjectWithTag("GameManager").GetComponent <YearlyEvents>(); cameraMove = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <CameraMove>(); statsUI = GetComponent <StatsUI>(); resourceUI = GetComponent <ResourceUI>(); }
public async Task <IActionResult> Create ([Bind("Id,StartingDate,EndingDate,SpecialEvents,SpecialShabassos," + "Months,Parshios,StartTime,EndTime,LifeEvents,EventDescription")] YearlyEvents yearlyEvents) { if (ModelState.IsValid) { _context.Add(yearlyEvents); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(yearlyEvents)); }