Рефакторинг

This commit is contained in:
user 2024-12-15 02:05:24 +04:00
parent 31367a7ba2
commit 6989711277
3 changed files with 66 additions and 66 deletions

View File

@ -51,7 +51,6 @@ public partial class FormAppointment : Form
dateTimePickerEnd.ValueChanged += DateTimePickerEnd_ValueChanged;
}
private void DateTimePickerEnd_ValueChanged(object sender, EventArgs e)
{
if (dateTimePickerEnd.CustomFormat == "В процессе")
@ -84,7 +83,9 @@ public partial class FormAppointment : Form
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonCancel_Click(object sender, EventArgs e) => Close();
private Appointment CreateAppointment(int id)
{
DateTime? endDate = dateTimePickerEnd.CustomFormat == "В процессе" ? (DateTime?)null : dateTimePickerEnd.Value;
@ -92,5 +93,6 @@ public partial class FormAppointment : Form
return Appointment.CreateOperation(id, (int)comboBoxOrder.SelectedValue!, (int)comboBoxEmployee.SelectedValue!, Convert.ToDateTime(dateTimePickerStart.Value),
endDate);
}
}
}

View File

@ -80,7 +80,6 @@
buttonRemove.Size = new Size(86, 101);
buttonRemove.TabIndex = 3;
buttonRemove.UseVisualStyleBackColor = true;
buttonRemove.Click += buttonRemove_Click;
//
// buttonUpdate
//

View File

@ -22,7 +22,6 @@ internal static class Program
Application.Run(CreateContainer().Resolve<FormItCompany>());
}
private static IUnityContainer CreateContainer()
{
var container = new UnityContainer();
@ -51,5 +50,5 @@ internal static class Program
.CreateLogger());
return loggerFactory;
}
}
}