Merge branch 'first_branch' of https://git.is.ulstu.ru/Extrimal/PIbd-21_Kurs_Work_Hotel into first_branch

This commit is contained in:
Salikh 2024-04-21 21:20:55 +04:00
commit 777f14f7c9
21 changed files with 424 additions and 1 deletions

View File

@ -0,0 +1,19 @@
using HotelDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HotelContracts.BindingModels
{
public class AdministratorBindingModel : IAdministratorModel
{
public int Id { get; set; }
public string AdministratorFIO { get; set; } = string.Empty;
public string AdministratorPhone { get; set; } = string.Empty;
public string AdministratorLogin { get; set; } = string.Empty;
public string AdministratorPassword { get; set; } = string.Empty;
public string AdministratorEmail { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,19 @@
using HotelDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HotelContracts.BindingModels
{
public class ConferenceBookingBindingModel : IConferenceBookingModel
{
public int Id { get; set; }
public int AdministratorId { get; set; }
public int? ConferenceId { get; set; }
public string PlaceСonference { get; set; } = string.Empty;
public DateTime? DateСonference { get; set; }
public Dictionary<int, IDinnerModel> ConferenceBookingDinners { get; set; } = new();
}
}

View File

@ -0,0 +1,18 @@
using HotelDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HotelContracts.BindingModels
{
public class DinnerBindingModel : IDinnerModel
{
public int Id { get; set; }
public string DinnerName { get; set; } = string.Empty;
public int DinnerСalorieСontent { get; set; }
public double DinnerPrice { get; set; }
public int AdministratorId { get; set; }
}
}

View File

@ -0,0 +1,20 @@
using HotelDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HotelContracts.BindingModels
{
public class RoomBindingModel : IRoomModel
{
public int Id { get; set; }
public int RoomNumber { get; set; }
public int CountBeds { get; set; }
public double RoomPrice { get; set; }
public int AdministratorId { get; set; }
public Dictionary<int, IDinnerModel> RoomDinners { get; set; } = new();
}
}

View File

@ -0,0 +1,20 @@
using HotelContracts.BindingModels;
using HotelContracts.SearchModels;
using HotelContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HotelContracts.BusinessLogicsContracts
{
public interface IAdministratorLogic
{
List<AdministratorViewModel>? ReadList(AdministratorSearchModel? model);
AdministratorViewModel? ReadElement(AdministratorSearchModel model);
bool Create(AdministratorBindingModel model);
bool Update(AdministratorBindingModel model);
bool Delete(AdministratorBindingModel model);
}
}

View File

@ -0,0 +1,21 @@
using HotelContracts.BindingModels;
using HotelContracts.SearchModels;
using HotelContracts.ViewModels;
using HotelDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HotelContracts.BusinessLogicsContracts
{
public interface IConferenceBookingLogic
{
List<ConferenceBookingViewModel>? ReadList(ConferenceBookingSearchModel? model);
ConferenceBookingViewModel? ReadElement(ConferenceBookingSearchModel model);
bool Create(ConferenceBookingBindingModel model);
bool Update(ConferenceBookingBindingModel model);
bool Delete(ConferenceBookingBindingModel model);
}
}

View File

@ -0,0 +1,20 @@
using HotelContracts.BindingModels;
using HotelContracts.SearchModels;
using HotelContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HotelContracts.BusinessLogicsContracts
{
public interface IDinnerLogic
{
List<DinnerViewModel>? ReadList(DinnerSearchModel? model);
DinnerViewModel? ReadElement(DinnerSearchModel model);
bool Create(DinnerBindingModel model);
bool Update(DinnerBindingModel model);
bool Delete(DinnerBindingModel model);
}
}

View File

@ -0,0 +1,21 @@
using HotelContracts.BindingModels;
using HotelContracts.SearchModels;
using HotelContracts.ViewModels;
using HotelDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HotelContracts.BusinessLogicsContracts
{
public interface IRoomLogic
{
List<RoomViewModel>? ReadList(RoomSearchModel? model);
RoomViewModel? ReadElement(RoomSearchModel model);
bool Create(RoomBindingModel model);
bool Update(RoomBindingModel model);
bool Delete(RoomBindingModel model);
}
}

View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HotelContracts.SearchModels
{
public class AdministratorSearchModel
{
public int? Id { get; set; }
public string? AdministratorFIO { get; set; }
public string? AdministratorLogin { get; set; }
public string? AdministratorPassword { get; set; }
public string? AdministratorEmail { get; set; }
}
}

View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HotelContracts.SearchModels
{
public class ConferenceBookingSearchModel
{
public int? Id { get; set; }
public int? AdministratorId { get; set; }
public int? ConferenceId { get; set; }
public string? PlaceСonference { get; set; }
public DateTime? DateСonference { get; set; }
}
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HotelContracts.SearchModels
{
public class DinnerSearchModel
{
public int? Id { get; set; }
public string? DinnerName { get; set; }
public int? AdministratorId { get; set; }
}
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HotelContracts.SearchModels
{
public class RoomSearchModel
{
public int? Id { get; set; }
public int? RoomNumber { get; set; }
public int? AdministratorId { get; set; }
}
}

View File

@ -0,0 +1,26 @@
using HotelContracts.BindingModels;
using HotelContracts.SearchModels;
using HotelContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HotelContracts.StoragesContracts
{
public interface IAdministratorStorage
{
List<AdministratorViewModel> GetFullList();
List<AdministratorViewModel> GetFilteredList(AdministratorSearchModel model);
AdministratorViewModel? GetElement(AdministratorSearchModel model);
AdministratorViewModel? Insert(AdministratorBindingModel model);
AdministratorViewModel? Update(AdministratorBindingModel model);
AdministratorViewModel? Delete(AdministratorBindingModel model);
}
}

View File

@ -0,0 +1,26 @@
using HotelContracts.BindingModels;
using HotelContracts.SearchModels;
using HotelContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HotelContracts.StoragesContracts
{
public interface IConferenceBookingStorage
{
List<ConferenceBookingViewModel> GetFullList();
List<ConferenceBookingViewModel> GetFilteredList(ConferenceBookingSearchModel model);
ConferenceBookingViewModel? GetElement(ConferenceBookingSearchModel model);
ConferenceBookingViewModel? Insert(ConferenceBookingBindingModel model);
ConferenceBookingViewModel? Update(ConferenceBookingBindingModel model);
ConferenceBookingViewModel? Delete(ConferenceBookingBindingModel model);
}
}

View File

@ -0,0 +1,26 @@
using HotelContracts.BindingModels;
using HotelContracts.SearchModels;
using HotelContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HotelContracts.StoragesContracts
{
public interface IDinnerStorage
{
List<DinnerViewModel> GetFullList();
List<DinnerViewModel> GetFilteredList(DinnerSearchModel model);
DinnerViewModel? GetElement(DinnerSearchModel model);
DinnerViewModel? Insert(DinnerBindingModel model);
DinnerViewModel? Update(DinnerBindingModel model);
DinnerViewModel? Delete(DinnerBindingModel model);
}
}

View File

@ -0,0 +1,26 @@
using HotelContracts.BindingModels;
using HotelContracts.SearchModels;
using HotelContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HotelContracts.StoragesContracts
{
public interface IRoomStorage
{
List<RoomViewModel> GetFullList();
List<RoomViewModel> GetFilteredList(RoomSearchModel model);
RoomViewModel? GetElement(RoomSearchModel model);
RoomViewModel? Insert(RoomBindingModel model);
RoomViewModel? Update(RoomBindingModel model);
RoomViewModel? Delete(RoomBindingModel model);
}
}

View File

@ -0,0 +1,30 @@
using HotelDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HotelContracts.ViewModels
{
public class AdministratorViewModel : IAdministratorModel
{
public int Id { get; set; }
[DisplayName("ФИО администратора")]
public string AdministratorFIO { get; set; } = string.Empty;
[DisplayName("Пароль администратора")]
public string AdministratorPassword { get; set; } = string.Empty;
[DisplayName("Логин администратора")]
public string AdministratorLogin { get; set; } = string.Empty;
[DisplayName("Mail администратора")]
public string AdministratorEmail { get; set; } = string.Empty;
[DisplayName("Телефон администратора")]
public string AdministratorPhone { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,21 @@
using HotelDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HotelContracts.ViewModels
{
public class ConferenceBookingViewModel : IConferenceBookingModel
{
public int Id { get; set; }
public int AdministratorId { get; set; }
public int? ConferenceId { get; set; }
public string PlaceСonference { get; set; } = string.Empty;
[DisplayName("Дата конференции")]
public DateTime? DateСonference { get; set; }
public Dictionary<int, IDinnerModel> ConferenceBookingDinners { get; set; } = new();
}
}

View File

@ -0,0 +1,22 @@
using HotelDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HotelContracts.ViewModels
{
public class DinnerViewModel : IDinnerModel
{
public int Id { get; set; }
[DisplayName("Название обеда")]
public string DinnerName { get; set; } = string.Empty;
[DisplayName("Калорийность обеда")]
public int DinnerСalorieСontent { get; set; }
[DisplayName("Цена обеда")]
public double DinnerPrice { get; set; }
public int AdministratorId { get; set; }
}
}

View File

@ -0,0 +1,23 @@
using HotelDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HotelContracts.ViewModels
{
public class RoomViewModel : IRoomModel
{
public int Id { get; set; }
[DisplayName("Номер комнаты")]
public int RoomNumber { get; set; }
[DisplayName("Количество спальных мест")]
public int CountBeds { get; set; }
[DisplayName("Стоимость номера")]
public double RoomPrice { get; set; }
public int AdministratorId { get; set; }
public Dictionary<int, IDinnerModel> RoomDinners { get; set; } = new();
}
}

View File

@ -13,6 +13,6 @@ namespace HotelDataModels.Models
string PlaceСonference { get; }
DateTime? DateСonference { get; }
public Dictionary<int, IDinnerModel> ConferenceBookingDinners { get; }
}
}