From adfee2204d5f1f4f24688afa183dff867bd00d83 Mon Sep 17 00:00:00 2001 From: Tamikon Date: Tue, 2 Apr 2024 20:59:53 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B7=D0=B0=D0=B4=D0=B0=D0=BD=D0=B8=D0=B5=202.?= =?UTF-8?q?1.1?= 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..51061de --- /dev/null +++ b/WebApplicationLesson1/Controllers/StartController.cs @@ -0,0 +1,27 @@ +using Microsoft.AspNetCore.Mvc; +using System; +using System.Data; + +namespace WebApplicationLesson1.Controllers +{ + public class StartController : Controller + { + public string Hello() + { + var hour = DateTime.Now.Hour; + if (hour < 6) + { + return "Доброй ночи"; + } + if (hour < 12) + { + return "Доброе утро"; + } + if (hour < 18) + { + return "Добрый день"; + } + return "Добрый вечер"; + } + } +}