diff --git a/TicketOffice/Migrations/20220326192901_InitialCreate.Designer.cs b/TicketOffice/Migrations/20220326192901_InitialCreate.Designer.cs deleted file mode 100644 index fc1ed8f..0000000 --- a/TicketOffice/Migrations/20220326192901_InitialCreate.Designer.cs +++ /dev/null @@ -1,179 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using TicketOffice.Data; - -#nullable disable - -namespace TicketOffice.Migrations -{ - [DbContext(typeof(TicketOfficeContext))] - [Migration("20220326192901_InitialCreate")] - partial class InitialCreate - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "6.0.3"); - - modelBuilder.Entity("TicketOffice.Models.City", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ArrivalTime") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("DepartureTime") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Distance") - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("TEXT"); - - b.Property("RouteId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("RouteId"); - - b.ToTable("City"); - }); - - modelBuilder.Entity("TicketOffice.Models.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Capacity") - .HasColumnType("INTEGER"); - - b.Property("Number") - .IsRequired() - .HasMaxLength(4) - .HasColumnType("TEXT"); - - b.Property("RemainingCapacity") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("Route"); - }); - - modelBuilder.Entity("TicketOffice.Models.Ticket", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("RouteId") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("RouteId"); - - b.HasIndex("UserId"); - - b.ToTable("Ticket"); - }); - - modelBuilder.Entity("TicketOffice.Models.User", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Email") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(16) - .HasColumnType("TEXT"); - - b.Property("IsManager") - .HasColumnType("INTEGER"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(16) - .HasColumnType("TEXT"); - - b.Property("Password") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property("Patronymic") - .IsRequired() - .HasMaxLength(16) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("User"); - }); - - modelBuilder.Entity("TicketOffice.Models.City", b => - { - b.HasOne("TicketOffice.Models.Route", "Route") - .WithMany("Cities") - .HasForeignKey("RouteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Route"); - }); - - modelBuilder.Entity("TicketOffice.Models.Ticket", b => - { - b.HasOne("TicketOffice.Models.Route", "Route") - .WithMany("Tickets") - .HasForeignKey("RouteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("TicketOffice.Models.User", "User") - .WithMany("Tickets") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Route"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("TicketOffice.Models.Route", b => - { - b.Navigation("Cities"); - - b.Navigation("Tickets"); - }); - - modelBuilder.Entity("TicketOffice.Models.User", b => - { - b.Navigation("Tickets"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/TicketOffice/Migrations/20220326192901_InitialCreate.cs b/TicketOffice/Migrations/20220326192901_InitialCreate.cs deleted file mode 100644 index d46c1d4..0000000 --- a/TicketOffice/Migrations/20220326192901_InitialCreate.cs +++ /dev/null @@ -1,125 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace TicketOffice.Migrations -{ - public partial class InitialCreate : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "Route", - columns: table => new - { - Id = table.Column(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - Number = table.Column(type: "TEXT", maxLength: 4, nullable: false), - Capacity = table.Column(type: "INTEGER", nullable: false), - RemainingCapacity = table.Column(type: "INTEGER", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Route", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "User", - columns: table => new - { - Id = table.Column(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - FirstName = table.Column(type: "TEXT", maxLength: 16, nullable: false), - LastName = table.Column(type: "TEXT", maxLength: 16, nullable: false), - Patronymic = table.Column(type: "TEXT", maxLength: 16, nullable: false), - Email = table.Column(type: "TEXT", nullable: false), - Password = table.Column(type: "TEXT", maxLength: 64, nullable: false), - IsManager = table.Column(type: "INTEGER", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_User", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "City", - columns: table => new - { - Id = table.Column(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - Name = table.Column(type: "TEXT", maxLength: 30, nullable: false), - ArrivalTime = table.Column(type: "TEXT", nullable: false), - DepartureTime = table.Column(type: "TEXT", nullable: false), - Distance = table.Column(type: "TEXT", nullable: false), - RouteId = table.Column(type: "INTEGER", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_City", x => x.Id); - table.ForeignKey( - name: "FK_City_Route_RouteId", - column: x => x.RouteId, - principalTable: "Route", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "Ticket", - columns: table => new - { - Id = table.Column(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - UserId = table.Column(type: "INTEGER", nullable: false), - RouteId = table.Column(type: "INTEGER", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Ticket", x => x.Id); - table.ForeignKey( - name: "FK_Ticket_Route_RouteId", - column: x => x.RouteId, - principalTable: "Route", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_Ticket_User_UserId", - column: x => x.UserId, - principalTable: "User", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_City_RouteId", - table: "City", - column: "RouteId"); - - migrationBuilder.CreateIndex( - name: "IX_Ticket_RouteId", - table: "Ticket", - column: "RouteId"); - - migrationBuilder.CreateIndex( - name: "IX_Ticket_UserId", - table: "Ticket", - column: "UserId"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "City"); - - migrationBuilder.DropTable( - name: "Ticket"); - - migrationBuilder.DropTable( - name: "Route"); - - migrationBuilder.DropTable( - name: "User"); - } - } -} diff --git a/TicketOffice/Migrations/TicketOfficeContextModelSnapshot.cs b/TicketOffice/Migrations/TicketOfficeContextModelSnapshot.cs deleted file mode 100644 index dfc6701..0000000 --- a/TicketOffice/Migrations/TicketOfficeContextModelSnapshot.cs +++ /dev/null @@ -1,177 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using TicketOffice.Data; - -#nullable disable - -namespace TicketOffice.Migrations -{ - [DbContext(typeof(TicketOfficeContext))] - partial class TicketOfficeContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "6.0.3"); - - modelBuilder.Entity("TicketOffice.Models.City", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ArrivalTime") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("DepartureTime") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Distance") - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("TEXT"); - - b.Property("RouteId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("RouteId"); - - b.ToTable("City"); - }); - - modelBuilder.Entity("TicketOffice.Models.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Capacity") - .HasColumnType("INTEGER"); - - b.Property("Number") - .IsRequired() - .HasMaxLength(4) - .HasColumnType("TEXT"); - - b.Property("RemainingCapacity") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("Route"); - }); - - modelBuilder.Entity("TicketOffice.Models.Ticket", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("RouteId") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("RouteId"); - - b.HasIndex("UserId"); - - b.ToTable("Ticket"); - }); - - modelBuilder.Entity("TicketOffice.Models.User", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Email") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(16) - .HasColumnType("TEXT"); - - b.Property("IsManager") - .HasColumnType("INTEGER"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(16) - .HasColumnType("TEXT"); - - b.Property("Password") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property("Patronymic") - .IsRequired() - .HasMaxLength(16) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("User"); - }); - - modelBuilder.Entity("TicketOffice.Models.City", b => - { - b.HasOne("TicketOffice.Models.Route", "Route") - .WithMany("Cities") - .HasForeignKey("RouteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Route"); - }); - - modelBuilder.Entity("TicketOffice.Models.Ticket", b => - { - b.HasOne("TicketOffice.Models.Route", "Route") - .WithMany("Tickets") - .HasForeignKey("RouteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("TicketOffice.Models.User", "User") - .WithMany("Tickets") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Route"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("TicketOffice.Models.Route", b => - { - b.Navigation("Cities"); - - b.Navigation("Tickets"); - }); - - modelBuilder.Entity("TicketOffice.Models.User", b => - { - b.Navigation("Tickets"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/TicketOffice/Pages/Management/Cities/Create.cshtml b/TicketOffice/Pages/Management/Cities/Create.cshtml deleted file mode 100644 index 1d40dc9..0000000 --- a/TicketOffice/Pages/Management/Cities/Create.cshtml +++ /dev/null @@ -1,50 +0,0 @@ -@page -@model TicketOffice.Pages.Management.Cities.CreateModel - -@{ - ViewData["Title"] = "Create"; -} - -

