mirror of
https://github.com/kuhyx/WUT_Computer_Science.git
synced 2026-07-04 14:43:08 +02:00
chore
This commit is contained in:
parent
1a44913e4f
commit
406cb6ae6f
35
EGUI/lab2/lab2/.vscode/launch.json
vendored
Normal file
35
EGUI/lab2/lab2/.vscode/launch.json
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
// Use IntelliSense to find out which attributes exist for C# debugging
|
||||
// Use hover for the description of the existing attributes
|
||||
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
|
||||
"name": ".NET Core Launch (web)",
|
||||
"type": "coreclr",
|
||||
"request": "launch",
|
||||
"preLaunchTask": "build",
|
||||
// If you have changed target frameworks, make sure to update the program path.
|
||||
"program": "${workspaceFolder}/bin/Debug/net6.0/lab2.dll",
|
||||
"args": [],
|
||||
"cwd": "${workspaceFolder}",
|
||||
"stopAtEntry": false,
|
||||
// Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser
|
||||
"serverReadyAction": {
|
||||
"action": "openExternally",
|
||||
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
|
||||
},
|
||||
"env": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"sourceFileMap": {
|
||||
"/Views": "${workspaceFolder}/Views"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": ".NET Core Attach",
|
||||
"type": "coreclr",
|
||||
"request": "attach"
|
||||
}
|
||||
]
|
||||
}
|
||||
41
EGUI/lab2/lab2/.vscode/tasks.json
vendored
Normal file
41
EGUI/lab2/lab2/.vscode/tasks.json
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "build",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"build",
|
||||
"${workspaceFolder}/lab2.csproj",
|
||||
"/property:GenerateFullPaths=true",
|
||||
"/consoleloggerparameters:NoSummary"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "publish",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"publish",
|
||||
"${workspaceFolder}/lab2.csproj",
|
||||
"/property:GenerateFullPaths=true",
|
||||
"/consoleloggerparameters:NoSummary"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "watch",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"watch",
|
||||
"run",
|
||||
"--project",
|
||||
"${workspaceFolder}/lab2.csproj"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
}
|
||||
]
|
||||
}
|
||||
28
EGUI/lab2/lab2/Controllers/BlogView.cs
Normal file
28
EGUI/lab2/lab2/Controllers/BlogView.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Text.Encodings.Web;
|
||||
|
||||
namespace lab2.Controllers
|
||||
{
|
||||
public class BlogViewController : Controller
|
||||
{
|
||||
//
|
||||
// GET: /Register/
|
||||
|
||||
public IActionResult Index()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
//
|
||||
// GET: /Register/RegisterUser/?userid=Rick&email=4&password=test&blogid=blogtest
|
||||
|
||||
public IActionResult RegisterUser(string userid, string email, string password, string blogid)
|
||||
{
|
||||
ViewData["userid"] = "userid: " + userid;
|
||||
ViewData["email"] = "email: " + email;
|
||||
ViewData["password"] = "password: " + password;
|
||||
ViewData["blogid"] = "blogid: " + blogid;
|
||||
return View();
|
||||
}
|
||||
}
|
||||
}
|
||||
28
EGUI/lab2/lab2/Controllers/Login.cs
Normal file
28
EGUI/lab2/lab2/Controllers/Login.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Text.Encodings.Web;
|
||||
|
||||
namespace lab2.Controllers
|
||||
{
|
||||
public class LoginController : Controller
|
||||
{
|
||||
//
|
||||
// GET: /Login/
|
||||
|
||||
public IActionResult Index()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
//
|
||||
// GET: /Login/LoginUser/
|
||||
// https://localhost:{PORT}/Login/LoginUser/?userid=Rick&password=4
|
||||
|
||||
public IActionResult LoginUser(string userid, string password)
|
||||
{
|
||||
ViewData["userid"] = "userid: " + userid;
|
||||
ViewData["password"] = "password: " + password;
|
||||
|
||||
return View();
|
||||
}
|
||||
}
|
||||
}
|
||||
28
EGUI/lab2/lab2/Controllers/Register.cs
Normal file
28
EGUI/lab2/lab2/Controllers/Register.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Text.Encodings.Web;
|
||||
|
||||
namespace lab2.Controllers
|
||||
{
|
||||
public class RegisterController : Controller
|
||||
{
|
||||
//
|
||||
// GET: /Register/
|
||||
|
||||
public IActionResult Index()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
//
|
||||
// GET: /Register/RegisterUser/?userid=Rick&email=4&password=test&blogid=blogtest
|
||||
|
||||
public IActionResult RegisterUser(string userid, string email, string password, string blogid)
|
||||
{
|
||||
ViewData["userid"] = "userid: " + userid;
|
||||
ViewData["email"] = "email: " + email;
|
||||
ViewData["password"] = "password: " + password;
|
||||
ViewData["blogid"] = "blogid: " + blogid;
|
||||
return View();
|
||||
}
|
||||
}
|
||||
}
|
||||
153
EGUI/lab2/lab2/Controllers/UserController.cs
Normal file
153
EGUI/lab2/lab2/Controllers/UserController.cs
Normal file
@ -0,0 +1,153 @@
|
||||
#nullable disable
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using lab2.Models;
|
||||
|
||||
namespace lab2.Controllers
|
||||
{
|
||||
public class UserController : Controller
|
||||
{
|
||||
private readonly lab2UserContext _context;
|
||||
|
||||
public UserController(lab2UserContext context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
// GET: User
|
||||
public async Task<IActionResult> Index()
|
||||
{
|
||||
return View(await _context.User.ToListAsync());
|
||||
}
|
||||
|
||||
// GET: User/Details/5
|
||||
public async Task<IActionResult> Details(string id)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
var user = await _context.User
|
||||
.FirstOrDefaultAsync(m => m.Id == id);
|
||||
if (user == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
return View(user);
|
||||
}
|
||||
|
||||
// GET: User/Create
|
||||
public IActionResult Create()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
// POST: User/Create
|
||||
// To protect from overposting attacks, enable the specific properties you want to bind to.
|
||||
// For more details, see http://go.microsoft.com/fwlink/?LinkId=317598.
|
||||
[HttpPost]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<IActionResult> Create([Bind("Id,email,password")] User user)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
_context.Add(user);
|
||||
await _context.SaveChangesAsync();
|
||||
return RedirectToAction(nameof(Index));
|
||||
}
|
||||
return View(user);
|
||||
}
|
||||
|
||||
// GET: User/Edit/5
|
||||
public async Task<IActionResult> Edit(string id)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
var user = await _context.User.FindAsync(id);
|
||||
if (user == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
return View(user);
|
||||
}
|
||||
|
||||
// POST: User/Edit/5
|
||||
// To protect from overposting attacks, enable the specific properties you want to bind to.
|
||||
// For more details, see http://go.microsoft.com/fwlink/?LinkId=317598.
|
||||
[HttpPost]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<IActionResult> Edit(string id, [Bind("Id,email,password")] User user)
|
||||
{
|
||||
if (id != user.Id)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
try
|
||||
{
|
||||
_context.Update(user);
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
catch (DbUpdateConcurrencyException)
|
||||
{
|
||||
if (!UserExists(user.Id))
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
return RedirectToAction(nameof(Index));
|
||||
}
|
||||
return View(user);
|
||||
}
|
||||
|
||||
// GET: User/Delete/5
|
||||
public async Task<IActionResult> Delete(string id)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
var user = await _context.User
|
||||
.FirstOrDefaultAsync(m => m.Id == id);
|
||||
if (user == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
return View(user);
|
||||
}
|
||||
|
||||
// POST: User/Delete/5
|
||||
[HttpPost, ActionName("Delete")]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<IActionResult> DeleteConfirmed(string id)
|
||||
{
|
||||
var user = await _context.User.FindAsync(id);
|
||||
_context.User.Remove(user);
|
||||
await _context.SaveChangesAsync();
|
||||
return RedirectToAction(nameof(Index));
|
||||
}
|
||||
|
||||
private bool UserExists(string id)
|
||||
{
|
||||
return _context.User.Any(e => e.Id == id);
|
||||
}
|
||||
}
|
||||
}
|
||||
17
EGUI/lab2/lab2/Data/lab2UserContext.cs
Normal file
17
EGUI/lab2/lab2/Data/lab2UserContext.cs
Normal file
@ -0,0 +1,17 @@
|
||||
#nullable disable
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using lab2.Models;
|
||||
|
||||
public class lab2UserContext : DbContext
|
||||
{
|
||||
public lab2UserContext (DbContextOptions<lab2UserContext> options)
|
||||
: base(options)
|
||||
{
|
||||
}
|
||||
|
||||
public DbSet<lab2.Models.User> User { get; set; }
|
||||
}
|
||||
16
EGUI/lab2/lab2/Models/Blog
Normal file
16
EGUI/lab2/lab2/Models/Blog
Normal file
@ -0,0 +1,16 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace lab2.Models
|
||||
{
|
||||
public class Blog
|
||||
{
|
||||
public string? Id { get; set; }
|
||||
public string? Title { get; set; }
|
||||
|
||||
public string? OwnerId { get; set; }
|
||||
|
||||
public BlogEntry[]? Entries {get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
12
EGUI/lab2/lab2/Models/BlogEntry
Normal file
12
EGUI/lab2/lab2/Models/BlogEntry
Normal file
@ -0,0 +1,12 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace lab2.Models
|
||||
{
|
||||
public class BlogEntry
|
||||
{
|
||||
public string? Title { get; set; }
|
||||
[DataType(DataType.Date)]
|
||||
public DateTime datetime { get; set; }
|
||||
public string? content {get; set; }
|
||||
}
|
||||
}
|
||||
11
EGUI/lab2/lab2/Models/User.cs
Normal file
11
EGUI/lab2/lab2/Models/User.cs
Normal file
@ -0,0 +1,11 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace lab2.Models
|
||||
{
|
||||
public class User
|
||||
{
|
||||
public string? Id { get; set; }
|
||||
public string? email { get; set; }
|
||||
public string? password { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,4 +1,9 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
builder.Services.AddDbContext<lab2UserContext>(options =>
|
||||
options.UseSqlite(builder.Configuration.GetConnectionString("lab2UserContext") ?? throw new InvalidOperationException("Connection string 'lab2UserContext' not found.")));
|
||||
|
||||
// Add services to the container.
|
||||
builder.Services.AddControllersWithViews();
|
||||
|
||||
5
EGUI/lab2/lab2/Views/BlogView/Index.cshtml
Normal file
5
EGUI/lab2/lab2/Views/BlogView/Index.cshtml
Normal file
@ -0,0 +1,5 @@
|
||||
@{
|
||||
ViewData["Title"] = "Blog View";
|
||||
}
|
||||
|
||||
<h2>Blog View</h2>
|
||||
7
EGUI/lab2/lab2/Views/Login/Index.cshtml
Normal file
7
EGUI/lab2/lab2/Views/Login/Index.cshtml
Normal file
@ -0,0 +1,7 @@
|
||||
@{
|
||||
ViewData["Title"] = "Login";
|
||||
}
|
||||
|
||||
<h2>Login</h2>
|
||||
|
||||
<p>Hello from our Login Template!</p>
|
||||
10
EGUI/lab2/lab2/Views/Login/LoginUser.cshtml
Normal file
10
EGUI/lab2/lab2/Views/Login/LoginUser.cshtml
Normal file
@ -0,0 +1,10 @@
|
||||
@{
|
||||
ViewData["Title"] = "Logged User";
|
||||
}
|
||||
|
||||
<h2>Welcome</h2>
|
||||
|
||||
<ul>
|
||||
<li>@ViewData["userid"]</li>
|
||||
<li>@ViewData["password"]</li>
|
||||
</ul>
|
||||
7
EGUI/lab2/lab2/Views/Register/Index.cshtml
Normal file
7
EGUI/lab2/lab2/Views/Register/Index.cshtml
Normal file
@ -0,0 +1,7 @@
|
||||
@{
|
||||
ViewData["Title"] = "Register";
|
||||
}
|
||||
|
||||
<h2>Register</h2>
|
||||
|
||||
<p>Hello from our Register Template!</p>
|
||||
12
EGUI/lab2/lab2/Views/Register/RegisterUser.cshtml
Normal file
12
EGUI/lab2/lab2/Views/Register/RegisterUser.cshtml
Normal file
@ -0,0 +1,12 @@
|
||||
@{
|
||||
ViewData["Title"] = "Register User";
|
||||
}
|
||||
|
||||
<h2>Welcome</h2>
|
||||
|
||||
<ul>
|
||||
<li>@ViewData["userid"]</li>
|
||||
<li>@ViewData["email"]</li>
|
||||
<li>@ViewData["password"]</li>
|
||||
<li>@ViewData["blogid"]</li>
|
||||
</ul>
|
||||
@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>@ViewData["Title"] - lab2</title>
|
||||
<title>@ViewData["Title"] - Blog App</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="~/lab2.styles.css" asp-append-version="true" />
|
||||
@ -12,7 +12,7 @@
|
||||
<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">lab2</a>
|
||||
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">Blog App</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>
|
||||
@ -38,7 +38,7 @@
|
||||
|
||||
<footer class="border-top footer text-muted">
|
||||
<div class="container">
|
||||
© 2022 - lab2 - <a asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
|
||||
© 2022 - Blog App - <a asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
|
||||
</div>
|
||||
</footer>
|
||||
<script src="~/lib/jquery/dist/jquery.min.js"></script>
|
||||
|
||||
43
EGUI/lab2/lab2/Views/User/Create.cshtml
Normal file
43
EGUI/lab2/lab2/Views/User/Create.cshtml
Normal file
@ -0,0 +1,43 @@
|
||||
@model lab2.Models.User
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Create";
|
||||
}
|
||||
|
||||
<h1>Create</h1>
|
||||
|
||||
<h4>User</h4>
|
||||
<hr />
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<form asp-action="Create">
|
||||
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Id" class="control-label"></label>
|
||||
<input asp-for="Id" class="form-control" />
|
||||
<span asp-validation-for="Id" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="email" class="control-label"></label>
|
||||
<input asp-for="email" class="form-control" />
|
||||
<span asp-validation-for="email" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="password" class="control-label"></label>
|
||||
<input asp-for="password" class="form-control" />
|
||||
<span asp-validation-for="password" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="submit" value="Create" class="btn btn-primary" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
|
||||
}
|
||||
33
EGUI/lab2/lab2/Views/User/Delete.cshtml
Normal file
33
EGUI/lab2/lab2/Views/User/Delete.cshtml
Normal file
@ -0,0 +1,33 @@
|
||||
@model lab2.Models.User
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Delete";
|
||||
}
|
||||
|
||||
<h1>Delete</h1>
|
||||
|
||||
<h3>Are you sure you want to delete this?</h3>
|
||||
<div>
|
||||
<h4>User</h4>
|
||||
<hr />
|
||||
<dl class="row">
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.email)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.email)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.password)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.password)
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<form asp-action="Delete">
|
||||
<input type="hidden" asp-for="Id" />
|
||||
<input type="submit" value="Delete" class="btn btn-danger" /> |
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</form>
|
||||
</div>
|
||||
30
EGUI/lab2/lab2/Views/User/Details.cshtml
Normal file
30
EGUI/lab2/lab2/Views/User/Details.cshtml
Normal file
@ -0,0 +1,30 @@
|
||||
@model lab2.Models.User
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Details";
|
||||
}
|
||||
|
||||
<h1>Details</h1>
|
||||
|
||||
<div>
|
||||
<h4>User</h4>
|
||||
<hr />
|
||||
<dl class="row">
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.email)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.email)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.password)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.password)
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div>
|
||||
<a asp-action="Edit" asp-route-id="@Model?.Id">Edit</a> |
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</div>
|
||||
39
EGUI/lab2/lab2/Views/User/Edit.cshtml
Normal file
39
EGUI/lab2/lab2/Views/User/Edit.cshtml
Normal file
@ -0,0 +1,39 @@
|
||||
@model lab2.Models.User
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Edit";
|
||||
}
|
||||
|
||||
<h1>Edit</h1>
|
||||
|
||||
<h4>User</h4>
|
||||
<hr />
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<form asp-action="Edit">
|
||||
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
||||
<input type="hidden" asp-for="Id" />
|
||||
<div class="form-group">
|
||||
<label asp-for="email" class="control-label"></label>
|
||||
<input asp-for="email" class="form-control" />
|
||||
<span asp-validation-for="email" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="password" class="control-label"></label>
|
||||
<input asp-for="password" class="form-control" />
|
||||
<span asp-validation-for="password" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="submit" value="Save" class="btn btn-primary" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
|
||||
}
|
||||
41
EGUI/lab2/lab2/Views/User/Index.cshtml
Normal file
41
EGUI/lab2/lab2/Views/User/Index.cshtml
Normal file
@ -0,0 +1,41 @@
|
||||
@model IEnumerable<lab2.Models.User>
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Index";
|
||||
}
|
||||
|
||||
<h1>Index</h1>
|
||||
|
||||
<p>
|
||||
<a asp-action="Create">Create New</a>
|
||||
</p>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.email)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.password)
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in Model) {
|
||||
<tr>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.email)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.password)
|
||||
</td>
|
||||
<td>
|
||||
<a asp-action="Edit" asp-route-id="@item.Id">Edit</a> |
|
||||
<a asp-action="Details" asp-route-id="@item.Id">Details</a> |
|
||||
<a asp-action="Delete" asp-route-id="@item.Id">Delete</a>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
@ -1,9 +1,12 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*"
|
||||
}
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"ConnectionStrings": {
|
||||
"lab2UserContext": "Data Source=lab2UserContext-85435385-56ab-4666-ad5b-1892b82e95b9.db"
|
||||
}
|
||||
}
|
||||
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Humanizer.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Humanizer.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/MessagePack.Annotations.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/MessagePack.Annotations.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/MessagePack.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/MessagePack.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.AspNetCore.Razor.Language.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.AspNetCore.Razor.Language.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.Bcl.AsyncInterfaces.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.Bcl.AsyncInterfaces.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.Build.Locator.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.Build.Locator.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.CodeAnalysis.AnalyzerUtilities.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.CodeAnalysis.AnalyzerUtilities.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.CodeAnalysis.CSharp.Features.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.CodeAnalysis.CSharp.Features.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.CodeAnalysis.CSharp.Scripting.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.CodeAnalysis.CSharp.Scripting.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.CodeAnalysis.CSharp.Workspaces.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.CodeAnalysis.CSharp.Workspaces.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.CodeAnalysis.CSharp.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.CodeAnalysis.CSharp.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.CodeAnalysis.Features.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.CodeAnalysis.Features.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.CodeAnalysis.Razor.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.CodeAnalysis.Razor.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.CodeAnalysis.Scripting.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.CodeAnalysis.Scripting.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.CodeAnalysis.VisualBasic.Features.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.CodeAnalysis.VisualBasic.Features.dll
Executable file
Binary file not shown.
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.CodeAnalysis.VisualBasic.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.CodeAnalysis.VisualBasic.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.CodeAnalysis.Workspaces.MSBuild.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.CodeAnalysis.Workspaces.MSBuild.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.CodeAnalysis.Workspaces.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.CodeAnalysis.Workspaces.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.CodeAnalysis.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.CodeAnalysis.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.Data.SqlClient.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.Data.SqlClient.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.Data.Sqlite.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.Data.Sqlite.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.DiaSymReader.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.DiaSymReader.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.DotNet.Scaffolding.Shared.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.DotNet.Scaffolding.Shared.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.EntityFrameworkCore.Abstractions.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.EntityFrameworkCore.Abstractions.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.EntityFrameworkCore.Design.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.EntityFrameworkCore.Design.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.EntityFrameworkCore.Relational.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.EntityFrameworkCore.Relational.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.EntityFrameworkCore.SqlServer.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.EntityFrameworkCore.SqlServer.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.EntityFrameworkCore.Sqlite.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.EntityFrameworkCore.Sqlite.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.EntityFrameworkCore.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.EntityFrameworkCore.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.Extensions.Caching.Memory.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.Extensions.Caching.Memory.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.Extensions.DependencyModel.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.Extensions.DependencyModel.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.Identity.Client.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.Identity.Client.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.IdentityModel.JsonWebTokens.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.IdentityModel.JsonWebTokens.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.IdentityModel.Logging.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.IdentityModel.Logging.dll
Executable file
Binary file not shown.
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.IdentityModel.Protocols.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.IdentityModel.Protocols.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.IdentityModel.Tokens.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.IdentityModel.Tokens.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.VisualStudio.Debugger.Contracts.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.VisualStudio.Debugger.Contracts.dll
Executable file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.VisualStudio.Web.CodeGeneration.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.VisualStudio.Web.CodeGeneration.dll
Executable file
Binary file not shown.
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.Win32.SystemEvents.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Microsoft.Win32.SystemEvents.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Newtonsoft.Json.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/Newtonsoft.Json.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/NuGet.Common.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/NuGet.Common.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/NuGet.Configuration.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/NuGet.Configuration.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/NuGet.DependencyResolver.Core.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/NuGet.DependencyResolver.Core.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/NuGet.Frameworks.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/NuGet.Frameworks.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/NuGet.LibraryModel.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/NuGet.LibraryModel.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/NuGet.Packaging.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/NuGet.Packaging.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/NuGet.ProjectModel.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/NuGet.ProjectModel.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/NuGet.Protocol.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/NuGet.Protocol.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/NuGet.Versioning.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/NuGet.Versioning.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/SQLitePCLRaw.batteries_v2.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/SQLitePCLRaw.batteries_v2.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/SQLitePCLRaw.core.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/SQLitePCLRaw.core.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/SQLitePCLRaw.provider.e_sqlite3.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/SQLitePCLRaw.provider.e_sqlite3.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/System.Composition.AttributedModel.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/System.Composition.AttributedModel.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/System.Composition.Convention.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/System.Composition.Convention.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/System.Composition.Hosting.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/System.Composition.Hosting.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/System.Composition.Runtime.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/System.Composition.Runtime.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/System.Composition.TypedParts.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/System.Composition.TypedParts.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/System.Configuration.ConfigurationManager.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/System.Configuration.ConfigurationManager.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/System.Drawing.Common.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/System.Drawing.Common.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/System.IdentityModel.Tokens.Jwt.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/System.IdentityModel.Tokens.Jwt.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/System.Runtime.Caching.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/System.Runtime.Caching.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/System.Security.Cryptography.ProtectedData.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/System.Security.Cryptography.ProtectedData.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/System.Security.Permissions.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/System.Security.Permissions.dll
Executable file
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/System.Windows.Extensions.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/System.Windows.Extensions.dll
Executable file
Binary file not shown.
@ -0,0 +1,8 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
}
|
||||
}
|
||||
12
EGUI/lab2/lab2/bin/Debug/net6.0/appsettings.json
Normal file
12
EGUI/lab2/lab2/bin/Debug/net6.0/appsettings.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"ConnectionStrings": {
|
||||
"lab2UserContext": "Data Source=lab2UserContext-85435385-56ab-4666-ad5b-1892b82e95b9.db"
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/cs/Microsoft.CodeAnalysis.CSharp.resources.dll
Executable file
BIN
EGUI/lab2/lab2/bin/Debug/net6.0/cs/Microsoft.CodeAnalysis.CSharp.resources.dll
Executable file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user