Merge branch 'CourseWork' of http://student.git.athene.tech/AnnZhimol/CourseWork_Hotel into CourseWork
This commit is contained in:
commit
3cb30a3684
@ -550,6 +550,7 @@ namespace HostrelHeadwaiterApp.Controllers
|
||||
Id = conferenceBooking,
|
||||
ConferenceId = conference,
|
||||
NameHall = conferenceBookingElem.NameHall,
|
||||
StartDate = conferenceBookingElem.StartDate,
|
||||
HeadwaiterId = conferenceBookingElem.HeadwaiterId,
|
||||
});
|
||||
Response.Redirect("ListConferenceBookings");
|
||||
@ -622,5 +623,33 @@ namespace HostrelHeadwaiterApp.Controllers
|
||||
{
|
||||
return new PhysicalFileResult("E:\\ReportsCourseWork\\excelfile.xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public IActionResult ListDinnersToPdfFile()
|
||||
{
|
||||
if (APIClient.Headwaiter == null)
|
||||
{
|
||||
return Redirect("~/Home/Enter");
|
||||
}
|
||||
|
||||
return View();
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public void ListDinnersToPdfFile(string roomName)
|
||||
{
|
||||
if (APIClient.Headwaiter == null)
|
||||
{
|
||||
throw new Exception("Не авторизованы");
|
||||
}
|
||||
|
||||
APIClient.PostRequest("api/Report/CreateHeadwaiterReportToPdfFile", new ReportHeadwaiterBindingModel()
|
||||
{
|
||||
RoomName = roomName,
|
||||
HeadwaiterId = APIClient.Headwaiter.Id
|
||||
});
|
||||
|
||||
Response.Redirect("ListDinnersToPdfFile");
|
||||
}
|
||||
}
|
||||
}
|
@ -18,6 +18,15 @@
|
||||
<select id="conferenceBooking" name="conferenceBooking" class="form-control" asp-items="@(new SelectList(@ViewBag.ConferenceBookings, "Id", "NameHall"))"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="u-form-email u-form-group u-label-top">
|
||||
<label class="u-label u-text-custom-color-1 u-label-2">Начало</label>
|
||||
<input
|
||||
id="startDate"
|
||||
type="datetime-local"
|
||||
placeholder="Выберите дату начала"
|
||||
name="startDate"
|
||||
class="form-control"/>
|
||||
</div>
|
||||
<br>
|
||||
<div class="u-container-layout u-container-layout-2">
|
||||
<input type="submit" value="Добавить конференцию" class="btn btn-outline-dark text-center d-flex justify-content-md-center" />
|
||||
|
@ -0,0 +1,27 @@
|
||||
@{
|
||||
ViewData["Title"] = "ListDinnersToPdf";
|
||||
}
|
||||
|
||||
|
||||
<div class="text-center">
|
||||
<h2
|
||||
class="u-text u-text-custom-color-1 u-text-default u-text-1"
|
||||
>
|
||||
Создание отчета по участникам за период
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<form method="post">
|
||||
<div class="u-form-group u-form-name u-label-top">
|
||||
<label class="u-label u-text-custom-color-1 u-label-1">Дата начала периода:</label>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Выберите название комнаты"
|
||||
id="roomName" name="roomName"
|
||||
class="u-input u-input-rectangle"/>
|
||||
</div>
|
||||
<div class="u-align-right u-form-group u-form-submit u-label-top">
|
||||
<div class="col-8"></div>
|
||||
<div class="col-4"><input type="submit" value="Сформировать отчёт" class="u-active-custom-color-6 u-border-none u-btn u-btn-submit u-button-style u-custom-color-1 u-hover-custom-color-2 u-btn-1" /></div>
|
||||
</div>
|
||||
</form>
|
@ -39,6 +39,8 @@
|
||||
|
||||
<a class="nav-link " asp-area="" asp-controller="Home" asp-action="ListDinnerRoomToFile">Отчет (word/excel) </a>
|
||||
|
||||
<a class="nav-link " asp-area="" asp-controller="Home" asp-action="ListDinnersToPdfFile">Отчет (pdf) </a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -4,6 +4,8 @@ using HotelContracts.BindingModels;
|
||||
using HotelContracts.SearchModels;
|
||||
using HotelContracts.StoragesContracts;
|
||||
using HotelContracts.ViewModels;
|
||||
using HotelDataBaseImplement;
|
||||
using HotelDataBaseImplement.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@ -78,24 +80,34 @@ namespace HotelBusinessLogic.BusinessLogics
|
||||
|
||||
foreach (var room in listСonferences)
|
||||
{
|
||||
foreach (var c in room.RoomDinners)
|
||||
foreach (var m in room.RoomDinners.Values)
|
||||
{
|
||||
listAll.Add(new ReportDinnersViewModel
|
||||
{
|
||||
RoomName = room.RoomName,
|
||||
DinnerName = c.Value.DinnerName
|
||||
RoomPrice = room.RoomPrice,
|
||||
DinnerName = m.DinnerName,
|
||||
DinnerPrice = m.DinnerPrice
|
||||
});
|
||||
}
|
||||
}
|
||||
var listConferenceBookings = _conferenceBookingStorage.GetFilteredList(new ConferenceBookingSearchModel());
|
||||
var listConferenceBookings = _conferenceBookingStorage.GetFilteredList(new ConferenceBookingSearchModel
|
||||
{
|
||||
HeadwaiterId = model.HeadwaiterId,
|
||||
});
|
||||
|
||||
foreach (var conferenceBooking in listConferenceBookings)
|
||||
{
|
||||
listAll.Add(new ReportDinnersViewModel
|
||||
foreach (var mp in conferenceBooking.ConferenceBookingDinners.Values)
|
||||
{
|
||||
NameHall = conferenceBooking.NameHall
|
||||
});
|
||||
|
||||
listAll.Add(new ReportDinnersViewModel
|
||||
{
|
||||
DinnerName = mp.DinnerName,
|
||||
DinnerPrice = mp.DinnerPrice,
|
||||
NameHall = conferenceBooking.NameHall
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return listAll;
|
||||
|
@ -25,18 +25,18 @@ namespace HotelBusinessLogic.OfficePackage
|
||||
Style = "Normal",
|
||||
ParagraphAlignment = PdfParagraphAlignmentType.Center
|
||||
});
|
||||
CreateTable(new List<string> { "2cm", "3cm", "6cm", "3cm", "3cm" });
|
||||
CreateTable(new List<string> { "3cm", "3cm", "3cm", "4cm", "4cm" });
|
||||
CreateRow(new PdfRowParameters
|
||||
{
|
||||
Texts = new List<string> { "Название команты", "Корпус комнтаы", "Цена комнаты" },
|
||||
Texts = new List<string> { "Обед", "Комната", "Цена комнаты", "Бронирование" },
|
||||
Style = "NormalTitle",
|
||||
ParagraphAlignment = PdfParagraphAlignmentType.Center
|
||||
});
|
||||
foreach (var conferenceBindingRooms in info.Dinners)
|
||||
foreach (var dinner in info.Dinners)
|
||||
{
|
||||
CreateRow(new PdfRowParameters
|
||||
{
|
||||
Texts = new List<string> { conferenceBindingRooms.Id.ToString(), conferenceBindingRooms.RoomName, conferenceBindingRooms.RoomFrame, conferenceBindingRooms.RoomPrice.ToString() },
|
||||
Texts = new List<string> { dinner.DinnerName.ToString(), dinner.RoomName, dinner.RoomPrice.ToString(), dinner.NameHall },
|
||||
Style = "Normal",
|
||||
ParagraphAlignment = PdfParagraphAlignmentType.Left
|
||||
});
|
||||
|
@ -10,6 +10,8 @@ namespace HotelContracts.BindingModels
|
||||
|
||||
public string NameHall { get; set; } = string.Empty;
|
||||
|
||||
public DateTime? StartDate { get; set; } = DateTime.Now;
|
||||
|
||||
public int Id { get; set; }
|
||||
public Dictionary<int, IDinnerModel> ConferenceBookingDinners { get; set; } = new();
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
@ -10,6 +11,8 @@ namespace HotelContracts.ViewModels
|
||||
{
|
||||
public class ConferenceBookingViewModel : IConferenceBookingModel
|
||||
{
|
||||
[DisplayName("Дата начала конференции")]
|
||||
public DateTime? StartDate { get; set; }
|
||||
public int HeadwaiterId { get; set; }
|
||||
|
||||
public int? ConferenceId { get; set; }
|
||||
|
@ -12,6 +12,7 @@ namespace HotelContracts.ViewModels
|
||||
public string RoomName { get; set; } = string.Empty;
|
||||
public string NameHall { get; set; } = string.Empty;
|
||||
public string DinnerName { get; set; } = string.Empty;
|
||||
public double DinnerPrice { get; set; }
|
||||
public double RoomPrice { get; set; }
|
||||
public string RoomFrame { get; set; } = string.Empty;
|
||||
|
||||
|
@ -9,7 +9,7 @@ namespace HotelDataBaseImplement
|
||||
{
|
||||
if (optionsBuilder.IsConfigured == false)
|
||||
{
|
||||
optionsBuilder.UseSqlServer(@"Data Source=DESKTOP-VG5USAH\SQLEXPRESS;Initial Catalog=HotelDataBaseFull;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
|
||||
optionsBuilder.UseSqlServer(@"Data Source=DESKTOP-V0ON61E\SQLEXPRESS;Initial Catalog=HotelDataBaseFull;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
|
||||
}
|
||||
base.OnConfiguring(optionsBuilder);
|
||||
}
|
||||
|
567
Hotel/HotelDataBaseImplement/Migrations/20230518202913_newdatamaksim.Designer.cs
generated
Normal file
567
Hotel/HotelDataBaseImplement/Migrations/20230518202913_newdatamaksim.Designer.cs
generated
Normal file
@ -0,0 +1,567 @@
|
||||
// <auto-generated />
|
||||
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("20230518202913_newdatamaksim")]
|
||||
partial class newdatamaksim
|
||||
{
|
||||
/// <inheritdoc />
|
||||
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<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("ConferenceName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("OrganiserId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("StartDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("OrganiserId");
|
||||
|
||||
b.ToTable("Conferences");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("HotelDataBaseImplement.Models.ConferenceBooking", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int?>("ConferenceId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("HeadwaiterId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("NameHall")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime?>("StartDate")
|
||||
.IsRequired()
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ConferenceId");
|
||||
|
||||
b.HasIndex("HeadwaiterId");
|
||||
|
||||
b.ToTable("ConferenceBookings");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("HotelDataBaseImplement.Models.ConferenceBookingDinner", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("ConferenceBookingId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("DinnerId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ConferenceBookingId");
|
||||
|
||||
b.HasIndex("DinnerId");
|
||||
|
||||
b.ToTable("ConferenceBookingDinners");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("HotelDataBaseImplement.Models.ConferenceMember", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("ConferenceId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("MemberId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ConferenceId");
|
||||
|
||||
b.HasIndex("MemberId");
|
||||
|
||||
b.ToTable("ConferenceMembers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("HotelDataBaseImplement.Models.Dinner", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("DinnerName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<double>("DinnerPrice")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<int>("HeadwaiterId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("HeadwaiterId");
|
||||
|
||||
b.ToTable("Dinners");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("HotelDataBaseImplement.Models.Headwaiter", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("HeadwaiterEmail")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("HeadwaiterFIO")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("HeadwaiterLogin")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("HeadwaiterNumber")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("HeadwaiterPassword")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Headwaiters");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("HotelDataBaseImplement.Models.MealPlan", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("MealPlanName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<double>("MealPlanPrice")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<int>("OrganiserId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("OrganiserId");
|
||||
|
||||
b.ToTable("MealPlans");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("HotelDataBaseImplement.Models.MealPlanMember", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("MealPlanId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("MemberId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("MealPlanId");
|
||||
|
||||
b.HasIndex("MemberId");
|
||||
|
||||
b.ToTable("MealPlanMembers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("HotelDataBaseImplement.Models.Member", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("Citizenship")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("MemberFIO")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("OrganiserId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("OrganiserId");
|
||||
|
||||
b.ToTable("Members");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("HotelDataBaseImplement.Models.Organiser", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("OrganiserEmail")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("OrganiserFIO")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("OrganiserLogin")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("OrganiserNumber")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("OrganiserPassword")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Organisers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("HotelDataBaseImplement.Models.Room", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("HeadwaiterId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int?>("MealPlanId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("RoomFrame")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("RoomName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<double>("RoomPrice")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("HeadwaiterId");
|
||||
|
||||
b.HasIndex("MealPlanId");
|
||||
|
||||
b.ToTable("Rooms");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("HotelDataBaseImplement.Models.RoomDinner", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("Count")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("DinnerId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("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
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace HotelDataBaseImplement.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class newdatamaksim : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "StartDate",
|
||||
table: "ConferenceBookings",
|
||||
type: "datetime2",
|
||||
nullable: false,
|
||||
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "StartDate",
|
||||
table: "ConferenceBookings");
|
||||
}
|
||||
}
|
||||
}
|
@ -65,6 +65,10 @@ namespace HotelDataBaseImplement.Migrations
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime?>("StartDate")
|
||||
.IsRequired()
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ConferenceId");
|
||||
|
@ -13,6 +13,8 @@ namespace HotelDataBaseImplement.Models
|
||||
{
|
||||
public class ConferenceBooking : IConferenceBookingModel
|
||||
{
|
||||
[Required]
|
||||
public DateTime? StartDate { get; set; } = DateTime.Now;
|
||||
public int HeadwaiterId { get; private set; }
|
||||
public int? ConferenceId { get; private set; }
|
||||
public int Id { get; private set; }
|
||||
@ -68,6 +70,7 @@ namespace HotelDataBaseImplement.Models
|
||||
ConferenceId = ConferenceId,
|
||||
HeadwaiterId = HeadwaiterId,
|
||||
NameHall = NameHall,
|
||||
StartDate = StartDate,
|
||||
ConferenceBookingDinners = ConferenceBookingDinners,
|
||||
ConfName = Conference?.ConferenceName
|
||||
};
|
||||
|
@ -113,5 +113,24 @@ namespace HotelRestApi.Controllers
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public void CreateHeadwaiterReportToPdfFile(ReportHeadwaiterBindingModel model)
|
||||
{
|
||||
try
|
||||
{
|
||||
_reportHeadwaiterLogic.SaveDinnersToPdfFile(new ReportHeadwaiterBindingModel
|
||||
{
|
||||
FileName = "Отчет PDF.pdf",
|
||||
RoomName = model.RoomName,
|
||||
HeadwaiterId = model.HeadwaiterId,
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Ошибка создания отчета");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
BIN
Hotel/HotelRestApi/Отчет PDF.pdf
Normal file
BIN
Hotel/HotelRestApi/Отчет PDF.pdf
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user