Create

- -

City

-
-
-
-
-
-
- - - -
-
- - - -
-
- - - -
-
- - - -
-
- - -
-
- -
-
-
-
- - - diff --git a/TicketOffice/Pages/Management/Cities/Create.cshtml.cs b/TicketOffice/Pages/Management/Cities/Create.cshtml.cs deleted file mode 100644 index 2cc9095..0000000 --- a/TicketOffice/Pages/Management/Cities/Create.cshtml.cs +++ /dev/null @@ -1,46 +0,0 @@ -#nullable disable -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.RazorPages; -using Microsoft.AspNetCore.Mvc.Rendering; -using TicketOffice.Data; -using TicketOffice.Models; - -namespace TicketOffice.Pages.Management.Cities -{ - public class CreateModel : PageModel - { - private readonly TicketOffice.Data.TicketOfficeContext _context; - - public CreateModel(TicketOffice.Data.TicketOfficeContext context) - { - _context = context; - } - - public IActionResult OnGet() - { - ViewData["RouteId"] = new SelectList(_context.Route, "Id", "Number"); - return Page(); - } - - [BindProperty] - public City City { get; set; } - - // To protect from overposting attacks, see https://aka.ms/RazorPagesCRUD - public async Task OnPostAsync() - { - if (!ModelState.IsValid) - { - return Page(); - } - - _context.City.Add(City); - await _context.SaveChangesAsync(); - - return RedirectToPage("./Index"); - } - } -} diff --git a/TicketOffice/Pages/Management/Cities/Delete.cshtml b/TicketOffice/Pages/Management/Cities/Delete.cshtml deleted file mode 100644 index 35bdf4d..0000000 --- a/TicketOffice/Pages/Management/Cities/Delete.cshtml +++ /dev/null @@ -1,52 +0,0 @@ -@page -@model TicketOffice.Pages.Management.Cities.DeleteModel - -@{ - ViewData["Title"] = "Delete"; -} - -

Delete

- -

Are you sure you want to delete this?

-
-

City

-
-
-
- @Html.DisplayNameFor(model => model.City.Name) -
-
- @Html.DisplayFor(model => model.City.Name) -
-
- @Html.DisplayNameFor(model => model.City.ArrivalTime) -
-
- @Html.DisplayFor(model => model.City.ArrivalTime) -
-
- @Html.DisplayNameFor(model => model.City.DepartureTime) -
-
- @Html.DisplayFor(model => model.City.DepartureTime) -
-
- @Html.DisplayNameFor(model => model.City.Distance) -
-
- @Html.DisplayFor(model => model.City.Distance) -
-
- @Html.DisplayNameFor(model => model.City.Route) -
-
- @Html.DisplayFor(model => model.City.Route.Number) -
-
- -
- - | - Back to List -
-
diff --git a/TicketOffice/Pages/Management/Cities/Delete.cshtml.cs b/TicketOffice/Pages/Management/Cities/Delete.cshtml.cs deleted file mode 100644 index 61eeb0d..0000000 --- a/TicketOffice/Pages/Management/Cities/Delete.cshtml.cs +++ /dev/null @@ -1,61 +0,0 @@ -#nullable disable -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.RazorPages; -using Microsoft.EntityFrameworkCore; -using TicketOffice.Data; -using TicketOffice.Models; - -namespace TicketOffice.Pages.Management.Cities -{ - public class DeleteModel : PageModel - { - private readonly TicketOffice.Data.TicketOfficeContext _context; - - public DeleteModel(TicketOffice.Data.TicketOfficeContext context) - { - _context = context; - } - - [BindProperty] - public City City { get; set; } - - public async Task OnGetAsync(int? id) - { - if (id == null) - { - return NotFound(); - } - - City = await _context.City - .Include(c => c.Route).FirstOrDefaultAsync(m => m.Id == id); - - if (City == null) - { - return NotFound(); - } - return Page(); - } - - public async Task OnPostAsync(int? id) - { - if (id == null) - { - return NotFound(); - } - - City = await _context.City.FindAsync(id); - - if (City != null) - { - _context.City.Remove(City); - await _context.SaveChangesAsync(); - } - - return RedirectToPage("./Index"); - } - } -} diff --git a/TicketOffice/Pages/Management/Cities/Details.cshtml b/TicketOffice/Pages/Management/Cities/Details.cshtml deleted file mode 100644 index 28665e7..0000000 --- a/TicketOffice/Pages/Management/Cities/Details.cshtml +++ /dev/null @@ -1,49 +0,0 @@ -@page -@model TicketOffice.Pages.Management.Cities.DetailsModel - -@{ - ViewData["Title"] = "Details"; -} - -

Details

- -
-

City

