From f807bea0982a2e03de0bbb25504044a421c9fea1 Mon Sep 17 00:00:00 2001 From: "ns.potapov" Date: Tue, 30 Apr 2024 23:22:25 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B5=D0=B0=D0=BB=D0=B8=D0=B7=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D0=BB=20=D1=84=D0=BE=D1=80=D0=BC=D1=83=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B8=D0=B2=D1=8F=D0=B7=D0=BA=D0=B8=20=D1=80=D0=B5=D1=86?= =?UTF-8?q?=D0=B5=D0=BF=D1=82=D0=B0=20=D0=BA=20=D0=BA=D1=83=D1=80=D1=81?= =?UTF-8?q?=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/HomeController.cs | 14 +++++++ .../SiteMenuItems.cs | 3 +- .../Views/Home/AddRecipeToCourse.cshtml | 41 +++++++++++++++++++ 3 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 Polyclinic/PolyclinicWebAppImplementer/Views/Home/AddRecipeToCourse.cshtml diff --git a/Polyclinic/PolyclinicWebAppImplementer/Controllers/HomeController.cs b/Polyclinic/PolyclinicWebAppImplementer/Controllers/HomeController.cs index 109828d..13ecb68 100644 --- a/Polyclinic/PolyclinicWebAppImplementer/Controllers/HomeController.cs +++ b/Polyclinic/PolyclinicWebAppImplementer/Controllers/HomeController.cs @@ -90,6 +90,20 @@ namespace PolyclinicWebAppImplementer.Controllers return View(); } + [HttpGet] + [HttpPost] + public IActionResult AddRecipeToCourse() + { + if (HttpContext.Request.Method == "POST") + { + return Redirect("~/"); + } + else + { + return View(); + } + } + [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] public IActionResult Error() { diff --git a/Polyclinic/PolyclinicWebAppImplementer/SiteMenuItems.cs b/Polyclinic/PolyclinicWebAppImplementer/SiteMenuItems.cs index 07da28a..17a027e 100644 --- a/Polyclinic/PolyclinicWebAppImplementer/SiteMenuItems.cs +++ b/Polyclinic/PolyclinicWebAppImplementer/SiteMenuItems.cs @@ -12,10 +12,11 @@ public static (string Url, string Title) Login = ("Login", "Вход"); public static (string Url, string Title) Register = ("Register", "Регистрация"); public static (string Url, string Title) Privacy = ("Privacy", "Политика приватности"); + public static (string Url, string Title) AddRecipeToCourse = ("AddRecipeToCourse", "Привязка рецепта"); public static List<(string Url, string Title)> MenuItemsOrder = new List<(string Url, string Title)> { - Index, Courses, Diagnoses, Symptomes, Login, Register + Index, Courses, Diagnoses, Symptomes, Login, Register, AddRecipeToCourse }; } } diff --git a/Polyclinic/PolyclinicWebAppImplementer/Views/Home/AddRecipeToCourse.cshtml b/Polyclinic/PolyclinicWebAppImplementer/Views/Home/AddRecipeToCourse.cshtml new file mode 100644 index 0000000..dcb83dc --- /dev/null +++ b/Polyclinic/PolyclinicWebAppImplementer/Views/Home/AddRecipeToCourse.cshtml @@ -0,0 +1,41 @@ +@{ + ViewBag.SelectedSiteMenuItem = SiteMenuItems.Course; +} +

Привязка рецепта к курсу

+
+
+
+
Рецепт
+ +
+
+
+
+
Курс
+ +
+
+
+
+ +
+
+
\ No newline at end of file