Ver código fonte

first commit

petrbihteev 3 anos atrás
commit
98707e3f1d
100 arquivos alterados com 4254 adições e 0 exclusões
  1. BIN
      .vs/HallOfFame/DesignTimeBuild/.dtbcache.v2
  2. BIN
      .vs/HallOfFame/v16/.suo
  3. BIN
      .vs/HallOfFame/v17/.futdcache.v1
  4. BIN
      .vs/HallOfFame/v17/.suo
  5. 25 0
      HallOfFame.sln
  6. 32 0
      HallOfFame/Controllers/HomeController.cs
  7. 82 0
      HallOfFame/Controllers/PersonController.cs
  8. 21 0
      HallOfFame/HallOfFame.csproj
  9. 14 0
      HallOfFame/HallOfFame.csproj.user
  10. 23 0
      HallOfFame/Models/ConPersonSkill.cs
  11. 9 0
      HallOfFame/Models/ErrorViewModel.cs
  12. 22 0
      HallOfFame/Models/Person.cs
  13. 59 0
      HallOfFame/Models/PersonDBContext.cs
  14. 22 0
      HallOfFame/Models/Skill.cs
  15. 31 0
      HallOfFame/Program.cs
  16. 28 0
      HallOfFame/Properties/launchSettings.json
  17. 10 0
      HallOfFame/Views/Home/Index.cshtml
  18. 6 0
      HallOfFame/Views/Home/Privacy.cshtml
  19. 28 0
      HallOfFame/Views/Person/Create.cshtml
  20. 28 0
      HallOfFame/Views/Person/Edit.cshtml
  21. 67 0
      HallOfFame/Views/Person/Index.cshtml
  22. 29 0
      HallOfFame/Views/Person/Result.cshtml
  23. 49 0
      HallOfFame/Views/Person/ViewSkill.cshtml
  24. 25 0
      HallOfFame/Views/Shared/Error.cshtml
  25. 43 0
      HallOfFame/Views/Shared/_Layout.cshtml
  26. 48 0
      HallOfFame/Views/Shared/_Layout.cshtml.css
  27. 2 0
      HallOfFame/Views/Shared/_ValidationScriptsPartial.cshtml
  28. 3 0
      HallOfFame/Views/_ViewImports.cshtml
  29. 3 0
      HallOfFame/Views/_ViewStart.cshtml
  30. 8 0
      HallOfFame/appsettings.Development.json
  31. 12 0
      HallOfFame/appsettings.json
  32. 3505 0
      HallOfFame/bin/Debug/net6.0/HallOfFame.deps.json
  33. BIN
      HallOfFame/bin/Debug/net6.0/HallOfFame.dll
  34. BIN
      HallOfFame/bin/Debug/net6.0/HallOfFame.exe
  35. BIN
      HallOfFame/bin/Debug/net6.0/HallOfFame.pdb
  36. 19 0
      HallOfFame/bin/Debug/net6.0/HallOfFame.runtimeconfig.json
  37. 1 0
      HallOfFame/bin/Debug/net6.0/HallOfFame.staticwebassets.runtime.json
  38. BIN
      HallOfFame/bin/Debug/net6.0/Humanizer.dll
  39. BIN
      HallOfFame/bin/Debug/net6.0/MessagePack.Annotations.dll
  40. BIN
      HallOfFame/bin/Debug/net6.0/MessagePack.dll
  41. BIN
      HallOfFame/bin/Debug/net6.0/Microsoft.AspNetCore.Razor.Language.dll
  42. BIN
      HallOfFame/bin/Debug/net6.0/Microsoft.Bcl.AsyncInterfaces.dll
  43. BIN
      HallOfFame/bin/Debug/net6.0/Microsoft.Build.Locator.dll
  44. BIN
      HallOfFame/bin/Debug/net6.0/Microsoft.CodeAnalysis.AnalyzerUtilities.dll
  45. BIN
      HallOfFame/bin/Debug/net6.0/Microsoft.CodeAnalysis.CSharp.Features.dll
  46. BIN
      HallOfFame/bin/Debug/net6.0/Microsoft.CodeAnalysis.CSharp.Scripting.dll
  47. BIN
      HallOfFame/bin/Debug/net6.0/Microsoft.CodeAnalysis.CSharp.Workspaces.dll
  48. BIN
      HallOfFame/bin/Debug/net6.0/Microsoft.CodeAnalysis.CSharp.dll
  49. BIN
      HallOfFame/bin/Debug/net6.0/Microsoft.CodeAnalysis.Features.dll
  50. BIN
      HallOfFame/bin/Debug/net6.0/Microsoft.CodeAnalysis.Razor.dll
  51. BIN
      HallOfFame/bin/Debug/net6.0/Microsoft.CodeAnalysis.Scripting.dll
  52. BIN
      HallOfFame/bin/Debug/net6.0/Microsoft.CodeAnalysis.VisualBasic.Features.dll
  53. BIN
      HallOfFame/bin/Debug/net6.0/Microsoft.CodeAnalysis.VisualBasic.Workspaces.dll
  54. BIN
      HallOfFame/bin/Debug/net6.0/Microsoft.CodeAnalysis.VisualBasic.dll
  55. BIN
      HallOfFame/bin/Debug/net6.0/Microsoft.CodeAnalysis.Workspaces.MSBuild.dll
  56. BIN
      HallOfFame/bin/Debug/net6.0/Microsoft.CodeAnalysis.Workspaces.dll
  57. BIN
      HallOfFame/bin/Debug/net6.0/Microsoft.CodeAnalysis.dll
  58. BIN
      HallOfFame/bin/Debug/net6.0/Microsoft.Data.SqlClient.dll
  59. BIN
      HallOfFame/bin/Debug/net6.0/Microsoft.DiaSymReader.dll
  60. BIN
      HallOfFame/bin/Debug/net6.0/Microsoft.DotNet.Scaffolding.Shared.dll
  61. BIN
      HallOfFame/bin/Debug/net6.0/Microsoft.EntityFrameworkCore.Abstractions.dll
  62. BIN
      HallOfFame/bin/Debug/net6.0/Microsoft.EntityFrameworkCore.Design.dll
  63. BIN
      HallOfFame/bin/Debug/net6.0/Microsoft.EntityFrameworkCore.Relational.dll
  64. BIN
      HallOfFame/bin/Debug/net6.0/Microsoft.EntityFrameworkCore.SqlServer.dll
  65. BIN
      HallOfFame/bin/Debug/net6.0/Microsoft.EntityFrameworkCore.dll
  66. BIN
      HallOfFame/bin/Debug/net6.0/Microsoft.Extensions.Caching.Memory.dll
  67. BIN
      HallOfFame/bin/Debug/net6.0/Microsoft.Identity.Client.dll
  68. BIN
      HallOfFame/bin/Debug/net6.0/Microsoft.IdentityModel.JsonWebTokens.dll
  69. BIN
      HallOfFame/bin/Debug/net6.0/Microsoft.IdentityModel.Logging.dll
  70. BIN
      HallOfFame/bin/Debug/net6.0/Microsoft.IdentityModel.Protocols.OpenIdConnect.dll
  71. BIN
      HallOfFame/bin/Debug/net6.0/Microsoft.IdentityModel.Protocols.dll
  72. BIN
      HallOfFame/bin/Debug/net6.0/Microsoft.IdentityModel.Tokens.dll
  73. BIN
      HallOfFame/bin/Debug/net6.0/Microsoft.OpenApi.dll
  74. BIN
      HallOfFame/bin/Debug/net6.0/Microsoft.VisualStudio.Debugger.Contracts.dll
  75. BIN
      HallOfFame/bin/Debug/net6.0/Microsoft.VisualStudio.Web.CodeGeneration.Core.dll
  76. BIN
      HallOfFame/bin/Debug/net6.0/Microsoft.VisualStudio.Web.CodeGeneration.EntityFrameworkCore.dll
  77. BIN
      HallOfFame/bin/Debug/net6.0/Microsoft.VisualStudio.Web.CodeGeneration.Templating.dll
  78. BIN
      HallOfFame/bin/Debug/net6.0/Microsoft.VisualStudio.Web.CodeGeneration.Utils.dll
  79. BIN
      HallOfFame/bin/Debug/net6.0/Microsoft.VisualStudio.Web.CodeGeneration.dll
  80. BIN
      HallOfFame/bin/Debug/net6.0/Microsoft.VisualStudio.Web.CodeGenerators.Mvc.dll
  81. BIN
      HallOfFame/bin/Debug/net6.0/Microsoft.Win32.SystemEvents.dll
  82. BIN
      HallOfFame/bin/Debug/net6.0/Newtonsoft.Json.dll
  83. BIN
      HallOfFame/bin/Debug/net6.0/NuGet.Common.dll
  84. BIN
      HallOfFame/bin/Debug/net6.0/NuGet.Configuration.dll
  85. BIN
      HallOfFame/bin/Debug/net6.0/NuGet.DependencyResolver.Core.dll
  86. BIN
      HallOfFame/bin/Debug/net6.0/NuGet.Frameworks.dll
  87. BIN
      HallOfFame/bin/Debug/net6.0/NuGet.LibraryModel.dll
  88. BIN
      HallOfFame/bin/Debug/net6.0/NuGet.Packaging.dll
  89. BIN
      HallOfFame/bin/Debug/net6.0/NuGet.ProjectModel.dll
  90. BIN
      HallOfFame/bin/Debug/net6.0/NuGet.Protocol.dll
  91. BIN
      HallOfFame/bin/Debug/net6.0/NuGet.Versioning.dll
  92. BIN
      HallOfFame/bin/Debug/net6.0/Swashbuckle.AspNetCore.Swagger.dll
  93. BIN
      HallOfFame/bin/Debug/net6.0/Swashbuckle.AspNetCore.SwaggerGen.dll
  94. BIN
      HallOfFame/bin/Debug/net6.0/Swashbuckle.AspNetCore.SwaggerUI.dll
  95. BIN
      HallOfFame/bin/Debug/net6.0/System.Composition.AttributedModel.dll
  96. BIN
      HallOfFame/bin/Debug/net6.0/System.Composition.Convention.dll
  97. BIN
      HallOfFame/bin/Debug/net6.0/System.Composition.Hosting.dll
  98. BIN
      HallOfFame/bin/Debug/net6.0/System.Composition.Runtime.dll
  99. BIN
      HallOfFame/bin/Debug/net6.0/System.Composition.TypedParts.dll
  100. 0 0
      HallOfFame/bin/Debug/net6.0/System.Configuration.ConfigurationManager.dll

