using System; using System.Windows.Forms; using ProjectLibrary.Entites; using ProjectLibrary.Entities; namespace ProjectLibrary.Forms { public partial class FTicket_Extension : Form { private TicketExtensions _ticketExtensions; public FTicket_Extension(TicketExtensions ticketExtensions) { InitializeComponent(); _ticketExtensions = ticketExtensions; LoadTicketExtensionData(); } private void LoadTicketExtensionData() { txtReaderID.Text = _ticketExtensions.ReaderID.ToString(); txtExtensionID.Text = _ticketExtensions.ExtensionID.ToString(); txtLastUpdateDate.Text = _ticketExtensions.LastUpdateDate.ToShortDateString(); txtNextUpdateDate.Text = _ticketExtensions.NextUpdateDate.ToShortDateString(); } private void btnSave_Click(object sender, EventArgs e) { // Создание новой сущности с обновленными данными var updatedTicketExtensions = TicketExtensions.CreateEntity( int.Parse(txtReaderID.Text), int.Parse(txtExtensionID.Text), DateTime.Parse(txtLastUpdateDate.Text), DateTime.Parse(txtNextUpdateDate.Text) ); // Обновление внутренней переменной _ticketExtensions = updatedTicketExtensions; MessageBox.Show("Данные успешно сохранены!"); } private void buttonCancel_Click_Click(object sender, EventArgs e) { } } }