using Abp.Extensions; using System; using UnivateProperties_API.Helpers; using UnivateProperties_API.Model.Timeshare; namespace UnivateProperties_API.Containers.Timeshare.Detailed { public class DetailedWeekDto { int resortId; public DetailedWeekDto() { Owner = new DetailedOwner(); } public DetailedWeekDto(TimeshareWeek week) { Id = week.Id; ReferedByAgent = week.ReferedByAgent; AgentId = week.AgentId; AgencyId = week.AgencyId; OtherResort = week.OtherResort; OtherResortName = week.OtherResortName; resortId = int.Parse(TenderWeeksHelper.GetResortId(week.ResortName)); Resort = new ResortDto(resortId, week.ResortCode, week.ResortName); ResortCode = week.ResortCode; ResortName = week.ResortName; RegionId = week.RegionId; Season = week.Season; Module = week.Module; UnitNumber = week.UnitNumber; Bedrooms = week.Bedrooms; MaxSleep = week.MaxSleep; WeekNumber = week.WeekNumber; LevyAmount = week.LevyAmount; CurrentYearBanked = week.CurrentYearBanked; BankedWith = week.BankedWith; LeviesPaidInFull = week.LeviesPaidInFull; WeekPlacedForRental = week.WeekPlacedForRental; OriginalPurchaseDate = week.OriginalPurchaseDate.ToShortDateString().Replace('/', '-'); OriginalPurchasePrice = week.OriginalPurchasePrice; ArrivalDate = week.ArrivalDate.ToShortDateString().Replace('/', '-'); DepartureDate = week.DepartureDate.ToShortDateString().Replace('/', '-'); SellPrice = week.SellPrice; AskingPrice = week.AskingPrice; AgentCommission = week.AgentCommision; Mandate = week.Mandate; Status = week.Status.Display; Owner = week.Owner != null ? new DetailedOwner(week.Owner) : new DetailedOwner(); Region = new RegionDto(week.Region.Code, week.Region.Description); WeekStatus = week.WeekStatus; Publish = week.Publish; PulbishedDate = week.PulbishedDate; } public int Id { get; set; } public bool ReferedByAgent { get; set; } public int? AgentId { get; set; } public int? AgencyId { get; set; } public bool OtherResort { get; set; } public string OtherResortName { get; set; } public ResortDto Resort { get; set; } public string ResortCode { get; set; } public string ResortName { get; set; } public int RegionId { get; set; } public string Season { get; set; } public string Module { get; set; } public string UnitNumber { get; set; } public string Bedrooms { get; set; } public int MaxSleep { get; set; } public string WeekNumber { get; set; } public double LevyAmount { get; set; } public bool CurrentYearBanked { get; set; } public string BankedWith { get; set; } public bool LeviesPaidInFull { get; set; } public bool WeekPlacedForRental { get; set; } public double OriginalPurchasePrice { get; set; } public string OriginalPurchaseDate { get; set; } public string ArrivalDate { get; set; } public string DepartureDate { get; set; } public double SellPrice { get; set; } public double AskingPrice { get; set; } public double AgentCommission { get; set; } public bool Mandate { get; set; } public string Status { get; set; } public DetailedOwner Owner { get; set; } public RegionDto Region { get; set; } public string WeekStatus { get; set; } public bool Publish { get; set; } public DateTime PulbishedDate { get; set; } } }