-
-
-
- @Html.DisplayNameFor(model => model.City.Name) -
-
- @Html.DisplayFor(model => model.City.Name) -
-
- @Html.DisplayNameFor(model => model.City.ArrivalTime) -
-
- @Html.DisplayFor(model => model.City.ArrivalTime) -
-
- @Html.DisplayNameFor(model => model.City.DepartureTime) -
-
- @Html.DisplayFor(model => model.City.DepartureTime) -
-
- @Html.DisplayNameFor(model => model.City.Distance) -
-
- @Html.DisplayFor(model => model.City.Distance) -
-
- @Html.DisplayNameFor(model => model.City.Route) -
-
- @Html.DisplayFor(model => model.City.Route.Number) -
-
-
- diff --git a/TicketOffice/Pages/Management/Cities/Details.cshtml.cs b/TicketOffice/Pages/Management/Cities/Details.cshtml.cs deleted file mode 100644 index f6928c1..0000000 --- a/TicketOffice/Pages/Management/Cities/Details.cshtml.cs +++ /dev/null @@ -1,42 +0,0 @@ -#nullable disable -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.RazorPages; -using Microsoft.EntityFrameworkCore; -using TicketOffice.Data; -using TicketOffice.Models; - -namespace TicketOffice.Pages.Management.Cities -{ - public class DetailsModel : PageModel - { - private readonly TicketOffice.Data.TicketOfficeContext _context; - - public DetailsModel(TicketOffice.Data.TicketOfficeContext context) - { - _context = context; - } - - public City City { get; set; } - - public async Task OnGetAsync(int? id) - { - if (id == null) - { - return NotFound(); - } - - City = await _context.City - .Include(c => c.Route).FirstOrDefaultAsync(m => m.Id == id); - - if (City == null) - { - return NotFound(); - } - return Page(); - } - } -} diff --git a/TicketOffice/Pages/Management/Cities/Edit.cshtml b/TicketOffice/Pages/Management/Cities/Edit.cshtml deleted file mode 100644 index 153b2f7..0000000 --- a/TicketOffice/Pages/Management/Cities/Edit.cshtml +++ /dev/null @@ -1,52 +0,0 @@ -@page -@model TicketOffice.Pages.Management.Cities.EditModel - -@{ - ViewData["Title"] = "Edit"; -} - -

Edit

- -

City

-
-
-
-
-
- -
- - - -
-
- - - -
-
- - - -
-
- - - -
-
- - - -
-
- -
-
-
-
- - - diff --git a/TicketOffice/Pages/Management/Cities/Edit.cshtml.cs b/TicketOffice/Pages/Management/Cities/Edit.cshtml.cs deleted file mode 100644 index 95158c0..0000000 --- a/TicketOffice/Pages/Management/Cities/Edit.cshtml.cs +++ /dev/null @@ -1,80 +0,0 @@ -#nullable disable -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.RazorPages; -using Microsoft.AspNetCore.Mvc.Rendering; -using Microsoft.EntityFrameworkCore; -using TicketOffice.Data; -using TicketOffice.Models; - -namespace TicketOffice.Pages.Management.Cities -{ - public class EditModel : PageModel - { - private readonly TicketOffice.Data.TicketOfficeContext _context; - - public EditModel(TicketOffice.Data.TicketOfficeContext context) - { - _context = context; - } - - [BindProperty] - public City City { get; set; } - - public async Task OnGetAsync(int? id) - { - if (id == null) - { - return NotFound(); - } - - City = await _context.City - .Include(c => c.Route).FirstOrDefaultAsync(m => m.Id == id); - - if (City == null) - { - return NotFound(); - } - ViewData["RouteId"] = new SelectList(_context.Route, "Id", "Number"); - return Page(); - } - - // To protect from overposting attacks, enable the specific properties you want to bind to. - // For more details, see https://aka.ms/RazorPagesCRUD. - public async Task OnPostAsync() - { - if (!ModelState.IsValid) - { - return Page(); - } - - _context.Attach(City).State = EntityState.Modified; - - try - { - await _context.SaveChangesAsync(); - } - catch (DbUpdateConcurrencyException) - { - if (!CityExists(City.Id)) - { - return NotFound(); - } - else - { - throw; - } - } - - return RedirectToPage("./Index"); - } - - private bool CityExists(int id) - { - return _context.City.Any(e => e.Id == id); - } - } -} diff --git a/TicketOffice/Pages/Management/Cities/Index.cshtml b/TicketOffice/Pages/Management/Cities/Index.cshtml deleted file mode 100644 index 8970c00..0000000 --- a/TicketOffice/Pages/Management/Cities/Index.cshtml +++ /dev/null @@ -1,60 +0,0 @@ -@page -@model TicketOffice.Pages.Management.Cities.IndexModel - -@{ - ViewData["Title"] = "Index"; -} - -

Index

- -

- Create New -

- - - - - - - - - - - - -@foreach (var item in Model.City) { - - - - - - - - -} - -
- @Html.DisplayNameFor(model => model.City[0].Name) - - @Html.DisplayNameFor(model => model.City[0].ArrivalTime) - - @Html.DisplayNameFor(model => model.City[0].DepartureTime) - - @Html.DisplayNameFor(model => model.City[0].Distance) - - @Html.DisplayNameFor(model => model.City[0].Route) -
- @Html.DisplayFor(modelItem => item.Name) - - @Html.DisplayFor(modelItem => item.ArrivalTime) - - @Html.DisplayFor(modelItem => item.DepartureTime) - - @Html.DisplayFor(modelItem => item.Distance) - - @Html.DisplayFor(modelItem => item.Route.Number) - - Edit | - Details | - Delete -
diff --git a/TicketOffice/Pages/Management/Cities/Index.cshtml.cs b/TicketOffice/Pages/Management/Cities/Index.cshtml.cs deleted file mode 100644 index e527ab4..0000000 --- a/TicketOffice/Pages/Management/Cities/Index.cshtml.cs +++ /dev/null @@ -1,31 +0,0 @@ -#nullable disable -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.RazorPages; -using Microsoft.EntityFrameworkCore; -using TicketOffice.Data; -using TicketOffice.Models; - -namespace TicketOffice.Pages.Management.Cities -{ - public class IndexModel : PageModel - { - private readonly TicketOffice.Data.TicketOfficeContext _context; - - public IndexModel(TicketOffice.Data.TicketOfficeContext context) - { - _context = context; - } - - public IList City { get;set; } - - public async Task OnGetAsync() - { - City = await _context.City - .Include(c => c.Route).ToListAsync(); - } - } -} diff --git a/TicketOffice/Pages/Management/Routes/Create.cshtml b/TicketOffice/Pages/Management/Routes/Create.cshtml deleted file mode 100644 index 4b52cf3..0000000 --- a/TicketOffice/Pages/Management/Routes/Create.cshtml +++ /dev/null @@ -1,41 +0,0 @@ -@page -@model TicketOffice.Pages.Management.Routes.CreateModel - -@{ - ViewData["Title"] = "Create"; -} - -

Create

- -

Route

