Compare commits

...

2 Commits

7 changed files with 30 additions and 13 deletions

View File

@ -10,7 +10,7 @@ namespace MedicalDatabaseContracts.Models
public string PhoneNumber { get; set; } = string.Empty;
public string GetFIO()
{
return string.Join(" ", Surname, Name, Patronymic ?? string.Empty);
return Surname + " " + Name + " " + Patronymic ?? string.Empty;
}
}
}

View File

@ -15,7 +15,7 @@ namespace MedicalDatabaseContracts.ViewModels
public string PhoneNumber { get; set; } = string.Empty;
public string GetFIO()
{
return Name + " " + Surname + " " + Patronymic ?? string.Empty;
return Surname + " " + Name + " " + Patronymic ?? string.Empty;
}
public override string ToString()
{

View File

@ -124,6 +124,7 @@
// comboBoxSpecialization
//
comboBoxSpecialization.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
comboBoxSpecialization.DropDownStyle = ComboBoxStyle.DropDownList;
comboBoxSpecialization.FormattingEnabled = true;
comboBoxSpecialization.Location = new Point(145, 169);
comboBoxSpecialization.Name = "comboBoxSpecialization";

View File

@ -79,6 +79,9 @@ namespace MedicalView.Doctors
private void FormDoctor_Load(object sender, EventArgs e)
{
var specs = _specializationLogic.ReadList();
comboBoxSpecialization.DataSource = specs;
if (ModelId.HasValue)
{
try
@ -91,9 +94,6 @@ namespace MedicalView.Doctors
textBoxSurname.Text = view.Surname;
textBoxPatronymic.Text = view.Patronymic;
textBoxPhoneNumber.Text = view.PhoneNumber;
var specs = _specializationLogic.ReadList();
comboBoxSpecialization.DataSource = specs;
comboBoxSpecialization.SelectedIndex = specs.FindIndex(x => x.Id == view.SpecializationId);
}
}

View File

@ -103,7 +103,10 @@ namespace MedicalView.Visits
var service = Program.ServiceProvider?.GetService(typeof(FormVisit));
if (service is FormVisit form)
{
form.ShowDialog();
if (form.ShowDialog() == DialogResult.OK)
{
LoadData();
}
}
}

View File

@ -127,6 +127,8 @@
// comboBoxPatient
//
comboBoxPatient.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
comboBoxPatient.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
comboBoxPatient.AutoCompleteSource = AutoCompleteSource.ListItems;
comboBoxPatient.FormattingEnabled = true;
comboBoxPatient.Location = new Point(87, 77);
comboBoxPatient.Name = "comboBoxPatient";
@ -136,6 +138,8 @@
// comboBoxDoctor
//
comboBoxDoctor.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
comboBoxDoctor.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
comboBoxDoctor.AutoCompleteSource = AutoCompleteSource.ListItems;
comboBoxDoctor.FormattingEnabled = true;
comboBoxDoctor.Location = new Point(87, 112);
comboBoxDoctor.Name = "comboBoxDoctor";
@ -145,6 +149,8 @@
// comboBoxDiagnose
//
comboBoxDiagnose.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
comboBoxDiagnose.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
comboBoxDiagnose.AutoCompleteSource = AutoCompleteSource.ListItems;
comboBoxDiagnose.FormattingEnabled = true;
comboBoxDiagnose.Location = new Point(87, 150);
comboBoxDiagnose.Name = "comboBoxDiagnose";

View File

@ -77,6 +77,19 @@ namespace MedicalView.Visits
private void FormVisit_Load(object sender, EventArgs e)
{
var patients = _patientLogic.ReadList();
var doctors = _doctorLogic.ReadList();
var diagnoses = _diagnoseLogic.ReadList();
comboBoxPatient.DataSource = patients;
comboBoxPatient.SelectedIndex = -1;
comboBoxDoctor.DataSource = doctors;
comboBoxDoctor.SelectedIndex = -1;
comboBoxDiagnose.DataSource = diagnoses;
comboBoxDiagnose.SelectedIndex = diagnoses.FindIndex(x => x.Name == "Первичный прием");
if (ModelId.HasValue)
{
try
@ -88,12 +101,6 @@ namespace MedicalView.Visits
textBoxComment.Text = view.Comment;
datePicker.Value = view.Date.ToDateTime(view.Time);
timePicker.Value = view.Date.ToDateTime(view.Time);
var patients = _patientLogic.ReadList();
var doctors = _doctorLogic.ReadList();
var diagnoses = _diagnoseLogic.ReadList();
comboBoxPatient.DataSource = patients;
comboBoxDoctor.DataSource = doctors;
comboBoxDiagnose.DataSource = diagnoses;
if (view.DiagnoseId != null)
{
comboBoxDiagnose.SelectedIndex = diagnoses.FindIndex(x => x.Id == view.DiagnoseId);