Files
MayShow/Models/ReportFile.cs
T
mbabienco 7ea649850e Start major rework for DataGrid display
For editing of file properties, etc.
2026-02-16 09:40:15 +09:00

78 lines
1.5 KiB
C#

using System;
using System.IO;
using ReceiptPDFBuilder.Helpers;
namespace ReceiptPDFBuilder.Models;
class ReportFile : ChangeNotifier
{
private string _title;
private DateOnly _date;
private DateTime _dateTime;
private DateTimeOffset _dto;
private string _notes;
private string _filePath;
public ReportFile()
{
_title = "";
_date = DateOnly.FromDateTime(DateTime.Now);
_notes = "";
_filePath = "";
}
public string Title
{
get => _title;
set { _title = value; NotifyPropertyChanged(); }
}
public DateOnly Date
{
get => _date;
set
{
_date = value;
DateTime = value.ToDateTime(TimeOnly.MinValue);
DTO = new DateTimeOffset(value.ToDateTime(TimeOnly.MinValue));
NotifyPropertyChanged();
}
}
public DateTime DateTime
{
get => _dateTime;
set
{
_dateTime = value;
NotifyPropertyChanged();
}
}
public DateTimeOffset DTO
{
get => _dto;
set
{
_dto = value;
NotifyPropertyChanged();
}
}
public string Notes
{
get => _notes;
set { _notes = value; NotifyPropertyChanged(); }
}
public string FilePath
{
get => _filePath;
set { _filePath = value; NotifyPropertyChanged(); }
}
public string FileName
{
get => Path.GetFileName(_filePath);
}
}