2023-04-01 19:41:32 +04:00
|
|
|
|
|
|
|
|
|
using HotelDataModels.Models;
|
|
|
|
|
using System.ComponentModel;
|
2023-05-17 02:08:51 +04:00
|
|
|
|
using Newtonsoft.Json;
|
2023-04-01 19:41:32 +04:00
|
|
|
|
|
|
|
|
|
namespace HotelContracts.ViewModels
|
|
|
|
|
{
|
|
|
|
|
public class RoomViewModel : IRoomModel
|
|
|
|
|
{
|
|
|
|
|
public int HeadwaiterId { get; set; }
|
|
|
|
|
|
2023-05-17 11:08:38 +04:00
|
|
|
|
public int? MealPlanId { get; set; }
|
2023-04-01 19:41:32 +04:00
|
|
|
|
|
|
|
|
|
public int Id { get; set; }
|
|
|
|
|
|
|
|
|
|
[DisplayName("Название комнаты")]
|
|
|
|
|
public string RoomName { get; set; } = string.Empty;
|
|
|
|
|
|
|
|
|
|
[DisplayName("Корпус комнаты")]
|
|
|
|
|
public string RoomFrame { get; set; } = string.Empty;
|
|
|
|
|
|
|
|
|
|
[DisplayName("Стоимость комнаты")]
|
|
|
|
|
public double RoomPrice { get; set; }
|
2023-05-17 02:08:51 +04:00
|
|
|
|
public Dictionary<int, IDinnerModel> RoomDinners { get; set; } = new();
|
2023-04-01 19:41:32 +04:00
|
|
|
|
|
2023-05-17 02:08:51 +04:00
|
|
|
|
public RoomViewModel() { }
|
|
|
|
|
|
|
|
|
|
[JsonConstructor]
|
2023-05-17 11:08:38 +04:00
|
|
|
|
public RoomViewModel(Dictionary<int, DinnerViewModel> RoomDinners)
|
2023-05-17 02:08:51 +04:00
|
|
|
|
{
|
|
|
|
|
this.RoomDinners = RoomDinners.ToDictionary(x => x.Key, x => x.Value as IDinnerModel);
|
|
|
|
|
}
|
2023-04-01 19:41:32 +04:00
|
|
|
|
}
|
|
|
|
|
}
|