using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Input;
using PhilExampleCrawler.Common.Models;

namespace PhilExample.VMs
{
    public class InsertionMiniVM
    {
        public string Title { get; set; }
        public string DateText { get; set; }
        public string LocationText { get; set; }
        public string PriceText { get; set; }
        public ICommand ActionCommand { get; set; }
        public object ActionCommandParameter { get; set; }

        public InsertionMiniVM()
        {

        }


        public InsertionMiniVM(Insertion i)
        {
            Title = i.Name;
            DateText = i.Date?.ToString("dd.MM.yyyy hh:mm:ss") ?? "datum wois itt";
            LocationText = i.LocationStr;
            PriceText =   i.Price == 0 
                                       ? "gratis"
                                       : $"{i.Price} € {(i.Is_VB ? "VB" : null)}";
        }
    }
}
