public IActionResult Index() { Console.WriteLine("------------------"); Console.WriteLine("Je n'ai pas réussi à mettre en place le décompte"); Console.WriteLine("Même chose pour l'indicateur de risque de bouchon"); Console.WriteLine("------------------"); List <Fermeture> fermetures = GetFermetureFromApi(); fermetures.Sort(); Fermeture fermeture = fermetures[0]; DateTime now = DateTime.Now; int i = 0; while (DateTime.Compare(fermeture.ClosingDate, now) <= 0) { fermeture = fermetures[i]; i++; } fermeture.Duration = fermeture.ReopeningDate.Subtract(fermeture.ClosingDate); fermeture.ClosingDateString = fermeture.ClosingDate.ToString("dddd, dd MMMM yyyy HH:mm"); fermeture.ReopeningDateString = fermeture.ReopeningDate.ToString("dddd dd MMMM yyyy HH:mm"); return(View(fermeture)); }
// Use this for initialization void Start() //Mise en Place de la Scene. { End = GameObject.Find("End"); Star1 = GameObject.Find("1 Star"); Star2 = GameObject.Find("2 Star"); Star3 = GameObject.Find("3 Star"); Star1.SetActive(false); Star2.SetActive(false); Star3.SetActive(false); Fermeture = GameObject.Find("Fermeture"); Bienjoue = GameObject.Find("BienJoué"); genial = GameObject.Find("Génial"); excellent = GameObject.Find("Excellent"); score = GameObject.Find("Score"); Fermeture.SetActive(false); Bienjoue.SetActive(false); genial.SetActive(false); excellent.SetActive(false); next = GameObject.Find("Next Level").GetComponent <Button>(); score.GetComponent <Text>().text = "Score: " + GameManager.Score.ToString(); switch (GameManager.Stars) { case 0: GameObject.Find("Main Camera").GetComponent <AudioSource>().clip = bad; GameObject.Find("Main Camera").GetComponent <AudioSource>().Play(); Fermeture.SetActive(true); next.interactable = false; break; case 1: GameObject.Find("Main Camera").GetComponent <AudioSource>().clip = applause; GameObject.Find("Main Camera").GetComponent <AudioSource>().Play(); Bienjoue.SetActive(true); Star1.SetActive(true); break; case 2: GameObject.Find("Main Camera").GetComponent <AudioSource>().clip = applause; GameObject.Find("Main Camera").GetComponent <AudioSource>().Play(); genial.SetActive(true); Star1.SetActive(true); Star2.SetActive(true); break; case 3: GameObject.Find("Main Camera").GetComponent <AudioSource>().clip = applause; GameObject.Find("Main Camera").GetComponent <AudioSource>().Play(); excellent.SetActive(true); Star1.SetActive(true); GameObject.Find("Canvas").GetComponent <AudioSource>().PlayOneShot(good); Star2.SetActive(true); Star3.SetActive(true); break; } }
public IActionResult Fermeture(int id) { List <Fermeture> fermetures = GetFermetureFromApi(); Fermeture fermeture = fermetures[id]; fermeture.Duration = fermeture.ReopeningDate.Subtract(fermeture.ClosingDate); fermeture.ClosingDateString = fermeture.ClosingDate.ToString("dddd, dd MMMM yyyy HH:mm"); fermeture.ReopeningDateString = fermeture.ReopeningDate.ToString("dddd dd MMMM yyyy HH:mm"); return(View(fermeture)); }