123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- using Avalonia.Media;
- using Avalonia.Media.Imaging;
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Reflection;
- namespace travel.Models;
- public partial class Tour
- {
- public int Id { get; set; }
- public int TicketCount { get; set; }
- public string Name { get; set; } = null!;
- public string? Description { get; set; }
- public string? ImagePreview { get; set; }
- public decimal Price { get; set; }
- public int IsActual { get; set; }
- public virtual ICollection<Hotel> Hotels { get; set; } = new List<Hotel>();
- public virtual ICollection<Type> Types { get; set; } = new List<Type>();
- public String ActualText
- {
- get
- {
- if (IsActual == 1)
- return "Актуален";
- else
- return "Не актуален";
- }
- }
- public SolidColorBrush ActualColor
- {
- get
- {
- if (IsActual == 1)
- return new SolidColorBrush(Colors.Green);
- else
- return new SolidColorBrush(Colors.Red);
- }
- }
- public Bitmap Image
- {
- get
- {
- if(ImagePreview != null && ImagePreview.Length > 0)
- {
- string path = "Assets2" + ImagePreview.Replace("/", "\\");
- return new Bitmap(path);
- }
- else return new Bitmap("Assets2/images/picture.png");
- }
- }
- }
|