PIBD-22. Denisov V.D. LabWork_2 #3
@ -12,14 +12,14 @@ public enum DrugsNames
|
||||
None = 0,
|
||||
|
||||
Paracetamol = 1,
|
||||
|
||||
|
||||
Ibuprofen = 2,
|
||||
|
||||
|
||||
Aspirin = 4,
|
||||
|
||||
|
||||
Antibiotic = 8,
|
||||
|
||||
|
||||
Antihistamine = 16,
|
||||
|
||||
|
||||
Insulin = 32,
|
||||
}
|
||||
}
|
@ -34,24 +34,27 @@
|
||||
labelGrams = new Label();
|
||||
labelDescription = new Label();
|
||||
checkedListBoxName = new CheckedListBox();
|
||||
textBoxGrams = new TextBox();
|
||||
textBoxDescription = new TextBox();
|
||||
numericGrams = new NumericUpDown();
|
||||
((System.ComponentModel.ISupportInitialize)numericGrams).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// buttonCancel
|
||||
//
|
||||
buttonCancel.Location = new Point(177, 302);
|
||||
buttonCancel.Location = new Point(202, 403);
|
||||
buttonCancel.Margin = new Padding(3, 4, 3, 4);
|
||||
buttonCancel.Name = "buttonCancel";
|
||||
buttonCancel.Size = new Size(93, 29);
|
||||
buttonCancel.Size = new Size(106, 39);
|
||||
buttonCancel.TabIndex = 8;
|
||||
buttonCancel.Text = "Отмена";
|
||||
buttonCancel.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// buttonSave
|
||||
//
|
||||
buttonSave.Location = new Point(38, 302);
|
||||
buttonSave.Location = new Point(43, 403);
|
||||
buttonSave.Margin = new Padding(3, 4, 3, 4);
|
||||
buttonSave.Name = "buttonSave";
|
||||
buttonSave.Size = new Size(93, 29);
|
||||
buttonSave.Size = new Size(106, 39);
|
||||
buttonSave.TabIndex = 7;
|
||||
buttonSave.Text = "Сохранить";
|
||||
buttonSave.UseVisualStyleBackColor = true;
|
||||
@ -60,68 +63,75 @@
|
||||
// labelName
|
||||
//
|
||||
labelName.AutoSize = true;
|
||||
labelName.Location = new Point(38, 44);
|
||||
labelName.Location = new Point(43, 59);
|
||||
labelName.Name = "labelName";
|
||||
labelName.Size = new Size(59, 15);
|
||||
labelName.Size = new Size(77, 20);
|
||||
labelName.TabIndex = 9;
|
||||
labelName.Text = "Название";
|
||||
//
|
||||
// labelGrams
|
||||
//
|
||||
labelGrams.AutoSize = true;
|
||||
labelGrams.Location = new Point(38, 188);
|
||||
labelGrams.Location = new Point(43, 251);
|
||||
labelGrams.Name = "labelGrams";
|
||||
labelGrams.Size = new Size(60, 15);
|
||||
labelGrams.Size = new Size(76, 20);
|
||||
labelGrams.TabIndex = 10;
|
||||
labelGrams.Text = "Грамовка";
|
||||
//
|
||||
// labelDescription
|
||||
//
|
||||
labelDescription.AutoSize = true;
|
||||
labelDescription.Location = new Point(38, 236);
|
||||
labelDescription.Location = new Point(43, 315);
|
||||
labelDescription.Name = "labelDescription";
|
||||
labelDescription.Size = new Size(45, 15);
|
||||
labelDescription.Size = new Size(57, 20);
|
||||
labelDescription.TabIndex = 11;
|
||||
labelDescription.Text = "Рецепт";
|
||||
//
|
||||
// checkedListBoxName
|
||||
//
|
||||
checkedListBoxName.FormattingEnabled = true;
|
||||
checkedListBoxName.Location = new Point(136, 44);
|
||||
checkedListBoxName.Location = new Point(155, 59);
|
||||
checkedListBoxName.Margin = new Padding(3, 4, 3, 4);
|
||||
checkedListBoxName.Name = "checkedListBoxName";
|
||||
checkedListBoxName.Size = new Size(161, 94);
|
||||
checkedListBoxName.Size = new Size(183, 114);
|
||||
checkedListBoxName.TabIndex = 12;
|
||||
//
|
||||
// textBoxGrams
|
||||
//
|
||||
textBoxGrams.Location = new Point(136, 185);
|
||||
textBoxGrams.Name = "textBoxGrams";
|
||||
textBoxGrams.Size = new Size(161, 23);
|
||||
textBoxGrams.TabIndex = 13;
|
||||
//
|
||||
// textBoxDescription
|
||||
//
|
||||
textBoxDescription.Location = new Point(136, 233);
|
||||
textBoxDescription.Location = new Point(155, 311);
|
||||
textBoxDescription.Margin = new Padding(3, 4, 3, 4);
|
||||
textBoxDescription.Name = "textBoxDescription";
|
||||
textBoxDescription.Size = new Size(161, 23);
|
||||
textBoxDescription.Size = new Size(183, 27);
|
||||
textBoxDescription.TabIndex = 14;
|
||||
//
|
||||
// numericGrams
|
||||
//
|
||||
numericGrams.Location = new Point(155, 249);
|
||||
numericGrams.Maximum = new decimal(new int[] { 10000, 0, 0, 0 });
|
||||
numericGrams.Minimum = new decimal(new int[] { 1, 0, 0, 0 });
|
||||
numericGrams.Name = "numericGrams";
|
||||
numericGrams.Size = new Size(183, 27);
|
||||
numericGrams.TabIndex = 15;
|
||||
numericGrams.Value = new decimal(new int[] { 1, 0, 0, 0 });
|
||||
//
|
||||
// FormDrug
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleDimensions = new SizeF(8F, 20F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(309, 357);
|
||||
ClientSize = new Size(353, 476);
|
||||
Controls.Add(numericGrams);
|
||||
Controls.Add(textBoxDescription);
|
||||
Controls.Add(textBoxGrams);
|
||||
Controls.Add(checkedListBoxName);
|
||||
Controls.Add(labelDescription);
|
||||
Controls.Add(labelGrams);
|
||||
Controls.Add(labelName);
|
||||
Controls.Add(buttonCancel);
|
||||
Controls.Add(buttonSave);
|
||||
Margin = new Padding(3, 4, 3, 4);
|
||||
Name = "FormDrug";
|
||||
StartPosition = FormStartPosition.CenterScreen;
|
||||
Text = "Лекарство";
|
||||
((System.ComponentModel.ISupportInitialize)numericGrams).EndInit();
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
@ -134,7 +144,7 @@
|
||||
private Label labelGrams;
|
||||
private Label labelDescription;
|
||||
private CheckedListBox checkedListBoxName;
|
||||
private TextBox textBoxGrams;
|
||||
private TextBox textBoxDescription;
|
||||
private NumericUpDown numericGrams;
|
||||
}
|
||||
}
|
@ -39,7 +39,7 @@ public partial class FormDrug : Form
|
||||
checkedListBoxName.SetItemChecked(checkedListBoxName.Items.IndexOf(elem), true);
|
||||
}
|
||||
}
|
||||
textBoxGrams.Text = drag.Grams.ToString();
|
||||
numericGrams.Text = drag.Grams.ToString();
|
||||
textBoxDescription.Text = drag.Description;
|
||||
_dragId = value;
|
||||
|
||||
@ -69,7 +69,7 @@ public partial class FormDrug : Form
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(textBoxGrams.Text) || string.IsNullOrWhiteSpace(textBoxDescription.Text) ||
|
||||
if (string.IsNullOrWhiteSpace(textBoxDescription.Text) ||
|
||||
checkedListBoxName.CheckedItems.Count == 0)
|
||||
{
|
||||
throw new Exception("Имеется незаполненные поля");
|
||||
@ -104,7 +104,7 @@ public partial class FormDrug : Form
|
||||
drugName |= (DrugsNames)elem;
|
||||
}
|
||||
|
||||
return Drug.CreateElement(id, drugName, Convert.ToInt32(textBoxGrams.Text), textBoxDescription.Text);
|
||||
return Drug.CreateElement(id, drugName, (int)numericGrams.Value, textBoxDescription.Text);
|
||||
}
|
||||
|
||||
|
||||
|
@ -74,4 +74,4 @@ public class DoctorPayRepository : IDoctorPayRepository
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -151,4 +151,4 @@ public class DoctorRepository : IDoctorRepository
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -72,7 +72,6 @@ public class PatientRepository : IPatientRepository
|
||||
|
||||
public IEnumerable<Patient> ReadPatient()
|
||||
{
|
||||
//return [];
|
||||
_logger.LogInformation("Получение всех объектов пациентов");
|
||||
try
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user