Files
MayShow/Models/ReportFile.cs
T
2026-02-16 15:40:35 +09:00

68 lines
1.4 KiB
C#

using System;
using System.IO;
using ReceiptPDFBuilder.Helpers;
namespace ReceiptPDFBuilder.Models;
class ReportFile : ChangeNotifier
{
private string _title;
private DateTime _receiptDateTime;
private string _notes;
private string _filePath;
public ReportFile()
{
_title = "";
_receiptDateTime = DateTime.Now;
_notes = "";
_filePath = "";
}
public ReportFile(ReportFile other)
{
Title = _title = other.Title;
ReceiptDateTime = _receiptDateTime = other.ReceiptDateTime;
Notes = _notes = other.Notes;
FilePath = _filePath = other.FilePath;
}
public string Title
{
get => _title;
set { _title = value; NotifyPropertyChanged(); }
}
public DateTime ReceiptDateTime
{
get => _receiptDateTime;
set
{
_receiptDateTime = value;
NotifyPropertyChanged();
NotifyPropertyChanged(nameof(ReceiptDate));
}
}
public DateOnly ReceiptDate
{
get => DateOnly.FromDateTime(_receiptDateTime);
}
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);
}
}