using Avalonia.Platform; using AvaloniaAppApplication.Models; //using Microsoft.CodeAnalysis.CSharp.Syntax; using System; using System.Collections.Generic; using Avalonia.Media.Imaging; using System.Linq; using System.Text; using System.Threading.Tasks; using Avalonia; using System.Collections.ObjectModel; namespace AvaloniaAppApplication.DTO { public class ServiceDTO { private string _mainimagePath; public ServiceDTO() { } public int Id { get; set; } public string? Title { get; set; } public float Cost { get; set; } public float? CostWithDiscount { get { if (Discount > 0) return Cost - (Cost * Discount / 100); else return Cost; } } public int? Durationinseconds { get; set; } public float? DurationInMinutes { get { if (Durationinseconds != null) return Durationinseconds / 60; else return null; } } public string? Description { get; set; } public float? Discount { get; set; } public string? MainImagePath { get; set; } public virtual ICollection ClientServices { get; set; } = new List(); public virtual ICollection ServicePhotos { get; set; } = new List(); public virtual ICollection MainProducts { get; set; } = new List(); public Bitmap ImageBitmap { get; set; } public string DiscountColor { get { if (Discount > 0) return "LightGreen"; else return ""; } } public ObservableCollection ServiceBitmaps { get; set; } = new ObservableCollection(); } public class ServicePhotoDTO { public int Id { get; set; } public int ServiceId { get; set; } public string PhotoPath { get; set; } = null!; public Avalonia.Media.Imaging.Bitmap Bitmap { get; set; } } public class ClientServiceDTO { public int Id { get; set; } public string Title { get; set; } public string ClientFIO { get; set; } public string Email { get; set; } public string StartTime { get; set; } public string Phone { get; set; } public int? RemainingTime { get; set; } public string ColorString { get { if (RemainingTime < 60) return "Red"; else return ""; } } } }