diff --git a/EGUI/lab2/Controllers/LoginController.cs b/EGUI/lab2/Controllers/LoginController.cs new file mode 100644 index 00000000..05a3d334 --- /dev/null +++ b/EGUI/lab2/Controllers/LoginController.cs @@ -0,0 +1,17 @@ +using Microsoft.AspNetCore.Mvc; +using System.Text.Encodings.Web; + +namespace MvcMovie.Controllers +{ + public class LoginController : Controller + { + // + // GET: /HelloWorld/ + + public IActionResult Index() + { + return View(); + } + + } +} \ No newline at end of file diff --git a/EGUI/lab2/Controllers/RegisterController.cs b/EGUI/lab2/Controllers/RegisterController.cs new file mode 100644 index 00000000..38c3bdb6 --- /dev/null +++ b/EGUI/lab2/Controllers/RegisterController.cs @@ -0,0 +1,25 @@ +using Microsoft.AspNetCore.Mvc; +using System.Text.Encodings.Web; + +namespace MvcMovie.Controllers +{ + public class RegisterController : Controller + { + // + // GET: /HelloWorld/ + + public IActionResult Index() + { + return View(); + } + + + // + // GET: /HelloWorld/Welcome/ + + public string Welcome(string name, int numTimes = 19) + { + return HtmlEncoder.Default.Encode($"Hello {name}, NumTimes is: {numTimes}"); + } + } +} \ No newline at end of file diff --git a/EGUI/lab2/Models/User.cs b/EGUI/lab2/Models/User.cs new file mode 100644 index 00000000..6cac36bf --- /dev/null +++ b/EGUI/lab2/Models/User.cs @@ -0,0 +1,13 @@ +using System.ComponentModel.DataAnnotations; + +namespace MvcMovie.Models +{ + public class User + { + + public string? email { get; set; } + public int ID { get; set; } + + public string? password { get; set; } + } +} \ No newline at end of file diff --git a/EGUI/lab2/Views/Home/Index.cshtml b/EGUI/lab2/Views/Home/Index.cshtml index 08a5a5ca..18f50f5b 100644 --- a/EGUI/lab2/Views/Home/Index.cshtml +++ b/EGUI/lab2/Views/Home/Index.cshtml @@ -3,6 +3,6 @@ }
Learn about building Web apps with ASP.NET Core.
+Hello, world! The time on the server is @DateTime.Now.