From 59422301d83029520f7f28b1e94a15f524b2340c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D0=B0=D1=88=D0=B8=D0=BD=20=D0=9C=D0=B0=D0=BA=D1=81?= =?UTF-8?q?=D0=B8=D0=BC?= Date: Fri, 19 May 2023 12:56:56 +0400 Subject: [PATCH] Rename --- .../Controllers/HomeController.cs | 2 +- .../AddConferenceBookingToConference.cshtml | 3 +- .../BusinessLogics/ReportLogicHeadwaiter.cs | 2 +- .../AbstractSaveToPdfHeadwaiter.cs | 2 +- .../ConferenceBookingBindingModel.cs | 2 +- .../ViewModels/ConferenceBookingViewModel.cs | 2 +- .../ViewModels/ReportDinnersViewModel.cs | 2 +- .../20230519085242_rename.Designer.cs | 567 ++++++++++++++++++ .../Migrations/20230519085242_rename.cs | 28 + .../Migrations/HotelDataBaseModelSnapshot.cs | 8 +- .../Models/ConferenceBooking.cs | 5 +- .../Models/IConferenceBookingModel.cs | 1 + 12 files changed, 610 insertions(+), 14 deletions(-) create mode 100644 Hotel/HotelDataBaseImplement/Migrations/20230519085242_rename.Designer.cs create mode 100644 Hotel/HotelDataBaseImplement/Migrations/20230519085242_rename.cs diff --git a/Hotel/HostrelHeadwaiterApp/Controllers/HomeController.cs b/Hotel/HostrelHeadwaiterApp/Controllers/HomeController.cs index 906fb57..aa5b2e0 100644 --- a/Hotel/HostrelHeadwaiterApp/Controllers/HomeController.cs +++ b/Hotel/HostrelHeadwaiterApp/Controllers/HomeController.cs @@ -550,7 +550,7 @@ namespace HostrelHeadwaiterApp.Controllers Id = conferenceBooking, ConferenceId = conference, NameHall = conferenceBookingElem.NameHall, - StartDate = conferenceBookingElem.StartDate, + BookingDate = conferenceBookingElem.BookingDate, HeadwaiterId = conferenceBookingElem.HeadwaiterId, }); Response.Redirect("ListConferenceBookings"); diff --git a/Hotel/HostrelHeadwaiterApp/Views/Home/AddConferenceBookingToConference.cshtml b/Hotel/HostrelHeadwaiterApp/Views/Home/AddConferenceBookingToConference.cshtml index 2ffb672..e68d067 100644 --- a/Hotel/HostrelHeadwaiterApp/Views/Home/AddConferenceBookingToConference.cshtml +++ b/Hotel/HostrelHeadwaiterApp/Views/Home/AddConferenceBookingToConference.cshtml @@ -21,10 +21,9 @@

