точно всё

This commit is contained in:
parent de8993465e
commit 92dc4cd911
6 changed files with 80 additions and 118 deletions

View File

@ -32,38 +32,35 @@
buttonCancel = new Button(); buttonCancel = new Button();
buttonSave = new Button(); buttonSave = new Button();
comboBoxDoctor = new ComboBox(); comboBoxDoctor = new ComboBox();
groupBox = new GroupBox(); label4 = new Label();
dataGridViewPay = new DataGridView(); dateTimePicker = new DateTimePicker();
ColumnMonth = new DataGridViewTextBoxColumn();
ColumnCount = new DataGridViewTextBoxColumn();
ColumnPayment = new DataGridViewTextBoxColumn();
groupBox.SuspendLayout();
((System.ComponentModel.ISupportInitialize)dataGridViewPay).BeginInit();
SuspendLayout(); SuspendLayout();
// //
// labelDoctor // labelDoctor
// //
labelDoctor.AutoSize = true; labelDoctor.AutoSize = true;
labelDoctor.Location = new Point(31, 32); labelDoctor.Location = new Point(35, 43);
labelDoctor.Name = "labelDoctor"; labelDoctor.Name = "labelDoctor";
labelDoctor.Size = new Size(34, 15); labelDoctor.Size = new Size(43, 20);
labelDoctor.TabIndex = 0; labelDoctor.TabIndex = 0;
labelDoctor.Text = "Врач"; labelDoctor.Text = "Врач";
// //
// buttonCancel // buttonCancel
// //
buttonCancel.Location = new Point(310, 396); buttonCancel.Location = new Point(240, 143);
buttonCancel.Margin = new Padding(3, 4, 3, 4);
buttonCancel.Name = "buttonCancel"; buttonCancel.Name = "buttonCancel";
buttonCancel.Size = new Size(93, 29); buttonCancel.Size = new Size(106, 39);
buttonCancel.TabIndex = 11; buttonCancel.TabIndex = 11;
buttonCancel.Text = "Отмена"; buttonCancel.Text = "Отмена";
buttonCancel.UseVisualStyleBackColor = true; buttonCancel.UseVisualStyleBackColor = true;
// //
// buttonSave // buttonSave
// //
buttonSave.Location = new Point(22, 396); buttonSave.Location = new Point(35, 143);
buttonSave.Margin = new Padding(3, 4, 3, 4);
buttonSave.Name = "buttonSave"; buttonSave.Name = "buttonSave";
buttonSave.Size = new Size(93, 29); buttonSave.Size = new Size(106, 39);
buttonSave.TabIndex = 10; buttonSave.TabIndex = 10;
buttonSave.Text = "Сохранить"; buttonSave.Text = "Сохранить";
buttonSave.UseVisualStyleBackColor = true; buttonSave.UseVisualStyleBackColor = true;
@ -73,76 +70,45 @@
// //
comboBoxDoctor.DropDownStyle = ComboBoxStyle.DropDownList; comboBoxDoctor.DropDownStyle = ComboBoxStyle.DropDownList;
comboBoxDoctor.FormattingEnabled = true; comboBoxDoctor.FormattingEnabled = true;
comboBoxDoctor.Location = new Point(86, 29); comboBoxDoctor.Location = new Point(193, 40);
comboBoxDoctor.Margin = new Padding(3, 4, 3, 4);
comboBoxDoctor.Name = "comboBoxDoctor"; comboBoxDoctor.Name = "comboBoxDoctor";
comboBoxDoctor.Size = new Size(121, 23); comboBoxDoctor.Size = new Size(153, 28);
comboBoxDoctor.TabIndex = 12; comboBoxDoctor.TabIndex = 12;
// //
// groupBox // label4
// //
groupBox.Controls.Add(dataGridViewPay); label4.AutoSize = true;
groupBox.Location = new Point(22, 114); label4.Location = new Point(35, 99);
groupBox.Name = "groupBox"; label4.Name = "label4";
groupBox.Size = new Size(384, 223); label4.Size = new Size(54, 20);
groupBox.TabIndex = 13; label4.TabIndex = 17;
groupBox.TabStop = false; label4.Text = "Месяц";
groupBox.Text = "groupBox1";
// //
// dataGridViewPay // dateTimePicker
// //
dataGridViewPay.AllowUserToResizeColumns = false; dateTimePicker.CustomFormat = "MMMM yyyy";
dataGridViewPay.AllowUserToResizeRows = false; dateTimePicker.Format = DateTimePickerFormat.Custom;
dataGridViewPay.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; dateTimePicker.Location = new Point(193, 94);
dataGridViewPay.Columns.AddRange(new DataGridViewColumn[] { ColumnMonth, ColumnCount, ColumnPayment }); dateTimePicker.Name = "dateTimePicker";
dataGridViewPay.Dock = DockStyle.Fill; dateTimePicker.Size = new Size(153, 27);
dataGridViewPay.Location = new Point(3, 19); dateTimePicker.TabIndex = 22;
dataGridViewPay.Margin = new Padding(3, 2, 3, 2);
dataGridViewPay.MultiSelect = false;
dataGridViewPay.Name = "dataGridViewPay";
dataGridViewPay.RowHeadersVisible = false;
dataGridViewPay.RowHeadersWidth = 51;
dataGridViewPay.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
dataGridViewPay.Size = new Size(378, 201);
dataGridViewPay.TabIndex = 1;
//
// ColumnMonth
//
ColumnMonth.HeaderText = "Месяц";
ColumnMonth.MinimumWidth = 6;
ColumnMonth.Name = "ColumnMonth";
ColumnMonth.Resizable = DataGridViewTriState.True;
ColumnMonth.SortMode = DataGridViewColumnSortMode.NotSortable;
ColumnMonth.Width = 125;
//
// ColumnCount
//
ColumnCount.HeaderText = "Кол-во пациентов";
ColumnCount.MinimumWidth = 6;
ColumnCount.Name = "ColumnCount";
ColumnCount.Width = 125;
//
// ColumnPayment
//
ColumnPayment.HeaderText = "Оплата";
ColumnPayment.MinimumWidth = 6;
ColumnPayment.Name = "ColumnPayment";
ColumnPayment.Width = 125;
// //
// FormDoctorPayment // FormDoctorPayment
// //
AutoScaleDimensions = new SizeF(7F, 15F); AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font; AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(418, 450); ClientSize = new Size(370, 207);
Controls.Add(groupBox); Controls.Add(dateTimePicker);
Controls.Add(label4);
Controls.Add(comboBoxDoctor); Controls.Add(comboBoxDoctor);
Controls.Add(buttonCancel); Controls.Add(buttonCancel);
Controls.Add(buttonSave); Controls.Add(buttonSave);
Controls.Add(labelDoctor); Controls.Add(labelDoctor);
Margin = new Padding(3, 4, 3, 4);
Name = "FormDoctorPayment"; Name = "FormDoctorPayment";
StartPosition = FormStartPosition.CenterScreen; StartPosition = FormStartPosition.CenterScreen;
Text = "Оплата врачу"; Text = "Оплата врачу";
groupBox.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)dataGridViewPay).EndInit();
ResumeLayout(false); ResumeLayout(false);
PerformLayout(); PerformLayout();
} }
@ -153,10 +119,7 @@
private Button buttonCancel; private Button buttonCancel;
private Button buttonSave; private Button buttonSave;
private ComboBox comboBoxDoctor; private ComboBox comboBoxDoctor;
private GroupBox groupBox; private Label label4;
private DataGridView dataGridViewPay; private DateTimePicker dateTimePicker;
private DataGridViewTextBoxColumn ColumnMonth;
private DataGridViewTextBoxColumn ColumnCount;
private DataGridViewTextBoxColumn ColumnPayment;
} }
} }