-
-
-
-
-
-
- - - -
-
- - - -
-
- - - -
-
- -
-
-
-
- - - diff --git a/TicketOffice/Pages/Management/Routes/Create.cshtml.cs b/TicketOffice/Pages/Management/Routes/Create.cshtml.cs deleted file mode 100644 index a1c23cf..0000000 --- a/TicketOffice/Pages/Management/Routes/Create.cshtml.cs +++ /dev/null @@ -1,46 +0,0 @@ -#nullable disable -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.RazorPages; -using Microsoft.AspNetCore.Mvc.Rendering; -using TicketOffice.Data; -using TicketOffice.Models; -using Route = TicketOffice.Models.Route; - -namespace TicketOffice.Pages.Management.Routes -{ - public class CreateModel : PageModel - { - private readonly TicketOffice.Data.TicketOfficeContext _context; - - public CreateModel(TicketOffice.Data.TicketOfficeContext context) - { - _context = context; - } - - public IActionResult OnGet() - { - return Page(); - } - - [BindProperty] - public Route Route { get; set; } - - // To protect from overposting attacks, see https://aka.ms/RazorPagesCRUD - public async Task OnPostAsync() - { - if (!ModelState.IsValid) - { - return Page(); - } - - _context.Route.Add(Route); - await _context.SaveChangesAsync(); - - return RedirectToPage("./Index"); - } - } -} diff --git a/TicketOffice/Pages/Management/Routes/Delete.cshtml b/TicketOffice/Pages/Management/Routes/Delete.cshtml deleted file mode 100644 index 1e92bc9..0000000 --- a/TicketOffice/Pages/Management/Routes/Delete.cshtml +++ /dev/null @@ -1,40 +0,0 @@ -@page -@model TicketOffice.Pages.Management.Routes.DeleteModel - -@{ - ViewData["Title"] = "Delete"; -} - -

Delete

- -

Are you sure you want to delete this?

-
-

Route

-
-
-
- @Html.DisplayNameFor(model => model.Route.Number) -
-
- @Html.DisplayFor(model => model.Route.Number) -
-
- @Html.DisplayNameFor(model => model.Route.Capacity) -
-
- @Html.DisplayFor(model => model.Route.Capacity) -
-
- @Html.DisplayNameFor(model => model.Route.RemainingCapacity) -
-
- @Html.DisplayFor(model => model.Route.RemainingCapacity) -
-
- -
- - | - Back to List -
-
diff --git a/TicketOffice/Pages/Management/Routes/Delete.cshtml.cs b/TicketOffice/Pages/Management/Routes/Delete.cshtml.cs deleted file mode 100644 index e082e8b..0000000 --- a/TicketOffice/Pages/Management/Routes/Delete.cshtml.cs +++ /dev/null @@ -1,61 +0,0 @@ -#nullable disable -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.RazorPages; -using Microsoft.EntityFrameworkCore; -using TicketOffice.Data; -using TicketOffice.Models; -using Route = TicketOffice.Models.Route; - -namespace TicketOffice.Pages.Management.Routes -{ - public class DeleteModel : PageModel - { - private readonly TicketOffice.Data.TicketOfficeContext _context; - - public DeleteModel(TicketOffice.Data.TicketOfficeContext context) - { - _context = context; - } - - [BindProperty] - public Route Route { get; set; } - - public async Task OnGetAsync(int? id) - { - if (id == null) - { - return NotFound(); - } - - Route = await _context.Route.FirstOrDefaultAsync(m => m.Id == id); - - if (Route == null) - { - return NotFound(); - } - return Page(); - } - - public async Task OnPostAsync(int? id) - { - if (id == null) - { - return NotFound(); - } - - Route = await _context.Route.FindAsync(id); - - if (Route != null) - { - _context.Route.Remove(Route); - await _context.SaveChangesAsync(); - } - - return RedirectToPage("./Index"); - } - } -} diff --git a/TicketOffice/Pages/Management/Routes/Details.cshtml b/TicketOffice/Pages/Management/Routes/Details.cshtml deleted file mode 100644 index 9acc1d7..0000000 --- a/TicketOffice/Pages/Management/Routes/Details.cshtml +++ /dev/null @@ -1,37 +0,0 @@ -@page -@model TicketOffice.Pages.Management.Routes.DetailsModel - -@{ - ViewData["Title"] = "Details"; -} - -

Details

- -
-

Route

-
-
-
- @Html.DisplayNameFor(model => model.Route.Number) -
-
- @Html.DisplayFor(model => model.Route.Number) -
-
- @Html.DisplayNameFor(model => model.Route.Capacity) -
-
- @Html.DisplayFor(model => model.Route.Capacity) -
-
- @Html.DisplayNameFor(model => model.Route.RemainingCapacity) -
-
- @Html.DisplayFor(model => model.Route.RemainingCapacity) -
-
-
- diff --git a/TicketOffice/Pages/Management/Routes/Details.cshtml.cs b/TicketOffice/Pages/Management/Routes/Details.cshtml.cs deleted file mode 100644 index 7aecab2..0000000 --- a/TicketOffice/Pages/Management/Routes/Details.cshtml.cs +++ /dev/null @@ -1,42 +0,0 @@ -#nullable disable -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.RazorPages; -using Microsoft.EntityFrameworkCore; -using TicketOffice.Data; -using TicketOffice.Models; -using Route = TicketOffice.Models.Route; - -namespace TicketOffice.Pages.Management.Routes -{ - public class DetailsModel : PageModel - { - private readonly TicketOffice.Data.TicketOfficeContext _context; - - public DetailsModel(TicketOffice.Data.TicketOfficeContext context) - { - _context = context; - } - - public Route Route { get; set; } - - public async Task OnGetAsync(int? id) - { - if (id == null) - { - return NotFound(); - } - - Route = await _context.Route.FirstOrDefaultAsync(m => m.Id == id); - - if (Route == null) - { - return NotFound(); - } - return Page(); - } - } -} diff --git a/TicketOffice/Pages/Management/Routes/Edit.cshtml b/TicketOffice/Pages/Management/Routes/Edit.cshtml deleted file mode 100644 index 7f44425..0000000 --- a/TicketOffice/Pages/Management/Routes/Edit.cshtml +++ /dev/null @@ -1,42 +0,0 @@ -@page -@model TicketOffice.Pages.Management.Routes.EditModel - -@{ - ViewData["Title"] = "Edit"; -} - -

Edit

- -

Route