diff --git a/Hotel/HotelBusinessLogic/BusinessLogics/ReportLogicHeadwaiter.cs b/Hotel/HotelBusinessLogic/BusinessLogics/ReportLogicHeadwaiter.cs index 67ce229..683ab23 100644 --- a/Hotel/HotelBusinessLogic/BusinessLogics/ReportLogicHeadwaiter.cs +++ b/Hotel/HotelBusinessLogic/BusinessLogics/ReportLogicHeadwaiter.cs @@ -108,7 +108,7 @@ namespace HotelBusinessLogic.BusinessLogics DinnerName = mp.DinnerName, DinnerPrice = mp.DinnerPrice, NameHall = conferenceBooking.NameHall, - StartDate = conferenceBooking.StartDate + BookingDate = conferenceBooking.BookingDate }); } diff --git a/Hotel/HotelBusinessLogic/OfficePackage/AbstractSaveToPdfHeadwaiter.cs b/Hotel/HotelBusinessLogic/OfficePackage/AbstractSaveToPdfHeadwaiter.cs index 0597480..3a9bce6 100644 --- a/Hotel/HotelBusinessLogic/OfficePackage/AbstractSaveToPdfHeadwaiter.cs +++ b/Hotel/HotelBusinessLogic/OfficePackage/AbstractSaveToPdfHeadwaiter.cs @@ -36,7 +36,7 @@ namespace HotelBusinessLogic.OfficePackage { CreateRow(new PdfRowParameters { - Texts = new List { dinner.DinnerName.ToString(), dinner.RoomName, dinner.RoomPrice.ToString(), dinner.NameHall, dinner.StartDate?.ToShortDateString() }, + Texts = new List { dinner.DinnerName.ToString(), dinner.RoomName, dinner.RoomPrice.ToString(), dinner.NameHall, dinner.BookingDate?.ToShortDateString() }, Style = "Normal", ParagraphAlignment = PdfParagraphAlignmentType.Left }); diff --git a/Hotel/HotelContracts/BindingModels/ConferenceBookingBindingModel.cs b/Hotel/HotelContracts/BindingModels/ConferenceBookingBindingModel.cs index 865c583..5866a81 100644 --- a/Hotel/HotelContracts/BindingModels/ConferenceBookingBindingModel.cs +++ b/Hotel/HotelContracts/BindingModels/ConferenceBookingBindingModel.cs @@ -10,7 +10,7 @@ namespace HotelContracts.BindingModels public string NameHall { get; set; } = string.Empty; - public DateTime? StartDate { get; set; } = DateTime.Now; + public DateTime? BookingDate { get; set; } = DateTime.Now; public int Id { get; set; } public Dictionary ConferenceBookingDinners { get; set; } = new(); diff --git a/Hotel/HotelContracts/ViewModels/ConferenceBookingViewModel.cs b/Hotel/HotelContracts/ViewModels/ConferenceBookingViewModel.cs index c62bb3c..4294795 100644 --- a/Hotel/HotelContracts/ViewModels/ConferenceBookingViewModel.cs +++ b/Hotel/HotelContracts/ViewModels/ConferenceBookingViewModel.cs @@ -12,7 +12,7 @@ namespace HotelContracts.ViewModels public class ConferenceBookingViewModel : IConferenceBookingModel { [DisplayName("Дата начала конференции")] - public DateTime? StartDate { get; set; } + public DateTime? BookingDate { get; set; } public int HeadwaiterId { get; set; } public int? ConferenceId { get; set; } diff --git a/Hotel/HotelContracts/ViewModels/ReportDinnersViewModel.cs b/Hotel/HotelContracts/ViewModels/ReportDinnersViewModel.cs index 38d0b51..2b83e8c 100644 --- a/Hotel/HotelContracts/ViewModels/ReportDinnersViewModel.cs +++ b/Hotel/HotelContracts/ViewModels/ReportDinnersViewModel.cs @@ -11,7 +11,7 @@ namespace HotelContracts.ViewModels public int Id { get; set; } public string RoomName { get; set; } = string.Empty; public string NameHall { get; set; } = string.Empty; - public DateTime? StartDate { get; set; } + public DateTime? BookingDate { get; set; } public string DinnerName { get; set; } = string.Empty; public double DinnerPrice { get; set; } public double RoomPrice { get; set; } diff --git a/Hotel/HotelDataBaseImplement/Migrations/20230519085242_rename.Designer.cs b/Hotel/HotelDataBaseImplement/Migrations/20230519085242_rename.Designer.cs new file mode 100644 index 0000000..c84c1bc --- /dev/null +++ b/Hotel/HotelDataBaseImplement/Migrations/20230519085242_rename.Designer.cs @@ -0,0 +1,567 @@ +// +using System; +using HotelDataBaseImplement; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace HotelDataBaseImplement.Migrations +{ + [DbContext(typeof(HotelDataBase))] + [Migration("20230519085242_rename")] + partial class rename + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "7.0.5") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.Entity("HotelDataBaseImplement.Models.Conference", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ConferenceName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("OrganiserId") + .HasColumnType("int"); + + b.Property("StartDate") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.HasIndex("OrganiserId"); + + b.ToTable("Conferences"); + }); + + modelBuilder.Entity("HotelDataBaseImplement.Models.ConferenceBooking", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("BookingDate") + .IsRequired() + .HasColumnType("datetime2"); + + b.Property("ConferenceId") + .HasColumnType("int"); + + b.Property("HeadwaiterId") + .HasColumnType("int"); + + b.Property("NameHall") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("ConferenceId"); + + b.HasIndex("HeadwaiterId"); + + b.ToTable("ConferenceBookings"); + }); + + modelBuilder.Entity("HotelDataBaseImplement.Models.ConferenceBookingDinner", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ConferenceBookingId") + .HasColumnType("int"); + + b.Property("DinnerId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ConferenceBookingId"); + + b.HasIndex("DinnerId"); + + b.ToTable("ConferenceBookingDinners"); + }); + + modelBuilder.Entity("HotelDataBaseImplement.Models.ConferenceMember", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ConferenceId") + .HasColumnType("int"); + + b.Property("MemberId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ConferenceId"); + + b.HasIndex("MemberId"); + + b.ToTable("ConferenceMembers"); + }); + + modelBuilder.Entity("HotelDataBaseImplement.Models.Dinner", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("DinnerName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DinnerPrice") + .HasColumnType("float"); + + b.Property("HeadwaiterId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("HeadwaiterId"); + + b.ToTable("Dinners"); + }); + + modelBuilder.Entity("HotelDataBaseImplement.Models.Headwaiter", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("HeadwaiterEmail") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("HeadwaiterFIO") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("HeadwaiterLogin") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("HeadwaiterNumber") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("HeadwaiterPassword") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Headwaiters"); + }); + + modelBuilder.Entity("HotelDataBaseImplement.Models.MealPlan", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("MealPlanName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("MealPlanPrice") + .HasColumnType("float"); + + b.Property("OrganiserId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("OrganiserId"); + + b.ToTable("MealPlans"); + }); + + modelBuilder.Entity("HotelDataBaseImplement.Models.MealPlanMember", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("MealPlanId") + .HasColumnType("int"); + + b.Property("MemberId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("MealPlanId"); + + b.HasIndex("MemberId"); + + b.ToTable("MealPlanMembers"); + }); + + modelBuilder.Entity("HotelDataBaseImplement.Models.Member", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Citizenship") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("MemberFIO") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("OrganiserId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("OrganiserId"); + + b.ToTable("Members"); + }); + + modelBuilder.Entity("HotelDataBaseImplement.Models.Organiser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("OrganiserEmail") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("OrganiserFIO") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("OrganiserLogin") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("OrganiserNumber") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("OrganiserPassword") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Organisers"); + }); + + modelBuilder.Entity("HotelDataBaseImplement.Models.Room", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("HeadwaiterId") + .HasColumnType("int"); + + b.Property("MealPlanId") + .HasColumnType("int"); + + b.Property("RoomFrame") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("RoomName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("RoomPrice") + .HasColumnType("float"); + + b.HasKey("Id"); + + b.HasIndex("HeadwaiterId"); + + b.HasIndex("MealPlanId"); + + b.ToTable("Rooms"); + }); + + modelBuilder.Entity("HotelDataBaseImplement.Models.RoomDinner", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Count") + .HasColumnType("int"); + + b.Property("DinnerId") + .HasColumnType("int"); + + b.Property("RoomId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("DinnerId"); + + b.HasIndex("RoomId"); + + b.ToTable("RoomDinners"); + }); + + modelBuilder.Entity("HotelDataBaseImplement.Models.Conference", b => + { + b.HasOne("HotelDataBaseImplement.Models.Organiser", "Organiser") + .WithMany("Conferences") + .HasForeignKey("OrganiserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organiser"); + }); + + modelBuilder.Entity("HotelDataBaseImplement.Models.ConferenceBooking", b => + { + b.HasOne("HotelDataBaseImplement.Models.Conference", "Conference") + .WithMany("ConferenceBookings") + .HasForeignKey("ConferenceId"); + + b.HasOne("HotelDataBaseImplement.Models.Headwaiter", "Headwaiter") + .WithMany("ConferenceBookings") + .HasForeignKey("HeadwaiterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Conference"); + + b.Navigation("Headwaiter"); + }); + + modelBuilder.Entity("HotelDataBaseImplement.Models.ConferenceBookingDinner", b => + { + b.HasOne("HotelDataBaseImplement.Models.ConferenceBooking", "ConferenceBooking") + .WithMany("Dinners") + .HasForeignKey("ConferenceBookingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("HotelDataBaseImplement.Models.Dinner", "Dinner") + .WithMany("ConferenceBookingDinner") + .HasForeignKey("DinnerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ConferenceBooking"); + + b.Navigation("Dinner"); + }); + + modelBuilder.Entity("HotelDataBaseImplement.Models.ConferenceMember", b => + { + b.HasOne("HotelDataBaseImplement.Models.Conference", "Conference") + .WithMany("Members") + .HasForeignKey("ConferenceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("HotelDataBaseImplement.Models.Member", "Member") + .WithMany("ConferenceMembers") + .HasForeignKey("MemberId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Conference"); + + b.Navigation("Member"); + }); + + modelBuilder.Entity("HotelDataBaseImplement.Models.Dinner", b => + { + b.HasOne("HotelDataBaseImplement.Models.Headwaiter", "Headwaiter") + .WithMany("Dinners") + .HasForeignKey("HeadwaiterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Headwaiter"); + }); + + modelBuilder.Entity("HotelDataBaseImplement.Models.MealPlan", b => + { + b.HasOne("HotelDataBaseImplement.Models.Organiser", "Organiser") + .WithMany("MealPlans") + .HasForeignKey("OrganiserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organiser"); + }); + + modelBuilder.Entity("HotelDataBaseImplement.Models.MealPlanMember", b => + { + b.HasOne("HotelDataBaseImplement.Models.MealPlan", "MealPlan") + .WithMany("Members") + .HasForeignKey("MealPlanId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("HotelDataBaseImplement.Models.Member", "Member") + .WithMany("MealPlanMember") + .HasForeignKey("MemberId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MealPlan"); + + b.Navigation("Member"); + }); + + modelBuilder.Entity("HotelDataBaseImplement.Models.Member", b => + { + b.HasOne("HotelDataBaseImplement.Models.Organiser", "Organiser") + .WithMany("Members") + .HasForeignKey("OrganiserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organiser"); + }); + + modelBuilder.Entity("HotelDataBaseImplement.Models.Room", b => + { + b.HasOne("HotelDataBaseImplement.Models.Headwaiter", "Headwaiter") + .WithMany("Rooms") + .HasForeignKey("HeadwaiterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("HotelDataBaseImplement.Models.MealPlan", "MealPlan") + .WithMany("Rooms") + .HasForeignKey("MealPlanId"); + + b.Navigation("Headwaiter"); + + b.Navigation("MealPlan"); + }); + + modelBuilder.Entity("HotelDataBaseImplement.Models.RoomDinner", b => + { + b.HasOne("HotelDataBaseImplement.Models.Dinner", "Dinner") + .WithMany("RoomDinners") + .HasForeignKey("DinnerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("HotelDataBaseImplement.Models.Room", "Room") + .WithMany("Dinners") + .HasForeignKey("RoomId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Dinner"); + + b.Navigation("Room"); + }); + + modelBuilder.Entity("HotelDataBaseImplement.Models.Conference", b => + { + b.Navigation("ConferenceBookings"); + + b.Navigation("Members"); + }); + + modelBuilder.Entity("HotelDataBaseImplement.Models.ConferenceBooking", b => + { + b.Navigation("Dinners"); + }); + + modelBuilder.Entity("HotelDataBaseImplement.Models.Dinner", b => + { + b.Navigation("ConferenceBookingDinner"); + + b.Navigation("RoomDinners"); + }); + + modelBuilder.Entity("HotelDataBaseImplement.Models.Headwaiter", b => + { + b.Navigation("ConferenceBookings"); + + b.Navigation("Dinners"); + + b.Navigation("Rooms"); + }); + + modelBuilder.Entity("HotelDataBaseImplement.Models.MealPlan", b => + { + b.Navigation("Members"); + + b.Navigation("Rooms"); + }); + + modelBuilder.Entity("HotelDataBaseImplement.Models.Member", b => + { + b.Navigation("ConferenceMembers"); + + b.Navigation("MealPlanMember"); + }); + + modelBuilder.Entity("HotelDataBaseImplement.Models.Organiser", b => + { + b.Navigation("Conferences"); + + b.Navigation("MealPlans"); + + b.Navigation("Members"); + }); + + modelBuilder.Entity("HotelDataBaseImplement.Models.Room", b => + { + b.Navigation("Dinners"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Hotel/HotelDataBaseImplement/Migrations/20230519085242_rename.cs b/Hotel/HotelDataBaseImplement/Migrations/20230519085242_rename.cs new file mode 100644 index 0000000..2f6ba5d --- /dev/null +++ b/Hotel/HotelDataBaseImplement/Migrations/20230519085242_rename.cs @@ -0,0 +1,28 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace HotelDataBaseImplement.Migrations +{ + /// + public partial class rename : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.RenameColumn( + name: "StartDate", + table: "ConferenceBookings", + newName: "BookingDate"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.RenameColumn( + name: "BookingDate", + table: "ConferenceBookings", + newName: "StartDate"); + } + } +} diff --git a/Hotel/HotelDataBaseImplement/Migrations/HotelDataBaseModelSnapshot.cs b/Hotel/HotelDataBaseImplement/Migrations/HotelDataBaseModelSnapshot.cs index cbef860..dee6da3 100644 --- a/Hotel/HotelDataBaseImplement/Migrations/HotelDataBaseModelSnapshot.cs +++ b/Hotel/HotelDataBaseImplement/Migrations/HotelDataBaseModelSnapshot.cs @@ -55,6 +55,10 @@ namespace HotelDataBaseImplement.Migrations SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + b.Property("BookingDate") + .IsRequired() + .HasColumnType("datetime2"); + b.Property("ConferenceId") .HasColumnType("int"); @@ -65,10 +69,6 @@ namespace HotelDataBaseImplement.Migrations .IsRequired() .HasColumnType("nvarchar(max)"); - b.Property("StartDate") - .IsRequired() - .HasColumnType("datetime2"); - b.HasKey("Id"); b.HasIndex("ConferenceId"); diff --git a/Hotel/HotelDataBaseImplement/Models/ConferenceBooking.cs b/Hotel/HotelDataBaseImplement/Models/ConferenceBooking.cs index 710791c..0ef5995 100644 --- a/Hotel/HotelDataBaseImplement/Models/ConferenceBooking.cs +++ b/Hotel/HotelDataBaseImplement/Models/ConferenceBooking.cs @@ -14,7 +14,7 @@ namespace HotelDataBaseImplement.Models public class ConferenceBooking : IConferenceBookingModel { [Required] - public DateTime? StartDate { get; set; } = DateTime.Now; + public DateTime? BookingDate { get; set; } = DateTime.Now; public int HeadwaiterId { get; private set; } public int? ConferenceId { get; private set; } public int Id { get; private set; } @@ -62,6 +62,7 @@ namespace HotelDataBaseImplement.Models ConferenceId = model.ConferenceId; HeadwaiterId = model.HeadwaiterId; NameHall = model.NameHall; + BookingDate = model.BookingDate; } public ConferenceBookingViewModel GetViewModel => new() @@ -70,7 +71,7 @@ namespace HotelDataBaseImplement.Models ConferenceId = ConferenceId, HeadwaiterId = HeadwaiterId, NameHall = NameHall, - StartDate = StartDate, + BookingDate = BookingDate, ConferenceBookingDinners = ConferenceBookingDinners, ConfName = Conference?.ConferenceName }; diff --git a/Hotel/HotelDataModels/Models/IConferenceBookingModel.cs b/Hotel/HotelDataModels/Models/IConferenceBookingModel.cs index b45c5f9..7778f0b 100644 --- a/Hotel/HotelDataModels/Models/IConferenceBookingModel.cs +++ b/Hotel/HotelDataModels/Models/IConferenceBookingModel.cs @@ -4,6 +4,7 @@ { int HeadwaiterId { get;} int? ConferenceId { get; } + DateTime? BookingDate { get; } public Dictionary ConferenceBookingDinners { get; } } }