View File

@ -9,6 +9,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using System.Windows.Forms.VisualStyles;
namespace ProjectPolyclinic.Forms; namespace ProjectPolyclinic.Forms;
@ -31,21 +32,16 @@ public partial class FormDoctorPayment : Form
{ {
try try
{ {
if (dataGridViewPay.RowCount < 1 || comboBoxDoctor.SelectedIndex < 0) if (comboBoxDoctor.SelectedIndex < 0)
{ {
throw new Exception("Имеются не заполненные поля"); throw new Exception("Имеются незаполненные поля.");
} }
string month = dataGridViewPay.Rows[0].Cells["ColumnMonth"].Value?.ToString(); string month = dateTimePicker.Value.ToString();
int countPatient = int.Parse(dataGridViewPay.Rows[0].Cells["Column2"].Value?.ToString() ?? "0");
int payment = int.Parse(dataGridViewPay.Rows[0].Cells["Column3"].Value?.ToString() ?? "0");
if (string.IsNullOrEmpty(month)) //сделать запрос на счет пациентов у каждого врача в medicalhis
{
throw new Exception("Месяц не заполнен");
}
_doctorPayRepository.CreateDoctorPayments(DoctorPay.CreateElement(0, (int)comboBoxDoctor.SelectedValue!, month, countPatient, payment)); _doctorPayRepository.CreateDoctorPayments(DoctorPay.CreateElement(0, (int)comboBoxDoctor.SelectedValue!, month, 0, 0));

View File

@ -117,13 +117,4 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<metadata name="ColumnMonth.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="ColumnCount.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="ColumnPayment.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root> </root>

View File

@ -47,18 +47,18 @@
// labelPacientName // labelPacientName
// //
labelPacientName.AutoSize = true; labelPacientName.AutoSize = true;
labelPacientName.Location = new Point(30, 36); labelPacientName.Location = new Point(34, 48);
labelPacientName.Name = "labelPacientName"; labelPacientName.Name = "labelPacientName";
labelPacientName.Size = new Size(54, 15); labelPacientName.Size = new Size(69, 20);
labelPacientName.TabIndex = 0; labelPacientName.TabIndex = 0;
labelPacientName.Text = "Пациент"; labelPacientName.Text = "Пациент";
// //
// labelDoctorName // labelDoctorName
// //
labelDoctorName.AutoSize = true; labelDoctorName.AutoSize = true;
labelDoctorName.Location = new Point(30, 88); labelDoctorName.Location = new Point(34, 117);
labelDoctorName.Name = "labelDoctorName"; labelDoctorName.Name = "labelDoctorName";
labelDoctorName.Size = new Size(47, 15); labelDoctorName.Size = new Size(59, 20);
labelDoctorName.TabIndex = 1; labelDoctorName.TabIndex = 1;
labelDoctorName.Text = "Доктор"; labelDoctorName.Text = "Доктор";
// //
@ -66,26 +66,30 @@
// //
comboBoxPacient.DropDownStyle = ComboBoxStyle.DropDownList; comboBoxPacient.DropDownStyle = ComboBoxStyle.DropDownList;
comboBoxPacient.FormattingEnabled = true; comboBoxPacient.FormattingEnabled = true;
comboBoxPacient.Location = new Point(129, 33); comboBoxPacient.Location = new Point(147, 44);
comboBoxPacient.Margin = new Padding(3, 4, 3, 4);
comboBoxPacient.Name = "comboBoxPacient"; comboBoxPacient.Name = "comboBoxPacient";
comboBoxPacient.Size = new Size(133, 23); comboBoxPacient.Size = new Size(151, 28);
comboBoxPacient.TabIndex = 2; comboBoxPacient.TabIndex = 2;
// //
// comboBoxDoctor // comboBoxDoctor
// //
comboBoxDoctor.DropDownStyle = ComboBoxStyle.DropDownList; comboBoxDoctor.DropDownStyle = ComboBoxStyle.DropDownList;
comboBoxDoctor.FormattingEnabled = true; comboBoxDoctor.FormattingEnabled = true;
comboBoxDoctor.Location = new Point(129, 85); comboBoxDoctor.Location = new Point(147, 113);
comboBoxDoctor.Margin = new Padding(3, 4, 3, 4);
comboBoxDoctor.Name = "comboBoxDoctor"; comboBoxDoctor.Name = "comboBoxDoctor";
comboBoxDoctor.Size = new Size(133, 23); comboBoxDoctor.Size = new Size(151, 28);
comboBoxDoctor.TabIndex = 3; comboBoxDoctor.TabIndex = 3;
// //
// groupBox // groupBox
// //
groupBox.Controls.Add(dataGridView); groupBox.Controls.Add(dataGridView);
groupBox.Location = new Point(30, 175); groupBox.Location = new Point(34, 233);
groupBox.Margin = new Padding(3, 4, 3, 4);
groupBox.Name = "groupBox"; groupBox.Name = "groupBox";
groupBox.Size = new Size(235, 247); groupBox.Padding = new Padding(3, 4, 3, 4);
groupBox.Size = new Size(269, 329);
groupBox.TabIndex = 4; groupBox.TabIndex = 4;
groupBox.TabStop = false; groupBox.TabStop = false;
groupBox.Text = "groupBox"; groupBox.Text = "groupBox";
@ -97,12 +101,14 @@
dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridView.Columns.AddRange(new DataGridViewColumn[] { ColumnDrug, DrugCount }); dataGridView.Columns.AddRange(new DataGridViewColumn[] { ColumnDrug, DrugCount });
dataGridView.Dock = DockStyle.Fill; dataGridView.Dock = DockStyle.Fill;
dataGridView.Location = new Point(3, 19); dataGridView.Location = new Point(3, 24);
dataGridView.Margin = new Padding(3, 4, 3, 4);
dataGridView.MultiSelect = false; dataGridView.MultiSelect = false;
dataGridView.Name = "dataGridView"; dataGridView.Name = "dataGridView";
dataGridView.RowHeadersVisible = false; dataGridView.RowHeadersVisible = false;
dataGridView.RowHeadersWidth = 51;
dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect; dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
dataGridView.Size = new Size(229, 225); dataGridView.Size = new Size(263, 301);
dataGridView.TabIndex = 0; dataGridView.TabIndex = 0;
// //
// ColumnDrug // ColumnDrug
@ -115,14 +121,16 @@
// DrugCount // DrugCount
// //
DrugCount.HeaderText = "Количество"; DrugCount.HeaderText = "Количество";
DrugCount.MinimumWidth = 6;
DrugCount.Name = "DrugCount"; DrugCount.Name = "DrugCount";
DrugCount.Width = 125;
// //
// label // label
// //
label.AutoSize = true; label.AutoSize = true;
label.Location = new Point(30, 139); label.Location = new Point(34, 185);
label.Name = "label"; label.Name = "label";
label.Size = new Size(43, 15); label.Size = new Size(52, 20);
label.TabIndex = 5; label.TabIndex = 5;
label.Text = "Статус"; label.Text = "Статус";
// //
@ -130,26 +138,28 @@
// //
comboBoxStatus.DropDownStyle = ComboBoxStyle.DropDownList; comboBoxStatus.DropDownStyle = ComboBoxStyle.DropDownList;
comboBoxStatus.FormattingEnabled = true; comboBoxStatus.FormattingEnabled = true;
comboBoxStatus.Location = new Point(129, 136); comboBoxStatus.Location = new Point(147, 181);
comboBoxStatus.Margin = new Padding(3, 4, 3, 4);
comboBoxStatus.Name = "comboBoxStatus"; comboBoxStatus.Name = "comboBoxStatus";
comboBoxStatus.Size = new Size(133, 23); comboBoxStatus.Size = new Size(151, 28);
comboBoxStatus.TabIndex = 6; comboBoxStatus.TabIndex = 6;
comboBoxStatus.SelectedIndexChanged += comboBoxStatus_SelectedIndexChanged;
// //
// buttonCancel // buttonCancel
// //
buttonCancel.Location = new Point(169, 519); buttonCancel.Location = new Point(193, 692);
buttonCancel.Margin = new Padding(3, 4, 3, 4);
buttonCancel.Name = "buttonCancel"; buttonCancel.Name = "buttonCancel";
buttonCancel.Size = new Size(93, 29); buttonCancel.Size = new Size(106, 39);
buttonCancel.TabIndex = 10; buttonCancel.TabIndex = 10;
buttonCancel.Text = "Отмена"; buttonCancel.Text = "Отмена";
buttonCancel.UseVisualStyleBackColor = true; buttonCancel.UseVisualStyleBackColor = true;
// //
// buttonSave // buttonSave
// //
buttonSave.Location = new Point(30, 519); buttonSave.Location = new Point(34, 692);
buttonSave.Margin = new Padding(3, 4, 3, 4);
buttonSave.Name = "buttonSave"; buttonSave.Name = "buttonSave";
buttonSave.Size = new Size(93, 29); buttonSave.Size = new Size(106, 39);
buttonSave.TabIndex = 9; buttonSave.TabIndex = 9;
buttonSave.Text = "Сохранить"; buttonSave.Text = "Сохранить";
buttonSave.UseVisualStyleBackColor = true; buttonSave.UseVisualStyleBackColor = true;
@ -157,9 +167,9 @@
// //
// FormMedicalHistory // FormMedicalHistory
// //
AutoScaleDimensions = new SizeF(7F, 15F); AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font; AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(296, 574); ClientSize = new Size(325, 765);
Controls.Add(buttonCancel); Controls.Add(buttonCancel);
Controls.Add(buttonSave); Controls.Add(buttonSave);
Controls.Add(comboBoxStatus); Controls.Add(comboBoxStatus);
@ -169,6 +179,7 @@
Controls.Add(comboBoxPacient); Controls.Add(comboBoxPacient);
Controls.Add(labelDoctorName); Controls.Add(labelDoctorName);
Controls.Add(labelPacientName); Controls.Add(labelPacientName);
Margin = new Padding(3, 4, 3, 4);
Name = "FormMedicalHistory"; Name = "FormMedicalHistory";
StartPosition = FormStartPosition.CenterScreen; StartPosition = FormStartPosition.CenterScreen;
Text = "Медицинская история"; Text = "Медицинская история";

View File

@ -94,9 +94,4 @@ public partial class FormMedicalHistory : Form
} }
return list; return list;
} }
private void comboBoxStatus_SelectedIndexChanged(object sender, EventArgs e)
{
}
} }

View File

@ -123,4 +123,10 @@
<metadata name="DrugCount.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="DrugCount.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<metadata name="ColumnDrug.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="DrugCount.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root> </root>