From 9bc04a98ac38781e46397a3b437975e5327db2f4 Mon Sep 17 00:00:00 2001 From: Mihailqwefr Date: Sun, 31 Mar 2024 17:04:56 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20he?= =?UTF-8?q?llo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/StartController.cs | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 WebApplicationLesson1/Controllers/StartController.cs diff --git a/WebApplicationLesson1/Controllers/StartController.cs b/WebApplicationLesson1/Controllers/StartController.cs new file mode 100644 index 0000000..9730924 --- /dev/null +++ b/WebApplicationLesson1/Controllers/StartController.cs @@ -0,0 +1,27 @@ +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using System; + +namespace WebApplicationLesson1.Controllers +{ + public class StartController : Controller + { + public string Hello() + { + if (DateTime.Now.Hour < 6) + { + return "Доброй ночи!"; + } + if (DateTime.Now.Hour < 12) + { + return "Доброе утро!"; + } + if (DateTime.Now.Hour < 18) + { + return "Добрый день!"; + } + + else return "Добрый вечер!"; + } + } +}