точно всё

This commit is contained in:
parent 4c9a5d26ae
commit 80e7462e84
3 changed files with 45 additions and 44 deletions

View File

@ -36,35 +36,35 @@
dateTimePicker = new DateTimePicker();
label1 = new Label();
label2 = new Label();
textBoxCount = new TextBox();
textBoxPay = new TextBox();
numericCount = new NumericUpDown();
numericPay = new NumericUpDown();
((System.ComponentModel.ISupportInitialize)numericCount).BeginInit();
((System.ComponentModel.ISupportInitialize)numericPay).BeginInit();
SuspendLayout();
//
// labelDoctor
//
labelDoctor.AutoSize = true;
labelDoctor.Location = new Point(35, 43);
labelDoctor.Location = new Point(31, 32);
labelDoctor.Name = "labelDoctor";
labelDoctor.Size = new Size(43, 20);
labelDoctor.Size = new Size(34, 15);
labelDoctor.TabIndex = 0;
labelDoctor.Text = "Врач";
//
// buttonCancel
//
buttonCancel.Location = new Point(240, 304);
buttonCancel.Margin = new Padding(3, 4, 3, 4);
buttonCancel.Location = new Point(210, 228);
buttonCancel.Name = "buttonCancel";
buttonCancel.Size = new Size(106, 39);
buttonCancel.Size = new Size(93, 29);
buttonCancel.TabIndex = 11;
buttonCancel.Text = "Отмена";
buttonCancel.UseVisualStyleBackColor = true;
//
// buttonSave
//
buttonSave.Location = new Point(35, 304);
buttonSave.Margin = new Padding(3, 4, 3, 4);
buttonSave.Location = new Point(31, 228);
buttonSave.Name = "buttonSave";
buttonSave.Size = new Size(106, 39);
buttonSave.Size = new Size(93, 29);
buttonSave.TabIndex = 10;
buttonSave.Text = "Сохранить";
buttonSave.UseVisualStyleBackColor = true;
@ -74,18 +74,17 @@
//
comboBoxDoctor.DropDownStyle = ComboBoxStyle.DropDownList;
comboBoxDoctor.FormattingEnabled = true;
comboBoxDoctor.Location = new Point(193, 40);
comboBoxDoctor.Margin = new Padding(3, 4, 3, 4);
comboBoxDoctor.Location = new Point(169, 30);
comboBoxDoctor.Name = "comboBoxDoctor";
comboBoxDoctor.Size = new Size(153, 28);
comboBoxDoctor.Size = new Size(134, 23);
comboBoxDoctor.TabIndex = 12;
//
// label4
//
label4.AutoSize = true;
label4.Location = new Point(35, 99);
label4.Location = new Point(31, 74);
label4.Name = "label4";
label4.Size = new Size(54, 20);
label4.Size = new Size(43, 15);
label4.TabIndex = 17;
label4.Text = "Месяц";
//
@ -93,50 +92,53 @@
//
dateTimePicker.CustomFormat = "MMMM yyyy";
dateTimePicker.Format = DateTimePickerFormat.Custom;
dateTimePicker.Location = new Point(193, 94);
dateTimePicker.Location = new Point(169, 70);
dateTimePicker.Margin = new Padding(3, 2, 3, 2);
dateTimePicker.Name = "dateTimePicker";
dateTimePicker.Size = new Size(153, 27);
dateTimePicker.Size = new Size(134, 23);
dateTimePicker.TabIndex = 22;
//
// label1
//
label1.AutoSize = true;
label1.Location = new Point(35, 155);
label1.Location = new Point(31, 116);
label1.Name = "label1";
label1.Size = new Size(142, 20);
label1.Size = new Size(113, 15);
label1.TabIndex = 23;
label1.Text = "Кол-во посещений";
//
// label2
//
label2.AutoSize = true;
label2.Location = new Point(35, 204);
label2.Location = new Point(31, 153);
label2.Name = "label2";
label2.Size = new Size(59, 20);
label2.Size = new Size(47, 15);
label2.TabIndex = 24;
label2.Text = "Оплата";
//
// textBoxCount
// numericCount
//
textBoxCount.Location = new Point(193, 152);
textBoxCount.Name = "textBoxCount";
textBoxCount.Size = new Size(153, 27);
textBoxCount.TabIndex = 25;
numericCount.Location = new Point(169, 114);
numericCount.Maximum = new decimal(new int[] { 999999, 0, 0, 0 });
numericCount.Name = "numericCount";
numericCount.Size = new Size(134, 23);
numericCount.TabIndex = 27;
//
// textBoxPay
// numericPay
//
textBoxPay.Location = new Point(193, 201);
textBoxPay.Name = "textBoxPay";
textBoxPay.Size = new Size(153, 27);
textBoxPay.TabIndex = 26;
numericPay.Location = new Point(169, 151);
numericPay.Maximum = new decimal(new int[] { 999999, 0, 0, 0 });
numericPay.Name = "numericPay";
numericPay.Size = new Size(134, 23);
numericPay.TabIndex = 28;
//
// FormDoctorPayment
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(370, 363);
Controls.Add(textBoxPay);
Controls.Add(textBoxCount);
ClientSize = new Size(324, 272);
Controls.Add(numericPay);
Controls.Add(numericCount);
Controls.Add(label2);
Controls.Add(label1);
Controls.Add(dateTimePicker);
@ -145,10 +147,11 @@
Controls.Add(buttonCancel);
Controls.Add(buttonSave);
Controls.Add(labelDoctor);
Margin = new Padding(3, 4, 3, 4);
Name = "FormDoctorPayment";
StartPosition = FormStartPosition.CenterScreen;
Text = "Оплата врачу";
((System.ComponentModel.ISupportInitialize)numericCount).EndInit();
((System.ComponentModel.ISupportInitialize)numericPay).EndInit();
ResumeLayout(false);
PerformLayout();
}
@ -163,7 +166,7 @@
private DateTimePicker dateTimePicker;
private Label label1;
private Label label2;
private TextBox textBoxCount;
private TextBox textBoxPay;
private NumericUpDown numericCount;
private NumericUpDown numericPay;
}
}

View File

@ -34,17 +34,15 @@ public partial class FormDoctorPayment : Form
{
try
{
if (comboBoxDoctor.SelectedIndex < 0 ||
string.IsNullOrWhiteSpace(textBoxCount.Text) ||
string.IsNullOrWhiteSpace(textBoxPay.Text))
if (comboBoxDoctor.SelectedIndex < 0)
{
throw new Exception("Имеются незаполненные поля.");
}
int doctorId = (int)comboBoxDoctor.SelectedValue!;
string month = dateTimePicker.Value.ToString("yyyy-MM");
int patientCount = Convert.ToInt32(textBoxCount.Text);
int payment = Convert.ToInt32(textBoxPay.Text);
int patientCount = (int)numericCount.Value;
int payment = (int)numericPay.Value;
var doctorPay = DoctorPay.CreateElement(0, doctorId, month, patientCount, payment);
_doctorPayRepository.CreateDoctorPayments(doctorPay);