BIN
.vs/HallOfFame/DesignTimeBuild/.dtbcache.v2


BIN
.vs/HallOfFame/v16/.suo


BIN
.vs/HallOfFame/v17/.futdcache.v1


BIN
.vs/HallOfFame/v17/.suo


+ 25 - 0
HallOfFame.sln

@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.1.32407.343
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HallOfFame", "HallOfFame\HallOfFame.csproj", "{DAC53202-38DA-4BC2-9DF7-B1CDB6FBB5FC}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DAC53202-38DA-4BC2-9DF7-B1CDB6FBB5FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{DAC53202-38DA-4BC2-9DF7-B1CDB6FBB5FC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{DAC53202-38DA-4BC2-9DF7-B1CDB6FBB5FC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{DAC53202-38DA-4BC2-9DF7-B1CDB6FBB5FC}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {7331FFFC-9548-447E-B67C-DE3EFEFF9C4F}
+	EndGlobalSection
+EndGlobal

+ 32 - 0
HallOfFame/Controllers/HomeController.cs

@@ -0,0 +1,32 @@
+using HallOfFame.Models;
+using Microsoft.AspNetCore.Mvc;
+using System.Diagnostics;
+
+namespace HallOfFame.Controllers
+{
+    public class HomeController : Controller
+    {
+        private readonly ILogger<HomeController> _logger;
+
+        public HomeController(ILogger<HomeController> logger)
+        {
+            _logger = logger;
+        }
+
+        public IActionResult Index()
+        {
+            return View();
+        }
+
+        public IActionResult Privacy()
+        {
+            return View();
+        }
+
+        [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
+        public IActionResult Error()
+        {
+            return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
+        }
+    }
+}

+ 82 - 0
HallOfFame/Controllers/PersonController.cs

@@ -0,0 +1,82 @@
+using Microsoft.AspNetCore.Mvc;
+
+namespace HallOfFame.Controllers
+{
+    public class PersonController : Controller
+    {
+        private readonly PersonDBContext _db;
+
+        public PersonController(PersonDBContext db)
+        {
+            _db = db;
+        }
+
+        public IActionResult Index()
+        {
+           IEnumerable<Person> objPersonList = _db.Persons;
+           return View(objPersonList);
+        }
+
+        public IActionResult ViewSkill()
+        {
+            IEnumerable<Skill> objPersonList = _db.Skills;
+            return View(objPersonList);
+        }
+
+        public IActionResult Create()
+        {
+            return View();
+        }
+
+        //POST
+        [HttpPost]
+        [ValidateAntiForgeryToken]
+        public IActionResult Create(Person obj)
+        {
+            _db.Persons.Add(obj);
+            _db.SaveChanges();
+            return RedirectToAction("Index");
+        }
+
+        public IActionResult Edit(long? id)
+        {
+            if (id==null || id == 0)
+            {
+                return NotFound();
+            }
+            var person = _db.Persons.Find(id);
+
+            if (person == null)
+            {
+                return NotFound();
+            }
+            return View(person);
+        }
+
+        public IActionResult Result(long? id)
+        {
+            if (id == null || id == 0)
+            {
+                return NotFound();
+            }
+            var con = _db.ConPersonSkills.Where(x=>x.PersonId == id).ToList();
+
+            if (con == null)
+            {
+                return NotFound();
+            }
+            ViewBag.data = con;
+            return View(con);
+        }
+
+        //POST
+        [HttpPost]
+        [ValidateAntiForgeryToken]
+        public IActionResult Edit(Person obj)
+        {
+            _db.Persons.Update(obj);
+            _db.SaveChanges();
+            return RedirectToAction("Index");
+        }
+    }
+}

+ 21 - 0
HallOfFame/HallOfFame.csproj

@@ -0,0 +1,21 @@
+<Project Sdk="Microsoft.NET.Sdk.Web">
+
+  <PropertyGroup>
+    <TargetFramework>net6.0</TargetFramework>
+    <Nullable>enable</Nullable>
+    <ImplicitUsings>enable</ImplicitUsings>
+    <LangVersion>preview</LangVersion>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.4" />
+    <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.4" />
+    <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.4">
+      <PrivateAssets>all</PrivateAssets>
+      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+    </PackageReference>
+    <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.3" />
+    <PackageReference Include="Swashbuckle.AspNetCore" Version="6.3.0" />
+  </ItemGroup>
+
+</Project>

+ 14 - 0
HallOfFame/HallOfFame.csproj.user

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Controller_SelectedScaffolderID>MvcControllerEmptyScaffolder</Controller_SelectedScaffolderID>
+    <Controller_SelectedScaffolderCategoryPath>root/Common/MVC/Controller</Controller_SelectedScaffolderCategoryPath>
+    <View_SelectedScaffolderID>RazorViewScaffolder</View_SelectedScaffolderID>
+    <View_SelectedScaffolderCategoryPath>root/Common/MVC/View</View_SelectedScaffolderCategoryPath>
+    <WebStackScaffolding_ViewDialogWidth>650,4</WebStackScaffolding_ViewDialogWidth>
+    <WebStackScaffolding_IsLayoutPageSelected>True</WebStackScaffolding_IsLayoutPageSelected>
+    <WebStackScaffolding_IsPartialViewSelected>False</WebStackScaffolding_IsPartialViewSelected>
+    <WebStackScaffolding_IsReferencingScriptLibrariesSelected>False</WebStackScaffolding_IsReferencingScriptLibrariesSelected>
+    <WebStackScaffolding_LayoutPageFile />
+  </PropertyGroup>
+</Project>

+ 23 - 0
HallOfFame/Models/ConPersonSkill.cs

@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace HallOfFame
+{
+    public partial class ConPersonSkill
+    {
+        [Key]
+        public long IdPersonSkill { get; set; }
+        public byte Level { get; set; }
+        [ForeignKey(nameof(Person))]
+        public long PersonId { get; set; }
+        [ForeignKey(nameof(Skill))]
+        public long SkillId { get; set; }
+
+        [InverseProperty("ConPersonSkills")]
+        public virtual Person Person { get; set; } = null!;
+        [InverseProperty("ConPersonSkills")]
+        public virtual Skill Skill { get; set; } = null!;
+    }
+}

+ 9 - 0
HallOfFame/Models/ErrorViewModel.cs

@@ -0,0 +1,9 @@
+namespace HallOfFame.Models
+{
+    public class ErrorViewModel
+    {
+        public string? RequestId { get; set; }
+
+        public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
+    }
+}

+ 22 - 0
HallOfFame/Models/Person.cs

@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace HallOfFame
+{
+    public partial class Person
+    {
+        public Person()
+        {
+            ConPersonSkills = new HashSet<ConPersonSkill>();
+        }
+        [Key]
+        public long Id { get; set; }
+        public string Name { get; set; } = null!;
+        public string DisplayName { get; set; } = null!;
+
+        [InverseProperty("Person")]
+        public virtual ICollection<ConPersonSkill> ConPersonSkills { get; set; }
+    }
+}

+ 59 - 0
HallOfFame/Models/PersonDBContext.cs

@@ -0,0 +1,59 @@
+using System;
+using System.Collections.Generic;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Metadata;
+
+namespace HallOfFame
+{
+    public partial class PersonDBContext : DbContext
+    {
+        public PersonDBContext()
+        {
+        }
+
+        public PersonDBContext(DbContextOptions<PersonDBContext> options)
+            : base(options)
+        {
+        }
+
+        public virtual DbSet<ConPersonSkill> ConPersonSkills { get; set; } = null!;
+        public virtual DbSet<Person> Persons { get; set; } = null!;
+        public virtual DbSet<Skill> Skills { get; set; } = null!;
+
+        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
+        {
+            if (!optionsBuilder.IsConfigured)
+            {
+                optionsBuilder.UseSqlServer("Server=localhost;Database=PersonDB;Trusted_Connection=True;");
+            }
+        }
+
+        protected override void OnModelCreating(ModelBuilder modelBuilder)
+        {
+            modelBuilder.Entity<ConPersonSkill>(entity =>
+            {
+                entity.HasKey(e => e.IdPersonSkill);
+
+                entity.HasIndex(e => e.PersonId, "IX_ConPersonSkills_PersonId");
+
+                entity.HasIndex(e => e.SkillId, "IX_ConPersonSkills_SkillId");
+
+                entity.HasOne(d => d.Person)
+                    .WithMany(p => p.ConPersonSkills)
+                    .HasForeignKey(d => d.PersonId)
+                    .OnDelete(DeleteBehavior.ClientSetNull)
+                    .HasConstraintName("FK_ConPersonSkills_Persons");
+
+                entity.HasOne(d => d.Skill)
+                    .WithMany(p => p.ConPersonSkills)
+                    .HasForeignKey(d => d.SkillId)
+                    .OnDelete(DeleteBehavior.ClientSetNull)
+                    .HasConstraintName("FK_ConPersonSkills_Skills");
+            });
+
+            OnModelCreatingPartial(modelBuilder);
+        }
+
+        partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
+    }
+}

+ 22 - 0
HallOfFame/Models/Skill.cs

@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace HallOfFame
+{
+    public partial class Skill
+    {
+        public Skill()
+        {
+            ConPersonSkills = new HashSet<ConPersonSkill>();
+        }
+
+        [Key]
+        public long Id { get; set; }
+        public string Name { get; set; } = null!;
+
+        [InverseProperty("Skill")]
+        public virtual ICollection<ConPersonSkill> ConPersonSkills { get; set; }
+    }
+}

+ 31 - 0
HallOfFame/Program.cs

@@ -0,0 +1,31 @@
+using HallOfFame;
+using Microsoft.EntityFrameworkCore;
+
+var builder = WebApplication.CreateBuilder(args);
+
+// Add services to the container.
+builder.Services.AddControllersWithViews();
+
+builder.Services.AddDbContext<PersonDBContext>(options => options.UseSqlServer(builder.Configuration.GetConnectionString("DefaultConnection")));
+
+var app = builder.Build();
+// Configure the HTTP request pipeline.
+if (!app.Environment.IsDevelopment())
+{
+    app.UseExceptionHandler("/Home/Error");
+    // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
+    app.UseHsts();
+}
+
+app.UseHttpsRedirection();
+app.UseStaticFiles();
+
+app.UseRouting();
+
+app.UseAuthorization();
+
+app.MapControllerRoute(
+    name: "default",
+    pattern: "{controller=Home}/{action=Index}/{id?}");
+
+app.Run();

+ 28 - 0
HallOfFame/Properties/launchSettings.json

@@ -0,0 +1,28 @@
+{
+  "iisSettings": {
+    "windowsAuthentication": false,
+    "anonymousAuthentication": true,
+    "iisExpress": {
+      "applicationUrl": "https://localhost:7258",
+      "sslPort": 44385
+    }
+  },
+  "profiles": {
+    "HallOfFame": {
+      "commandName": "Project",
+      "dotnetRunMessages": true,
+      "launchBrowser": true,
+      "applicationUrl": "https://localhost:7258;http://localhost:5258",
+      "environmentVariables": {
+        "ASPNETCORE_ENVIRONMENT": "Development"
+      }
+    },
+    "IIS Express": {
+      "commandName": "IISExpress",
+      "launchBrowser": true,
+      "environmentVariables": {
+        "ASPNETCORE_ENVIRONMENT": "Development"
+      }
+    }
+  }
+}

+ 10 - 0
HallOfFame/Views/Home/Index.cshtml

@@ -0,0 +1,10 @@
+@{
+    ViewData["Title"] = "Начальная страница";
+}
+
+<div class="text-center">
+    <h1 class="display-6">Backend-приложение (Бихтеев П.В.)</h1>
+
+</div>
+
+

+ 6 - 0
HallOfFame/Views/Home/Privacy.cshtml

@@ -0,0 +1,6 @@
+@{
+    ViewData["Title"] = "Privacy Policy";
+}
+<h1>@ViewData["Title"]</h1>
+
+<p>Use this page to detail your site's privacy policy.</p>

+ 28 - 0
HallOfFame/Views/Person/Create.cshtml

@@ -0,0 +1,28 @@
+@model Person
+@{
+    ViewData["Title"] = "Добавление сотрудника";
+}
+
+<form method="post">
+    <div class="border p-3 mt-4">
+        <div class=row pb-2>
+            <h2 class="text-primary">Добавление сотрудника</h2>
+            <hr />
+        </div>
+        <div class=mb-3>
+            <label asp-for="Name"></label>
+            <input asp-for="Name" class="form-control" />
+            <span asp-validation-for="Name" class="text-danger"></span>
+        </div>
+        <div class=mb-3>
+            <label asp-for="DisplayName"></label>
+            <input asp-for="DisplayName" class="form-control" />
+            <span asp-validation-for="DisplayName" class="text-danger"></span>
+        </div>
+        <button type="submit" class="btn btn-primary" style="width:150px">Добавить</button>
+        <a asp-controller="Person" asp-action="Index" class="btn btn-secondary" style="width:250px">
+            Вернуться к сотрудникам
+        </a>
+    </div>
+</form>
+

+ 28 - 0
HallOfFame/Views/Person/Edit.cshtml

@@ -0,0 +1,28 @@
+@model Person
+@{
+    ViewData["Title"] = "Добавление сотрудника";
+}
+
+<form method="post" asp-action="Edit">
+    <div class="border p-3 mt-4">
+        <div class=row pb-2>
+            <h2 class="text-primary">Изменение сотрудника</h2>
+            <hr />
+        </div>
+        <div class=mb-3>
+            <label asp-for="Name"></label>
+            <input asp-for="Name" class="form-control" />
+            <span asp-validation-for="Name" class="text-danger"></span>
+        </div>
+        <div class=mb-3>
+            <label asp-for="DisplayName"></label>
+            <input asp-for="DisplayName" class="form-control" />
+            <span asp-validation-for="DisplayName" class="text-danger"></span>
+        </div>
+        <button type="submit" class="btn btn-primary" style="width:150px">Обновить</button>
+        <a asp-controller="Person" asp-action="Index" class="btn btn-secondary" style="width:250px">
+            Вернуться к сотрудникам
+        </a>
+    </div>
+</form>
+

+ 67 - 0
HallOfFame/Views/Person/Index.cshtml

@@ -0,0 +1,67 @@
+@model IEnumerable<Person>
+@{
+    ViewData["Title"] = "Сотрудники";
+}
+
+<div class="container p-3">
+    <div class="row pt-4">
+        <div class=col-6>
+            <h2 class="text-primary">Таблица сотрудников</h2>
+        </div>
+        <div class=col-6>
+            <a asp-controller="Person" asp-action="Create" data-toggle="modal" class="btn btn-primary">
+                Добавить нового сотрудника
+            </a>
+        </div>
+    </div>
+
+
+@if(Model.Count() > 0)
+     {
+        <table class="table table-bordered table-striped " style="width:80%"> 
+            <thead>
+                <tr>
+                    <th>
+                        Имя
+                    </th>
+                    <th>
+                        Отображаемое имя
+                    </th>
+                    <th>
+
+                    </th>
+                </tr>
+            </thead>
+            <tbody>
+               @foreach(var item in Model)
+               {
+                    <tr>
+                        <td width="40%">@item.Name</td>
+                        <td width="30%">@item.DisplayName</td>
+                        <td>
+                            <div class="w-75 btn-group" role="group">
+                                <a asp-controller="Person" asp-action="Edit" asp-route-id="@item.Id">
+                                Редактировать
+                                </a>
+                            </div>
+                            <div class="w-75 btn-group" role="group">
+                                <a asp-controller="Person" asp-action="Result" asp-route-id="@item.Id">
+                                Детали
+                                </a>
+                            </div>
+                             <div class="w-75 btn-group" role="group">
+                                <a asp-controller="Person" asp-action="Edit" asp-route-id="@item.Id">
+                                Удалить
+                                </a>
+                            </div>
+                        </td>
+                    </tr>
+               }
+            </tbody>
+        </table>
+     }
+     else
+     {
+        <p>No persons!</p>
+     }
+</div>

+ 29 - 0
HallOfFame/Views/Person/Result.cshtml

@@ -0,0 +1,29 @@
+@model IEnumerable<Skill>
+@{
+    ViewData["Title"] = "Детали";
+}
+<h1>View</h1>
+<table class="table table-bordered table-striped " style="width:80%"> 
+            <thead>
+                <tr>
+                    <th>
+                        Навык
+                    </th>
+                    <th>
+                        Уровень
+                    </th>
+                    <th>
+
+                    </th>
+                </tr>
+            </thead>
+            <tbody>
+               @foreach(var item in Model)
+               {
+                    <tr>
+                        <td width="40%">@item.Name</td>
+                    </tr>    
+               }
+            </tbody>
+        </table>
+

+ 49 - 0
HallOfFame/Views/Person/ViewSkill.cshtml

@@ -0,0 +1,49 @@
+@model IEnumerable<Skill>
+@{
+    ViewData["Title"] = "Навыки";
+}
+
+<div class="container p-3">
+    <div class="row pt-4">
+        <div class=col-6>
+            <h2 class="text-primary">Таблица навыков</h2>
+        </div>
+        <div class=col-6>
+            <a asp-controller="Person" asp-action="Create" data-toggle="modal" class="btn btn-primary">
+                Добавить новый навык
+            </a>
+        </div>
+    </div>
+
+
+@if(Model.Count() > 0)
+     {
+        <table class="table table-bordered table-striped " style="width:80%"> 
+            <thead>
+                <tr>
+                    <th>
+                        Наименование навыка
+                    </th>
+                </tr>
+            </thead>
+            <tbody>
+               @foreach(var item in Model)
+               {
+                    <tr>
+                        <td width="40%">@item.Name</td>
+                        <td>
+                            <div class="w-75 btn-group" role="group">
+                                <a asp-controller="Person" asp-action="Edit" asp-route-id="@item.Id">
+                                Редактировать
+                                </a>
+                            </div>
+                        </td>
+                    </tr>
+               }
+            </tbody>
+        </table>
+     }
+     else
+     {
+        <p>No skills!</p>
+     }

+ 25 - 0
HallOfFame/Views/Shared/Error.cshtml

@@ -0,0 +1,25 @@
+@model ErrorViewModel
+@{
+    ViewData["Title"] = "Error";
+}
+
+<h1 class="text-danger">Error.</h1>
+<h2 class="text-danger">An error occurred while processing your request.</h2>
+
+@if (Model.ShowRequestId)
+{
+    <p>
+        <strong>Request ID:</strong> <code>@Model.RequestId</code>
+    </p>
+}
+
+<h3>Development Mode</h3>
+<p>
+    Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred.
+</p>
+<p>
+    <strong>The Development environment shouldn't be enabled for deployed applications.</strong>
+    It can result in displaying sensitive information from exceptions to end users.
+    For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
+    and restarting the app.
+</p>

+ 43 - 0
HallOfFame/Views/Shared/_Layout.cshtml

@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<html lang="ru">
+<head>
+    <meta charset="utf-8" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+    <title>@ViewData["Title"] - HallOfFame</title>
+    <link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
+    <link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
+    <link rel="stylesheet" href="~/HallOfFame.styles.css" asp-append-version="true" />
+</head>
+<body>
+    <header>
+        <nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
+            <div class="container-fluid">
+                <a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">HallOfFame</a>
+                <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent"
+                        aria-expanded="false" aria-label="Toggle navigation">
+                    <span class="navbar-toggler-icon"></span>
+                </button>
+                <div class="navbar-collapse collapse d-sm-inline-flex justify-content-between">
+                    <ul class="navbar-nav flex-grow-1">
+                        <li class="nav-item">
+                            <a class="nav-link text-dark" asp-controller="Person" asp-action="Index">Сотрудники</a>
+                        </li>
+                        <li class="nav-item">
+                            <a class="nav-link text-dark" asp-controller="Person" asp-action="ViewSkill">Навыки</a>
+                        </li>
+                    </ul>
+                </div>
+            </div>
+        </nav>
+    </header>
+    <div class="container">
+        <main role="main" class="pb-3">
+            @RenderBody()
+        </main>
+    </div>
+    <script src="~/lib/jquery/dist/jquery.min.js"></script>
+    <script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
+    <script src="~/js/site.js" asp-append-version="true"></script>
+    @await RenderSectionAsync("Scripts", required: false)
+</body>
+</html>

+ 48 - 0
HallOfFame/Views/Shared/_Layout.cshtml.css

@@ -0,0 +1,48 @@
+/* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
+for details on configuring this project to bundle and minify static web assets. */
+
+a.navbar-brand {
+  white-space: normal;
+  text-align: center;
+  word-break: break-all;
+}
+
+a {
+  color: #0077cc;
+}
+
+.btn-primary {
+  color: #fff;
+  background-color: #1b6ec2;
+  border-color: #1861ac;
+}
+
+.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
+  color: #fff;
+  background-color: #1b6ec2;
+  border-color: #1861ac;
+}
+
+.border-top {
+  border-top: 1px solid #e5e5e5;
+}
+.border-bottom {
+  border-bottom: 1px solid #e5e5e5;
+}
+
+.box-shadow {
+  box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
+}
+
+button.accept-policy {
+  font-size: 1rem;
+  line-height: inherit;
+}
+
+.footer {
+  position: absolute;
+  bottom: 0;
+  width: 100%;
+  white-space: nowrap;
+  line-height: 60px;
+}

+ 2 - 0
HallOfFame/Views/Shared/_ValidationScriptsPartial.cshtml

@@ -0,0 +1,2 @@
+<script src="~/lib/jquery-validation/dist/jquery.validate.min.js"></script>
+<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"></script>

+ 3 - 0
HallOfFame/Views/_ViewImports.cshtml

@@ -0,0 +1,3 @@
+@using HallOfFame
+@using HallOfFame.Models
+@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers

+ 3 - 0
HallOfFame/Views/_ViewStart.cshtml

@@ -0,0 +1,3 @@
+@{
+    Layout = "_Layout";
+}

+ 8 - 0
HallOfFame/appsettings.Development.json

@@ -0,0 +1,8 @@
+{
+  "Logging": {
+    "LogLevel": {
+      "Default": "Information",
+      "Microsoft.AspNetCore": "Warning"
+    }
+  }
+}

+ 12 - 0
HallOfFame/appsettings.json

@@ -0,0 +1,12 @@
+{
+  "Logging": {
+    "LogLevel": {
+      "Default": "Information",
+      "Microsoft.AspNetCore": "Warning"
+    }
+  },
+  "AllowedHosts": "*",
+  "ConnectionStrings": {
+    "DefaultConnection": "Server=localhost;Database=PersonDB;Trusted_Connection=True;"
+  }
+}

Diferenças do arquivo suprimidas por serem muito extensas
+ 3505 - 0
HallOfFame/bin/Debug/net6.0/HallOfFame.deps.json


BIN
HallOfFame/bin/Debug/net6.0/HallOfFame.dll


BIN
HallOfFame/bin/Debug/net6.0/HallOfFame.exe


BIN
HallOfFame/bin/Debug/net6.0/HallOfFame.pdb


+ 19 - 0
HallOfFame/bin/Debug/net6.0/HallOfFame.runtimeconfig.json

@@ -0,0 +1,19 @@
+{
+  "runtimeOptions": {
+    "tfm": "net6.0",
+    "frameworks": [
+      {
+        "name": "Microsoft.NETCore.App",
+        "version": "6.0.0"
+      },
+      {
+        "name": "Microsoft.AspNetCore.App",
+        "version": "6.0.0"
+      }
+    ],
+    "configProperties": {
+      "System.GC.Server": true,
+      "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
+    }
+  }
+}

Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
HallOfFame/bin/Debug/net6.0/HallOfFame.staticwebassets.runtime.json


BIN
HallOfFame/bin/Debug/net6.0/Humanizer.dll


BIN
HallOfFame/bin/Debug/net6.0/MessagePack.Annotations.dll


BIN
HallOfFame/bin/Debug/net6.0/MessagePack.dll


BIN
HallOfFame/bin/Debug/net6.0/Microsoft.AspNetCore.Razor.Language.dll


BIN
HallOfFame/bin/Debug/net6.0/Microsoft.Bcl.AsyncInterfaces.dll


BIN
HallOfFame/bin/Debug/net6.0/Microsoft.Build.Locator.dll


BIN
HallOfFame/bin/Debug/net6.0/Microsoft.CodeAnalysis.AnalyzerUtilities.dll


BIN
HallOfFame/bin/Debug/net6.0/Microsoft.CodeAnalysis.CSharp.Features.dll


BIN
HallOfFame/bin/Debug/net6.0/Microsoft.CodeAnalysis.CSharp.Scripting.dll


BIN
HallOfFame/bin/Debug/net6.0/Microsoft.CodeAnalysis.CSharp.Workspaces.dll


BIN
HallOfFame/bin/Debug/net6.0/Microsoft.CodeAnalysis.CSharp.dll


BIN
HallOfFame/bin/Debug/net6.0/Microsoft.CodeAnalysis.Features.dll


BIN
HallOfFame/bin/Debug/net6.0/Microsoft.CodeAnalysis.Razor.dll


BIN
HallOfFame/bin/Debug/net6.0/Microsoft.CodeAnalysis.Scripting.dll


BIN
HallOfFame/bin/Debug/net6.0/Microsoft.CodeAnalysis.VisualBasic.Features.dll


BIN
HallOfFame/bin/Debug/net6.0/Microsoft.CodeAnalysis.VisualBasic.Workspaces.dll


BIN
HallOfFame/bin/Debug/net6.0/Microsoft.CodeAnalysis.VisualBasic.dll


BIN
HallOfFame/bin/Debug/net6.0/Microsoft.CodeAnalysis.Workspaces.MSBuild.dll


BIN
HallOfFame/bin/Debug/net6.0/Microsoft.CodeAnalysis.Workspaces.dll


BIN
HallOfFame/bin/Debug/net6.0/Microsoft.CodeAnalysis.dll


BIN
HallOfFame/bin/Debug/net6.0/Microsoft.Data.SqlClient.dll


BIN
HallOfFame/bin/Debug/net6.0/Microsoft.DiaSymReader.dll


BIN
HallOfFame/bin/Debug/net6.0/Microsoft.DotNet.Scaffolding.Shared.dll


BIN
HallOfFame/bin/Debug/net6.0/Microsoft.EntityFrameworkCore.Abstractions.dll


BIN
HallOfFame/bin/Debug/net6.0/Microsoft.EntityFrameworkCore.Design.dll


BIN
HallOfFame/bin/Debug/net6.0/Microsoft.EntityFrameworkCore.Relational.dll


BIN
HallOfFame/bin/Debug/net6.0/Microsoft.EntityFrameworkCore.SqlServer.dll


BIN
HallOfFame/bin/Debug/net6.0/Microsoft.EntityFrameworkCore.dll


BIN
HallOfFame/bin/Debug/net6.0/Microsoft.Extensions.Caching.Memory.dll


BIN
HallOfFame/bin/Debug/net6.0/Microsoft.Identity.Client.dll


BIN
HallOfFame/bin/Debug/net6.0/Microsoft.IdentityModel.JsonWebTokens.dll


BIN
HallOfFame/bin/Debug/net6.0/Microsoft.IdentityModel.Logging.dll


BIN
HallOfFame/bin/Debug/net6.0/Microsoft.IdentityModel.Protocols.OpenIdConnect.dll


BIN
HallOfFame/bin/Debug/net6.0/Microsoft.IdentityModel.Protocols.dll


BIN
HallOfFame/bin/Debug/net6.0/Microsoft.IdentityModel.Tokens.dll


BIN
HallOfFame/bin/Debug/net6.0/Microsoft.OpenApi.dll


BIN
HallOfFame/bin/Debug/net6.0/Microsoft.VisualStudio.Debugger.Contracts.dll


BIN
HallOfFame/bin/Debug/net6.0/Microsoft.VisualStudio.Web.CodeGeneration.Core.dll


BIN
HallOfFame/bin/Debug/net6.0/Microsoft.VisualStudio.Web.CodeGeneration.EntityFrameworkCore.dll


BIN
HallOfFame/bin/Debug/net6.0/Microsoft.VisualStudio.Web.CodeGeneration.Templating.dll


BIN
HallOfFame/bin/Debug/net6.0/Microsoft.VisualStudio.Web.CodeGeneration.Utils.dll


BIN
HallOfFame/bin/Debug/net6.0/Microsoft.VisualStudio.Web.CodeGeneration.dll


BIN
HallOfFame/bin/Debug/net6.0/Microsoft.VisualStudio.Web.CodeGenerators.Mvc.dll


BIN
HallOfFame/bin/Debug/net6.0/Microsoft.Win32.SystemEvents.dll


BIN
HallOfFame/bin/Debug/net6.0/Newtonsoft.Json.dll


BIN
HallOfFame/bin/Debug/net6.0/NuGet.Common.dll


BIN
HallOfFame/bin/Debug/net6.0/NuGet.Configuration.dll


BIN
HallOfFame/bin/Debug/net6.0/NuGet.DependencyResolver.Core.dll


BIN
HallOfFame/bin/Debug/net6.0/NuGet.Frameworks.dll


BIN
HallOfFame/bin/Debug/net6.0/NuGet.LibraryModel.dll


BIN
HallOfFame/bin/Debug/net6.0/NuGet.Packaging.dll


BIN
HallOfFame/bin/Debug/net6.0/NuGet.ProjectModel.dll


BIN
HallOfFame/bin/Debug/net6.0/NuGet.Protocol.dll


BIN
HallOfFame/bin/Debug/net6.0/NuGet.Versioning.dll


BIN
HallOfFame/bin/Debug/net6.0/Swashbuckle.AspNetCore.Swagger.dll


BIN
HallOfFame/bin/Debug/net6.0/Swashbuckle.AspNetCore.SwaggerGen.dll


BIN
HallOfFame/bin/Debug/net6.0/Swashbuckle.AspNetCore.SwaggerUI.dll


BIN
HallOfFame/bin/Debug/net6.0/System.Composition.AttributedModel.dll


BIN
HallOfFame/bin/Debug/net6.0/System.Composition.Convention.dll


BIN
HallOfFame/bin/Debug/net6.0/System.Composition.Hosting.dll


BIN
HallOfFame/bin/Debug/net6.0/System.Composition.Runtime.dll


BIN
HallOfFame/bin/Debug/net6.0/System.Composition.TypedParts.dll


+ 0 - 0
HallOfFame/bin/Debug/net6.0/System.Configuration.ConfigurationManager.dll


Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff