using System.ComponentModel;

namespace LDBproject.Entities;

public class UpdateC
{
    public int ID { get; private set; }

    [Browsable(false)]
    public int CardID { get; private set; }
    [Browsable(false)]
    public int LibrarianID { get; private set; }
    [DisplayName("Reader")]
    public string ReaderName { get; private set; } = string.Empty;
    [DisplayName("Librarian")]
    public string EmployeeName { get; private set; } = string.Empty;
    [DisplayName("Date of last upd")]
    public DateTime LastUpdate { get; private set; }
    [DisplayName("upd active till")]
    public DateTime UpdBoundary { get; private set; }
    [DisplayName("Notes")]
    public string Note { get; private set; }

    public static UpdateC CustomerUpd(
            int cardIndex, int librIndex, DateTime updDate, DateTime updToDate, string note)
    {
        return new UpdateC
        {
            CardID = cardIndex,
            LastUpdate = updDate,
            LibrarianID = librIndex,
            UpdBoundary = updToDate,
            Note = note
        };
    }
}