Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions WebApplicationLesson1/Controllers/HelloController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace WebApplicationLesson1.Controllers
{
public class HelloController : Controller
{
public string Hello()
{
int currentHour = DateTime.Now.Hour;
if (currentHour < 6) return "Доброй ночи!";
else if (currentHour < 12) return "Доброе утро!";
else if (currentHour < 18) return "Добрый день!";
else return "Добрый вечер!";
}
}
}