-
-
-
-
-
- -
- - - -
-
- - - -
-
- - - -
-
- -
-
-
-
- - - diff --git a/TicketOffice/Pages/Management/Routes/Edit.cshtml.cs b/TicketOffice/Pages/Management/Routes/Edit.cshtml.cs deleted file mode 100644 index a828be8..0000000 --- a/TicketOffice/Pages/Management/Routes/Edit.cshtml.cs +++ /dev/null @@ -1,79 +0,0 @@ -#nullable disable -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.RazorPages; -using Microsoft.AspNetCore.Mvc.Rendering; -using Microsoft.EntityFrameworkCore; -using TicketOffice.Data; -using TicketOffice.Models; -using Route = TicketOffice.Models.Route; - -namespace TicketOffice.Pages.Management.Routes -{ - public class EditModel : PageModel - { - private readonly TicketOffice.Data.TicketOfficeContext _context; - - public EditModel(TicketOffice.Data.TicketOfficeContext context) - { - _context = context; - } - - [BindProperty] - public Route Route { get; set; } - - public async Task OnGetAsync(int? id) - { - if (id == null) - { - return NotFound(); - } - - Route = await _context.Route.FirstOrDefaultAsync(m => m.Id == id); - - if (Route == null) - { - return NotFound(); - } - return Page(); - } - - // To protect from overposting attacks, enable the specific properties you want to bind to. - // For more details, see https://aka.ms/RazorPagesCRUD. - public async Task OnPostAsync() - { - if (!ModelState.IsValid) - { - return Page(); - } - - _context.Attach(Route).State = EntityState.Modified; - - try - { - await _context.SaveChangesAsync(); - } - catch (DbUpdateConcurrencyException) - { - if (!RouteExists(Route.Id)) - { - return NotFound(); - } - else - { - throw; - } - } - - return RedirectToPage("./Index"); - } - - private bool RouteExists(int id) - { - return _context.Route.Any(e => e.Id == id); - } - } -} diff --git a/TicketOffice/Pages/Management/Routes/Index.cshtml b/TicketOffice/Pages/Management/Routes/Index.cshtml deleted file mode 100644 index 6425ca0..0000000 --- a/TicketOffice/Pages/Management/Routes/Index.cshtml +++ /dev/null @@ -1,48 +0,0 @@ -@page -@model TicketOffice.Pages.Management.Routes.IndexModel - -@{ - ViewData["Title"] = "Index"; -} - -

Index

- -

- Create New -

- - - - - - - - - - -@foreach (var item in Model.Route) { - - - - - - -} - -
- @Html.DisplayNameFor(model => model.Route[0].Number) - - @Html.DisplayNameFor(model => model.Route[0].Capacity) - - @Html.DisplayNameFor(model => model.Route[0].RemainingCapacity) -
- @Html.DisplayFor(modelItem => item.Number) - - @Html.DisplayFor(modelItem => item.Capacity) - - @Html.DisplayFor(modelItem => item.RemainingCapacity) - - Edit | - Details | - Delete -
diff --git a/TicketOffice/Pages/Management/Routes/Index.cshtml.cs b/TicketOffice/Pages/Management/Routes/Index.cshtml.cs deleted file mode 100644 index a2e3180..0000000 --- a/TicketOffice/Pages/Management/Routes/Index.cshtml.cs +++ /dev/null @@ -1,31 +0,0 @@ -#nullable disable -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.RazorPages; -using Microsoft.EntityFrameworkCore; -using TicketOffice.Data; -using TicketOffice.Models; -using Route = TicketOffice.Models.Route; - -namespace TicketOffice.Pages.Management.Routes -{ - public class IndexModel : PageModel - { - private readonly TicketOffice.Data.TicketOfficeContext _context; - - public IndexModel(TicketOffice.Data.TicketOfficeContext context) - { - _context = context; - } - - public IList Route { get;set; } - - public async Task OnGetAsync() - { - Route = await _context.Route.ToListAsync(); - } - } -} diff --git a/TicketOffice/Pages/Management/Tickets/Create.cshtml b/TicketOffice/Pages/Management/Tickets/Create.cshtml deleted file mode 100644 index fe91e85..0000000 --- a/TicketOffice/Pages/Management/Tickets/Create.cshtml +++ /dev/null @@ -1,34 +0,0 @@ -@page -@model TicketOffice.Pages.Management.Tickets.CreateModel - -@{ - ViewData["Title"] = "Create"; -} - -

Create

- -

Ticket

-
-
-
-
-
-
- - -
-
- - -
-
- -
-
-
-
- - - diff --git a/TicketOffice/Pages/Management/Tickets/Create.cshtml.cs b/TicketOffice/Pages/Management/Tickets/Create.cshtml.cs deleted file mode 100644 index b27c66e..0000000 --- a/TicketOffice/Pages/Management/Tickets/Create.cshtml.cs +++ /dev/null @@ -1,47 +0,0 @@ -#nullable disable -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.RazorPages; -using Microsoft.AspNetCore.Mvc.Rendering; -using TicketOffice.Data; -using TicketOffice.Models; - -namespace TicketOffice.Pages.Management.Tickets -{ - public class CreateModel : PageModel - { - private readonly TicketOffice.Data.TicketOfficeContext _context; - - public CreateModel(TicketOffice.Data.TicketOfficeContext context) - { - _context = context; - } - - public IActionResult OnGet() - { - ViewData["RouteId"] = new SelectList(_context.Route, "Id", "Number"); - ViewData["UserId"] = new SelectList(_context.User, "Id", "Email"); - return Page(); - } - - [BindProperty] - public Ticket Ticket { get; set; } - - // To protect from overposting attacks, see https://aka.ms/RazorPagesCRUD - public async Task OnPostAsync() - { - if (!ModelState.IsValid) - { - return Page(); - } - - _context.Ticket.Add(Ticket); - await _context.SaveChangesAsync(); - - return RedirectToPage("./Index"); - } - } -} diff --git a/TicketOffice/Pages/Management/Tickets/Delete.cshtml b/TicketOffice/Pages/Management/Tickets/Delete.cshtml deleted file mode 100644 index 08b7580..0000000 --- a/TicketOffice/Pages/Management/Tickets/Delete.cshtml +++ /dev/null @@ -1,34 +0,0 @@ -@page -@model TicketOffice.Pages.Management.Tickets.DeleteModel - -@{ - ViewData["Title"] = "Delete"; -} - -

Delete

- -

Are you sure you want to delete this?

-
-

Ticket

