Can now edit file info

This commit is contained in:
2026-02-16 15:40:35 +09:00
parent 89ba04e6ea
commit 7f19ad8c15
6 changed files with 101 additions and 46 deletions
+16 -26
View File
@@ -7,56 +7,46 @@ namespace ReceiptPDFBuilder.Models;
class ReportFile : ChangeNotifier
{
private string _title;
private DateOnly _date;
private DateTime _dateTime;
private DateTimeOffset _dto;
private DateTime _receiptDateTime;
private string _notes;
private string _filePath;
public ReportFile()
{
_title = "";
_date = DateOnly.FromDateTime(DateTime.Now);
_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 DateOnly Date
public DateTime ReceiptDateTime
{
get => _date;
get => _receiptDateTime;
set
{
_date = value;
DateTime = value.ToDateTime(TimeOnly.MinValue);
DTO = new DateTimeOffset(value.ToDateTime(TimeOnly.MinValue));
_receiptDateTime = value;
NotifyPropertyChanged();
NotifyPropertyChanged(nameof(ReceiptDate));
}
}
public DateTime DateTime
public DateOnly ReceiptDate
{
get => _dateTime;
set
{
_dateTime = value;
NotifyPropertyChanged();
}
}
public DateTimeOffset DTO
{
get => _dto;
set
{
_dto = value;
NotifyPropertyChanged();
}
get => DateOnly.FromDateTime(_receiptDateTime);
}
public string Notes