-
-
-
- @Html.DisplayNameFor(model => model.Ticket.User) -
-
- @Html.DisplayFor(model => model.Ticket.User.Email) -
-
- @Html.DisplayNameFor(model => model.Ticket.Route) -
-
- @Html.DisplayFor(model => model.Ticket.Route.Number) -
-
- -
- - | - Back to List -
-
diff --git a/TicketOffice/Pages/Management/Tickets/Delete.cshtml.cs b/TicketOffice/Pages/Management/Tickets/Delete.cshtml.cs deleted file mode 100644 index 7c9ed69..0000000 --- a/TicketOffice/Pages/Management/Tickets/Delete.cshtml.cs +++ /dev/null @@ -1,62 +0,0 @@ -#nullable disable -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.RazorPages; -using Microsoft.EntityFrameworkCore; -using TicketOffice.Data; -using TicketOffice.Models; - -namespace TicketOffice.Pages.Management.Tickets -{ - public class DeleteModel : PageModel - { - private readonly TicketOffice.Data.TicketOfficeContext _context; - - public DeleteModel(TicketOffice.Data.TicketOfficeContext context) - { - _context = context; - } - - [BindProperty] - public Ticket Ticket { get; set; } - - public async Task OnGetAsync(int? id) - { - if (id == null) - { - return NotFound(); - } - - Ticket = await _context.Ticket - .Include(t => t.Route) - .Include(t => t.User).FirstOrDefaultAsync(m => m.Id == id); - - if (Ticket == null) - { - return NotFound(); - } - return Page(); - } - - public async Task OnPostAsync(int? id) - { - if (id == null) - { - return NotFound(); - } - - Ticket = await _context.Ticket.FindAsync(id); - - if (Ticket != null) - { - _context.Ticket.Remove(Ticket); - await _context.SaveChangesAsync(); - } - - return RedirectToPage("./Index"); - } - } -} diff --git a/TicketOffice/Pages/Management/Tickets/Details.cshtml b/TicketOffice/Pages/Management/Tickets/Details.cshtml deleted file mode 100644 index 4a71c11..0000000 --- a/TicketOffice/Pages/Management/Tickets/Details.cshtml +++ /dev/null @@ -1,31 +0,0 @@ -@page -@model TicketOffice.Pages.Management.Tickets.DetailsModel - -@{ - ViewData["Title"] = "Details"; -} - -

Details

- -
-

Ticket

-
-
-
- @Html.DisplayNameFor(model => model.Ticket.User) -
-
- @Html.DisplayFor(model => model.Ticket.User.Email) -
-
- @Html.DisplayNameFor(model => model.Ticket.Route) -
-
- @Html.DisplayFor(model => model.Ticket.Route.Number) -
-
-
- diff --git a/TicketOffice/Pages/Management/Tickets/Details.cshtml.cs b/TicketOffice/Pages/Management/Tickets/Details.cshtml.cs deleted file mode 100644 index df406fb..0000000 --- a/TicketOffice/Pages/Management/Tickets/Details.cshtml.cs +++ /dev/null @@ -1,43 +0,0 @@ -#nullable disable -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.RazorPages; -using Microsoft.EntityFrameworkCore; -using TicketOffice.Data; -using TicketOffice.Models; - -namespace TicketOffice.Pages.Management.Tickets -{ - public class DetailsModel : PageModel - { - private readonly TicketOffice.Data.TicketOfficeContext _context; - - public DetailsModel(TicketOffice.Data.TicketOfficeContext context) - { - _context = context; - } - - public Ticket Ticket { get; set; } - - public async Task OnGetAsync(int? id) - { - if (id == null) - { - return NotFound(); - } - - Ticket = await _context.Ticket - .Include(t => t.Route) - .Include(t => t.User).FirstOrDefaultAsync(m => m.Id == id); - - if (Ticket == null) - { - return NotFound(); - } - return Page(); - } - } -} diff --git a/TicketOffice/Pages/Management/Tickets/Edit.cshtml b/TicketOffice/Pages/Management/Tickets/Edit.cshtml deleted file mode 100644 index 95ad28b..0000000 --- a/TicketOffice/Pages/Management/Tickets/Edit.cshtml +++ /dev/null @@ -1,37 +0,0 @@ -@page -@model TicketOffice.Pages.Management.Tickets.EditModel - -@{ - ViewData["Title"] = "Edit"; -} - -

Edit

- -

Ticket

-
-
-
-
-
- -
- - - -
-
- - - -
-
- -
-
-
-
- - - diff --git a/TicketOffice/Pages/Management/Tickets/Edit.cshtml.cs b/TicketOffice/Pages/Management/Tickets/Edit.cshtml.cs deleted file mode 100644 index 24057c5..0000000 --- a/TicketOffice/Pages/Management/Tickets/Edit.cshtml.cs +++ /dev/null @@ -1,82 +0,0 @@ -#nullable disable -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.RazorPages; -using Microsoft.AspNetCore.Mvc.Rendering; -using Microsoft.EntityFrameworkCore; -using TicketOffice.Data; -using TicketOffice.Models; - -namespace TicketOffice.Pages.Management.Tickets -{ - public class EditModel : PageModel - { - private readonly TicketOffice.Data.TicketOfficeContext _context; - - public EditModel(TicketOffice.Data.TicketOfficeContext context) - { - _context = context; - } - - [BindProperty] - public Ticket Ticket { get; set; } - - public async Task OnGetAsync(int? id) - { - if (id == null) - { - return NotFound(); - } - - Ticket = await _context.Ticket - .Include(t => t.Route) - .Include(t => t.User).FirstOrDefaultAsync(m => m.Id == id); - - if (Ticket == null) - { - return NotFound(); - } - ViewData["RouteId"] = new SelectList(_context.Route, "Id", "Number"); - ViewData["UserId"] = new SelectList(_context.User, "Id", "Email"); - return Page(); - } - - // To protect from overposting attacks, enable the specific properties you want to bind to. - // For more details, see https://aka.ms/RazorPagesCRUD. - public async Task OnPostAsync() - { - if (!ModelState.IsValid) - { - return Page(); - } - - _context.Attach(Ticket).State = EntityState.Modified; - - try - { - await _context.SaveChangesAsync(); - } - catch (DbUpdateConcurrencyException) - { - if (!TicketExists(Ticket.Id)) - { - return NotFound(); - } - else - { - throw; - } - } - - return RedirectToPage("./Index"); - } - - private bool TicketExists(int id) - { - return _context.Ticket.Any(e => e.Id == id); - } - } -} diff --git a/TicketOffice/Pages/Management/Tickets/Index.cshtml b/TicketOffice/Pages/Management/Tickets/Index.cshtml deleted file mode 100644 index bdca7bb..0000000 --- a/TicketOffice/Pages/Management/Tickets/Index.cshtml +++ /dev/null @@ -1,42 +0,0 @@ -@page -@model TicketOffice.Pages.Management.Tickets.IndexModel - -@{ - ViewData["Title"] = "Index"; -} - -

Index

- -

- Create New -

- - - - - - - - - -@foreach (var item in Model.Ticket) { - - - - - -} - -
- @Html.DisplayNameFor(model => model.Ticket[0].User) - - @Html.DisplayNameFor(model => model.Ticket[0].Route) -
- @Html.DisplayFor(modelItem => item.User.Email) - - @Html.DisplayFor(modelItem => item.Route.Number) - - Edit | - Details | - Delete -
diff --git a/TicketOffice/Pages/Management/Tickets/Index.cshtml.cs b/TicketOffice/Pages/Management/Tickets/Index.cshtml.cs deleted file mode 100644 index 3f8fb47..0000000 --- a/TicketOffice/Pages/Management/Tickets/Index.cshtml.cs +++ /dev/null @@ -1,32 +0,0 @@ -#nullable disable -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.RazorPages; -using Microsoft.EntityFrameworkCore; -using TicketOffice.Data; -using TicketOffice.Models; - -namespace TicketOffice.Pages.Management.Tickets -{ - public class IndexModel : PageModel - { - private readonly TicketOffice.Data.TicketOfficeContext _context; - - public IndexModel(TicketOffice.Data.TicketOfficeContext context) - { - _context = context; - } - - public IList Ticket { get;set; } - - public async Task OnGetAsync() - { - Ticket = await _context.Ticket - .Include(t => t.Route) - .Include(t => t.User).ToListAsync(); - } - } -} diff --git a/TicketOffice/Pages/Management/Users/Create.cshtml b/TicketOffice/Pages/Management/Users/Create.cshtml deleted file mode 100644 index 8a23425..0000000 --- a/TicketOffice/Pages/Management/Users/Create.cshtml +++ /dev/null @@ -1,56 +0,0 @@ -@page -@model TicketOffice.Pages.Management.Users.CreateModel - -@{ - ViewData["Title"] = "Create"; -} - -

Create

- -

User

-
-
-
-
-
-
- - - -
-
- - - -
-
- - - -
-
- - - -
-
- - - -
-
- -
-
- -
-
-
-
- - - diff --git a/TicketOffice/Pages/Management/Users/Create.cshtml.cs b/TicketOffice/Pages/Management/Users/Create.cshtml.cs deleted file mode 100644 index df81cef..0000000 --- a/TicketOffice/Pages/Management/Users/Create.cshtml.cs +++ /dev/null @@ -1,45 +0,0 @@ -#nullable disable -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.RazorPages; -using Microsoft.AspNetCore.Mvc.Rendering; -using TicketOffice.Data; -using TicketOffice.Models; - -namespace TicketOffice.Pages.Management.Users -{ - public class CreateModel : PageModel - { - private readonly TicketOffice.Data.TicketOfficeContext _context; - - public CreateModel(TicketOffice.Data.TicketOfficeContext context) - { - _context = context; - } - - public IActionResult OnGet() - { - return Page(); - } - - [BindProperty] - public User User { get; set; } - - // To protect from overposting attacks, see https://aka.ms/RazorPagesCRUD - public async Task OnPostAsync() - { - if (!ModelState.IsValid) - { - return Page(); - } - - _context.User.Add(User); - await _context.SaveChangesAsync(); - - return RedirectToPage("./Index"); - } - } -} diff --git a/TicketOffice/Pages/Management/Users/Delete.cshtml b/TicketOffice/Pages/Management/Users/Delete.cshtml deleted file mode 100644 index fe89a44..0000000 --- a/TicketOffice/Pages/Management/Users/Delete.cshtml +++ /dev/null @@ -1,58 +0,0 @@ -@page -@model TicketOffice.Pages.Management.Users.DeleteModel - -@{ - ViewData["Title"] = "Delete"; -} - -

Delete

- -

Are you sure you want to delete this?

-
-

User

-
-
-
- @Html.DisplayNameFor(model => model.User.FirstName) -
-
- @Html.DisplayFor(model => model.User.FirstName) -
-
- @Html.DisplayNameFor(model => model.User.LastName) -
-
- @Html.DisplayFor(model => model.User.LastName) -
-
- @Html.DisplayNameFor(model => model.User.Patronymic) -
-
- @Html.DisplayFor(model => model.User.Patronymic) -
-
- @Html.DisplayNameFor(model => model.User.Email) -
-
- @Html.DisplayFor(model => model.User.Email) -
-
- @Html.DisplayNameFor(model => model.User.Password) -
-
- @Html.DisplayFor(model => model.User.Password) -
-
- @Html.DisplayNameFor(model => model.User.IsManager) -
-
- @Html.DisplayFor(model => model.User.IsManager) -
-
- -
- - | - Back to List -
-
diff --git a/TicketOffice/Pages/Management/Users/Delete.cshtml.cs b/TicketOffice/Pages/Management/Users/Delete.cshtml.cs deleted file mode 100644 index 91b16cb..0000000 --- a/TicketOffice/Pages/Management/Users/Delete.cshtml.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable disable -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.RazorPages; -using Microsoft.EntityFrameworkCore; -using TicketOffice.Data; -using TicketOffice.Models; - -namespace TicketOffice.Pages.Management.Users -{ - public class DeleteModel : PageModel - { - private readonly TicketOffice.Data.TicketOfficeContext _context; - - public DeleteModel(TicketOffice.Data.TicketOfficeContext context) - { - _context = context; - } - - [BindProperty] - public User User { get; set; } - - public async Task OnGetAsync(int? id) - { - if (id == null) - { - return NotFound(); - } - - User = await _context.User.FirstOrDefaultAsync(m => m.Id == id); - - if (User == null) - { - return NotFound(); - } - return Page(); - } - - public async Task OnPostAsync(int? id) - { - if (id == null) - { - return NotFound(); - } - - User = await _context.User.FindAsync(id); - - if (User != null) - { - _context.User.Remove(User); - await _context.SaveChangesAsync(); - } - - return RedirectToPage("./Index"); - } - } -} diff --git a/TicketOffice/Pages/Management/Users/Details.cshtml b/TicketOffice/Pages/Management/Users/Details.cshtml deleted file mode 100644 index 58a3b02..0000000 --- a/TicketOffice/Pages/Management/Users/Details.cshtml +++ /dev/null @@ -1,55 +0,0 @@ -@page -@model TicketOffice.Pages.Management.Users.DetailsModel - -@{ - ViewData["Title"] = "Details"; -} - -

Details

- -
-

User

-
-
-
- @Html.DisplayNameFor(model => model.User.FirstName) -
-
- @Html.DisplayFor(model => model.User.FirstName) -
-
- @Html.DisplayNameFor(model => model.User.LastName) -
-
- @Html.DisplayFor(model => model.User.LastName) -
-
- @Html.DisplayNameFor(model => model.User.Patronymic) -
-
- @Html.DisplayFor(model => model.User.Patronymic) -
-
- @Html.DisplayNameFor(model => model.User.Email) -
-
- @Html.DisplayFor(model => model.User.Email) -
-
- @Html.DisplayNameFor(model => model.User.Password) -
-
- @Html.DisplayFor(model => model.User.Password) -
-
- @Html.DisplayNameFor(model => model.User.IsManager) -
-
- @Html.DisplayFor(model => model.User.IsManager) -
-
-
- diff --git a/TicketOffice/Pages/Management/Users/Details.cshtml.cs b/TicketOffice/Pages/Management/Users/Details.cshtml.cs deleted file mode 100644 index afe52ec..0000000 --- a/TicketOffice/Pages/Management/Users/Details.cshtml.cs +++ /dev/null @@ -1,41 +0,0 @@ -#nullable disable -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.RazorPages; -using Microsoft.EntityFrameworkCore; -using TicketOffice.Data; -using TicketOffice.Models; - -namespace TicketOffice.Pages.Management.Users -{ - public class DetailsModel : PageModel - { - private readonly TicketOffice.Data.TicketOfficeContext _context; - - public DetailsModel(TicketOffice.Data.TicketOfficeContext context) - { - _context = context; - } - - public User User { get; set; } - - public async Task OnGetAsync(int? id) - { - if (id == null) - { - return NotFound(); - } - - User = await _context.User.FirstOrDefaultAsync(m => m.Id == id); - - if (User == null) - { - return NotFound(); - } - return Page(); - } - } -} diff --git a/TicketOffice/Pages/Management/Users/Edit.cshtml b/TicketOffice/Pages/Management/Users/Edit.cshtml deleted file mode 100644 index 8654b42..0000000 --- a/TicketOffice/Pages/Management/Users/Edit.cshtml +++ /dev/null @@ -1,57 +0,0 @@ -@page -@model TicketOffice.Pages.Management.Users.EditModel - -@{ - ViewData["Title"] = "Edit"; -} - -

Edit

- -

User

-
-
-
-
-
- -
- - - -
-
- - - -
-
- - - -
-
- - - -
-
- - - -
-
- -
-
- -
-
-
-
- - - diff --git a/TicketOffice/Pages/Management/Users/Edit.cshtml.cs b/TicketOffice/Pages/Management/Users/Edit.cshtml.cs deleted file mode 100644 index 5fdb56c..0000000 --- a/TicketOffice/Pages/Management/Users/Edit.cshtml.cs +++ /dev/null @@ -1,78 +0,0 @@ -#nullable disable -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.RazorPages; -using Microsoft.AspNetCore.Mvc.Rendering; -using Microsoft.EntityFrameworkCore; -using TicketOffice.Data; -using TicketOffice.Models; - -namespace TicketOffice.Pages.Management.Users -{ - public class EditModel : PageModel - { - private readonly TicketOffice.Data.TicketOfficeContext _context; - - public EditModel(TicketOffice.Data.TicketOfficeContext context) - { - _context = context; - } - - [BindProperty] - public User User { get; set; } - - public async Task OnGetAsync(int? id) - { - if (id == null) - { - return NotFound(); - } - - User = await _context.User.FirstOrDefaultAsync(m => m.Id == id); - - if (User == null) - { - return NotFound(); - } - return Page(); - } - - // To protect from overposting attacks, enable the specific properties you want to bind to. - // For more details, see https://aka.ms/RazorPagesCRUD. - public async Task OnPostAsync() - { - if (!ModelState.IsValid) - { - return Page(); - } - - _context.Attach(User).State = EntityState.Modified; - - try - { - await _context.SaveChangesAsync(); - } - catch (DbUpdateConcurrencyException) - { - if (!UserExists(User.Id)) - { - return NotFound(); - } - else - { - throw; - } - } - - return RedirectToPage("./Index"); - } - - private bool UserExists(int id) - { - return _context.User.Any(e => e.Id == id); - } - } -} diff --git a/TicketOffice/Pages/Management/Users/Index.cshtml b/TicketOffice/Pages/Management/Users/Index.cshtml deleted file mode 100644 index efd5a61..0000000 --- a/TicketOffice/Pages/Management/Users/Index.cshtml +++ /dev/null @@ -1,66 +0,0 @@ -@page -@model TicketOffice.Pages.Management.Users.IndexModel - -@{ - ViewData["Title"] = "Index"; -} - -

Index

- -

- Create New -

- - - - - - - - - - - - - -@foreach (var item in Model.User) { - - - - - - - - - -} - -
- @Html.DisplayNameFor(model => model.User[0].FirstName) - - @Html.DisplayNameFor(model => model.User[0].LastName) - - @Html.DisplayNameFor(model => model.User[0].Patronymic) - - @Html.DisplayNameFor(model => model.User[0].Email) - - @Html.DisplayNameFor(model => model.User[0].Password) - - @Html.DisplayNameFor(model => model.User[0].IsManager) -
- @Html.DisplayFor(modelItem => item.FirstName) - - @Html.DisplayFor(modelItem => item.LastName) - - @Html.DisplayFor(modelItem => item.Patronymic) - - @Html.DisplayFor(modelItem => item.Email) - - @Html.DisplayFor(modelItem => item.Password) - - @Html.DisplayFor(modelItem => item.IsManager) - - Edit | - Details | - Delete -
diff --git a/TicketOffice/Pages/Management/Users/Index.cshtml.cs b/TicketOffice/Pages/Management/Users/Index.cshtml.cs deleted file mode 100644 index 094ddf0..0000000 --- a/TicketOffice/Pages/Management/Users/Index.cshtml.cs +++ /dev/null @@ -1,30 +0,0 @@ -#nullable disable -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.RazorPages; -using Microsoft.EntityFrameworkCore; -using TicketOffice.Data; -using TicketOffice.Models; - -namespace TicketOffice.Pages.Management.Users -{ - public class IndexModel : PageModel - { - private readonly TicketOffice.Data.TicketOfficeContext _context; - - public IndexModel(TicketOffice.Data.TicketOfficeContext context) - { - _context = context; - } - - public IList User { get;set; } - - public async Task OnGetAsync() - { - User = await _context.User.ToListAsync(); - } - } -} diff --git a/TicketOffice/wwwroot/css/site.css b/TicketOffice/wwwroot/css/site.css deleted file mode 100644 index f27e5ad..0000000 --- a/TicketOffice/wwwroot/css/site.css +++ /dev/null @@ -1,18 +0,0 @@ -html { - font-size: 14px; -} - -@media (min-width: 768px) { - html { - font-size: 16px; - } -} - -html { - position: relative; - min-height: 100%; -} - -body { - margin-bottom: 60px; -} \ No newline at end of file diff --git a/TicketOffice/wwwroot/db/TicketOffice-SQLite.db b/TicketOffice/wwwroot/db/TicketOffice-SQLite.db deleted file mode 100644 index 6dd5e7c..0000000 Binary files a/TicketOffice/wwwroot/db/TicketOffice-SQLite.db and /dev/null differ