PIBD-22. Denisov V.D. LabWork_1 #2
41
ProjectPolyclinic/ProjectPolyclinic/Entities/Doctor.cs
Normal file
41
ProjectPolyclinic/ProjectPolyclinic/Entities/Doctor.cs
Normal file
@ -0,0 +1,41 @@
|
||||
using ProjectPolyclinic.Entities.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectPolyclinic.Entities;
|
||||
|
||||
public class Doctor
|
||||
{
|
||||
|
||||
public int Id { get; private set; }
|
||||
|
||||
public string First_Name { get; private set; } = string.Empty;
|
||||
|
||||
public string Last_Name { get; private set; } = string.Empty;
|
||||
|
||||
public int Room { get; private set; }
|
||||
|
||||
public Specialization Specialization { get; private set; } //свойство Specialization, которое имеет тип Specialization
|
||||
|
||||
public SpecializationLevel SpecializationLevel { get; private set; } //свойство SpecializationLevel, которое имеет тип SpecializationLevel
|
||||
|
||||
public static Doctor CreateEntity(int id, string first_Name, string last_Name, int room, Specialization specialization, SpecializationLevel specializationLevel)
|
||||
{
|
||||
return new Doctor
|
||||
{
|
||||
Id = id,
|
||||
First_Name = first_Name ?? string.Empty,
|
||||
Last_Name = last_Name ?? string.Empty,
|
||||
Room = room,
|
||||
Specialization = specialization,
|
||||
SpecializationLevel = specializationLevel
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
34
ProjectPolyclinic/ProjectPolyclinic/Entities/DoctorPay.cs
Normal file
34
ProjectPolyclinic/ProjectPolyclinic/Entities/DoctorPay.cs
Normal file
@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectPolyclinic.Entities;
|
||||
|
||||
public class DoctorPay
|
||||
{
|
||||
|
||||
public int Id { get; private set; }
|
||||
|
||||
public int IdDoctor { get; private set; }
|
||||
|
||||
public string Month { get; private set; } = string.Empty;
|
||||
|
||||
public int Count_Patient { get; private set; }
|
||||
|
||||
public int Payment { get; private set; }
|
||||
|
||||
public static DoctorPay CreateElement(int id, int idDoctor, string month, int count_patient, int payment)
|
||||
{
|
||||
return new DoctorPay
|
||||
{
|
||||
Id = id,
|
||||
IdDoctor = idDoctor,
|
||||
Month = month,
|
||||
Count_Patient = count_patient,
|
||||
Payment = payment
|
||||
};
|
||||
}
|
||||
|
||||
}
|
30
ProjectPolyclinic/ProjectPolyclinic/Entities/Drug.cs
Normal file
30
ProjectPolyclinic/ProjectPolyclinic/Entities/Drug.cs
Normal file
@ -0,0 +1,30 @@
|
||||
using ProjectPolyclinic.Entities.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectPolyclinic.Entities;
|
||||
|
||||
public class Drug
|
||||
{
|
||||
public int Id { get; private set; }
|
||||
|
||||
public DrugsNames drugsNames { get; private set; }
|
||||
|
||||
public int Grams { get; private set; }
|
||||
|
||||
public string Description { get; private set; } = string.Empty;
|
||||
|
||||
public static Drug CreateElement(int id, DrugsNames name, int grams, string description)
|
||||
{
|
||||
return new Drug
|
||||
{
|
||||
Id = id,
|
||||
drugsNames = name,
|
||||
Grams = grams,
|
||||
Description = description ?? string.Empty
|
||||
};
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectPolyclinic.Entities;
|
||||
|
||||
public class DrugMedHistory
|
||||
{
|
||||
public int Id { get; private set; }
|
||||
|
||||
public int DrugId { get; private set; }
|
||||
|
||||
public int MedicalHistoryId { get; private set; }
|
||||
|
||||
public int Count { get; private set; }
|
||||
|
||||
public static DrugMedHistory CreateEntity(int id, int drugId, int medicalHistoryId, int count)
|
||||
{
|
||||
return new DrugMedHistory
|
||||
{
|
||||
Id = id,
|
||||
DrugId = drugId,
|
||||
MedicalHistoryId = medicalHistoryId,
|
||||
Count = count
|
||||
};
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectPolyclinic.Entities.Enums;
|
||||
|
||||
[Flags]
|
||||
public enum DrugsNames
|
||||
{
|
||||
None = 0,
|
||||
|
||||
Paracetamol = 1,
|
||||
|
||||
Ibuprofen = 2,
|
||||
|
||||
Aspirin = 4,
|
||||
|
||||
Antibiotic = 8,
|
||||
|
||||
Antihistamine = 16,
|
||||
|
||||
Insulin = 32,
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectPolyclinic.Entities.Enums;
|
||||
|
||||
public enum Specialization
|
||||
{
|
||||
None = 0,
|
||||
|
||||
Therapist = 1,
|
||||
|
||||
Surgeon = 2,
|
||||
|
||||
Cardiolog = 3,
|
||||
|
||||
Ortoped = 4,
|
||||
|
||||
Nevrolog = 5,
|
||||
|
||||
Pediatr = 6
|
||||
}
|
||||
|
@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectPolyclinic.Entities.Enums;
|
||||
|
||||
public enum SpecializationLevel
|
||||
{
|
||||
None = 0,
|
||||
|
||||
Intern = 1,
|
||||
|
||||
Doctor = 2,
|
||||
|
||||
Senior_doctor = 3,
|
||||
|
||||
Professor = 4
|
||||
}
|
17
ProjectPolyclinic/ProjectPolyclinic/Entities/Enums/Status.cs
Normal file
17
ProjectPolyclinic/ProjectPolyclinic/Entities/Enums/Status.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectPolyclinic.Entities.Enums;
|
||||
|
||||
|
||||
public enum Status
|
||||
{
|
||||
none = 0,
|
||||
|
||||
Sick= 1,
|
||||
|
||||
Heal = 2
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
using ProjectPolyclinic.Entities.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectPolyclinic.Entities;
|
||||
|
||||
public class MedicalHistory
|
||||
{
|
||||
|
||||
|
||||
|
||||
public int Id { get; private set; }
|
||||
|
||||
public int PatientId { get; private set; }
|
||||
|
||||
public int DoctorId { get; private set; }
|
||||
|
||||
public DateTime VisitDate { get; private set; }
|
||||
|
||||
public Status Status { get; private set; }
|
||||
|
||||
public IEnumerable<DrugMedHistory> DrugMedHistory { get; private set; } = [];
|
||||
|
||||
public static MedicalHistory CreateEntity(int id, int patientId,
|
||||
Status status, int doctorId, IEnumerable<DrugMedHistory> drugMedHistory)
|
||||
{
|
||||
return new MedicalHistory
|
||||
{
|
||||
Id = id,
|
||||
PatientId = patientId,
|
||||
DoctorId = doctorId,
|
||||
VisitDate = DateTime.Now,
|
||||
Status = status,
|
||||
DrugMedHistory = drugMedHistory
|
||||
};
|
||||
}
|
||||
|
||||
}
|
35
ProjectPolyclinic/ProjectPolyclinic/Entities/Patient.cs
Normal file
35
ProjectPolyclinic/ProjectPolyclinic/Entities/Patient.cs
Normal file
@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectPolyclinic.Entities;
|
||||
|
||||
public class Patient
|
||||
{
|
||||
|
||||
public int Id { get; private set; }
|
||||
|
||||
public string First_Name { get; private set; } = string.Empty;
|
||||
|
||||
public string Last_Name { get; private set; } = string.Empty;
|
||||
|
||||
public string Address { get; private set; } = string.Empty;
|
||||
|
||||
public string ContactNumber { get; private set; } = string.Empty;
|
||||
|
||||
|
||||
public static Patient CreateEntity(int id, string first_Name, string last_Name, string Address, string contactNumber)
|
||||
{
|
||||
return new Patient
|
||||
{
|
||||
Id = id,
|
||||
First_Name = first_Name,
|
||||
Last_Name = last_Name,
|
||||
Address = Address,
|
||||
ContactNumber = contactNumber
|
||||
};
|
||||
}
|
||||
|
||||
}
|
@ -1,39 +0,0 @@
|
||||
namespace ProjectPolyclinic
|
||||
{
|
||||
partial class Form1
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(800, 450);
|
||||
this.Text = "Form1";
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
namespace ProjectPolyclinic
|
||||
{
|
||||
public partial class Form1 : Form
|
||||
{
|
||||
public Form1()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
138
ProjectPolyclinic/ProjectPolyclinic/FormPolyclinic.Designer.cs
generated
Normal file
138
ProjectPolyclinic/ProjectPolyclinic/FormPolyclinic.Designer.cs
generated
Normal file
@ -0,0 +1,138 @@
|
||||
namespace ProjectPolyclinic
|
||||
{
|
||||
partial class FormPolyclinic
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
menuStrip1 = new MenuStrip();
|
||||
справочникиToolStripMenuItem = new ToolStripMenuItem();
|
||||
DoctorsToolStripMenuItem = new ToolStripMenuItem();
|
||||
PacientsToolStripMenuItem = new ToolStripMenuItem();
|
||||
DrugsToolStripMenuItem = new ToolStripMenuItem();
|
||||
операцииToolStripMenuItem = new ToolStripMenuItem();
|
||||
MedHistoryToolStripMenuItem = new ToolStripMenuItem();
|
||||
DoctorPayToolStripMenuItem = new ToolStripMenuItem();
|
||||
otchetsToolStripMenuItem = new ToolStripMenuItem();
|
||||
menuStrip1.SuspendLayout();
|
||||
SuspendLayout();
|
||||
//
|
||||
// menuStrip1
|
||||
//
|
||||
menuStrip1.Items.AddRange(new ToolStripItem[] { справочникиToolStripMenuItem, операцииToolStripMenuItem, otchetsToolStripMenuItem });
|
||||
menuStrip1.Location = new Point(0, 0);
|
||||
menuStrip1.Name = "menuStrip1";
|
||||
menuStrip1.Size = new Size(784, 24);
|
||||
menuStrip1.TabIndex = 0;
|
||||
menuStrip1.Text = "menuStrip1";
|
||||
//
|
||||
// справочникиToolStripMenuItem
|
||||
//
|
||||
справочникиToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { DoctorsToolStripMenuItem, PacientsToolStripMenuItem, DrugsToolStripMenuItem });
|
||||
справочникиToolStripMenuItem.Name = "справочникиToolStripMenuItem";
|
||||
справочникиToolStripMenuItem.Size = new Size(94, 20);
|
||||
справочникиToolStripMenuItem.Text = "Справочники";
|
||||
//
|
||||
// DoctorsToolStripMenuItem
|
||||
//
|
||||
DoctorsToolStripMenuItem.Name = "DoctorsToolStripMenuItem";
|
||||
DoctorsToolStripMenuItem.Size = new Size(180, 22);
|
||||
DoctorsToolStripMenuItem.Text = "Врачи";
|
||||
DoctorsToolStripMenuItem.Click += DoctorsToolStripMenuItem_Click;
|
||||
//
|
||||
// PacientsToolStripMenuItem
|
||||
//
|
||||
PacientsToolStripMenuItem.Name = "PacientsToolStripMenuItem";
|
||||
PacientsToolStripMenuItem.Size = new Size(180, 22);
|
||||
PacientsToolStripMenuItem.Text = "Пациенты";
|
||||
PacientsToolStripMenuItem.Click += PacientsToolStripMenuItem_Click;
|
||||
//
|
||||
// DrugsToolStripMenuItem
|
||||
//
|
||||
DrugsToolStripMenuItem.Name = "DrugsToolStripMenuItem";
|
||||
DrugsToolStripMenuItem.Size = new Size(180, 22);
|
||||
DrugsToolStripMenuItem.Text = "Лекарства";
|
||||
DrugsToolStripMenuItem.Click += DrugsToolStripMenuItem_Click;
|
||||
//
|
||||
// операцииToolStripMenuItem
|
||||
//
|
||||
операцииToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { MedHistoryToolStripMenuItem, DoctorPayToolStripMenuItem });
|
||||
операцииToolStripMenuItem.Name = "операцииToolStripMenuItem";
|
||||
операцииToolStripMenuItem.Size = new Size(75, 20);
|
||||
операцииToolStripMenuItem.Text = "Операции";
|
||||
//
|
||||
// MedHistoryToolStripMenuItem
|
||||
//
|
||||
MedHistoryToolStripMenuItem.Name = "MedHistoryToolStripMenuItem";
|
||||
MedHistoryToolStripMenuItem.Size = new Size(180, 22);
|
||||
MedHistoryToolStripMenuItem.Text = "Учет мед. карты";
|
||||
MedHistoryToolStripMenuItem.Click += MedHistoryToolStripMenuItem_Click;
|
||||
//
|
||||
// DoctorPayToolStripMenuItem
|
||||
//
|
||||
DoctorPayToolStripMenuItem.Name = "DoctorPayToolStripMenuItem";
|
||||
DoctorPayToolStripMenuItem.Size = new Size(180, 22);
|
||||
DoctorPayToolStripMenuItem.Text = "Оплата врачу";
|
||||
DoctorPayToolStripMenuItem.Click += DoctorPayToolStripMenuItem_Click;
|
||||
//
|
||||
// otchetsToolStripMenuItem
|
||||
//
|
||||
otchetsToolStripMenuItem.Name = "otchetsToolStripMenuItem";
|
||||
otchetsToolStripMenuItem.Size = new Size(60, 20);
|
||||
otchetsToolStripMenuItem.Text = "Отчеты";
|
||||
//
|
||||
// FormPolyclinic
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
BackgroundImage = Properties.Resources.polyclinicfon;
|
||||
BackgroundImageLayout = ImageLayout.Stretch;
|
||||
ClientSize = new Size(784, 411);
|
||||
Controls.Add(menuStrip1);
|
||||
DoubleBuffered = true;
|
||||
MainMenuStrip = menuStrip1;
|
||||
Name = "FormPolyclinic";
|
||||
StartPosition = FormStartPosition.CenterScreen;
|
||||
Text = "Больница";
|
||||
menuStrip1.ResumeLayout(false);
|
||||
menuStrip1.PerformLayout();
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private MenuStrip menuStrip1;
|
||||
private ToolStripMenuItem справочникиToolStripMenuItem;
|
||||
private ToolStripMenuItem DoctorsToolStripMenuItem;
|
||||
private ToolStripMenuItem PacientsToolStripMenuItem;
|
||||
private ToolStripMenuItem DrugsToolStripMenuItem;
|
||||
private ToolStripMenuItem операцииToolStripMenuItem;
|
||||
private ToolStripMenuItem MedHistoryToolStripMenuItem;
|
||||
private ToolStripMenuItem otchetsToolStripMenuItem;
|
||||
private ToolStripMenuItem DoctorPayToolStripMenuItem;
|
||||
}
|
||||
}
|
81
ProjectPolyclinic/ProjectPolyclinic/FormPolyclinic.cs
Normal file
81
ProjectPolyclinic/ProjectPolyclinic/FormPolyclinic.cs
Normal file
@ -0,0 +1,81 @@
|
||||
using ProjectPolyclinic.Forms;
|
||||
using System.ComponentModel;
|
||||
using Unity;
|
||||
|
||||
namespace ProjectPolyclinic;
|
||||
|
||||
public partial class FormPolyclinic : Form
|
||||
{
|
||||
|
||||
private readonly IUnityContainer _container;
|
||||
|
||||
|
||||
|
||||
public FormPolyclinic(IUnityContainer container)
|
||||
{
|
||||
InitializeComponent();
|
||||
_container = container ??
|
||||
throw new ArgumentNullException(nameof(container));
|
||||
}
|
||||
|
||||
private void DoctorsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
_container.Resolve<FormDoctors>().ShowDialog();
|
||||
}
|
||||
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Îøèáêà ïðè çàãðóçêå", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void PacientsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
_container.Resolve<FormPatients>().ShowDialog();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Îøèáêà ïðè çàãðóçêå", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void DrugsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
_container.Resolve<FormDrugs>().ShowDialog();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Îøèáêà ïðè çàãðóçêå", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void MedHistoryToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
_container.Resolve<FormMedicalHistories>().ShowDialog();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Îøèáêà ïðè çàãðóçêå", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void DoctorPayToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
_container.Resolve<FormDoctorPayments>().ShowDialog();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Îøèáêà ïðè çàãðóçêå", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
}
|
123
ProjectPolyclinic/ProjectPolyclinic/FormPolyclinic.resx
Normal file
123
ProjectPolyclinic/ProjectPolyclinic/FormPolyclinic.resx
Normal file
@ -0,0 +1,123 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
192
ProjectPolyclinic/ProjectPolyclinic/Forms/FormDoctor.Designer.cs
generated
Normal file
192
ProjectPolyclinic/ProjectPolyclinic/Forms/FormDoctor.Designer.cs
generated
Normal file
@ -0,0 +1,192 @@
|
||||
namespace ProjectPolyclinic.Forms
|
||||
{
|
||||
partial class FormDoctor
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
labelFirstName = new Label();
|
||||
labelLastName = new Label();
|
||||
labelSpecializationLevel = new Label();
|
||||
labelRoom = new Label();
|
||||
labelSpecialization = new Label();
|
||||
buttonSave = new Button();
|
||||
buttonCancel = new Button();
|
||||
textBoxFirstName = new TextBox();
|
||||
textBoxLastName = new TextBox();
|
||||
comboBoxSpecialization = new ComboBox();
|
||||
comboBoxSpecializationLevel = new ComboBox();
|
||||
numericUpDownRoom = new NumericUpDown();
|
||||
((System.ComponentModel.ISupportInitialize)numericUpDownRoom).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// labelFirstName
|
||||
//
|
||||
labelFirstName.AutoSize = true;
|
||||
labelFirstName.Location = new Point(27, 34);
|
||||
labelFirstName.Name = "labelFirstName";
|
||||
labelFirstName.Size = new Size(31, 15);
|
||||
labelFirstName.TabIndex = 0;
|
||||
labelFirstName.Text = "Имя";
|
||||
//
|
||||
// labelLastName
|
||||
//
|
||||
labelLastName.AutoSize = true;
|
||||
labelLastName.Location = new Point(27, 82);
|
||||
labelLastName.Name = "labelLastName";
|
||||
labelLastName.Size = new Size(58, 15);
|
||||
labelLastName.TabIndex = 1;
|
||||
labelLastName.Text = "Фамилия";
|
||||
//
|
||||
// labelSpecializationLevel
|
||||
//
|
||||
labelSpecializationLevel.AutoSize = true;
|
||||
labelSpecializationLevel.Location = new Point(27, 233);
|
||||
labelSpecializationLevel.Name = "labelSpecializationLevel";
|
||||
labelSpecializationLevel.Size = new Size(69, 15);
|
||||
labelSpecializationLevel.TabIndex = 2;
|
||||
labelSpecializationLevel.Text = "Должность";
|
||||
//
|
||||
// labelRoom
|
||||
//
|
||||
labelRoom.AutoSize = true;
|
||||
labelRoom.Location = new Point(27, 130);
|
||||
labelRoom.Name = "labelRoom";
|
||||
labelRoom.Size = new Size(52, 15);
|
||||
labelRoom.TabIndex = 3;
|
||||
labelRoom.Text = "Кабинет";
|
||||
//
|
||||
// labelSpecialization
|
||||
//
|
||||
labelSpecialization.AutoSize = true;
|
||||
labelSpecialization.Location = new Point(27, 181);
|
||||
labelSpecialization.Name = "labelSpecialization";
|
||||
labelSpecialization.Size = new Size(93, 15);
|
||||
labelSpecialization.TabIndex = 4;
|
||||
labelSpecialization.Text = "Специализация";
|
||||
//
|
||||
// buttonSave
|
||||
//
|
||||
buttonSave.Location = new Point(27, 288);
|
||||
buttonSave.Name = "buttonSave";
|
||||
buttonSave.Size = new Size(93, 29);
|
||||
buttonSave.TabIndex = 5;
|
||||
buttonSave.Text = "Сохранить";
|
||||
buttonSave.UseVisualStyleBackColor = true;
|
||||
buttonSave.Click += buttonSave_Click;
|
||||
//
|
||||
// buttonCancel
|
||||
//
|
||||
buttonCancel.Location = new Point(152, 288);
|
||||
buttonCancel.Name = "buttonCancel";
|
||||
buttonCancel.Size = new Size(93, 29);
|
||||
buttonCancel.TabIndex = 6;
|
||||
buttonCancel.Text = "Отмена";
|
||||
buttonCancel.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// textBoxFirstName
|
||||
//
|
||||
textBoxFirstName.Location = new Point(152, 31);
|
||||
textBoxFirstName.Name = "textBoxFirstName";
|
||||
textBoxFirstName.Size = new Size(121, 23);
|
||||
textBoxFirstName.TabIndex = 7;
|
||||
//
|
||||
// textBoxLastName
|
||||
//
|
||||
textBoxLastName.Location = new Point(152, 79);
|
||||
textBoxLastName.Name = "textBoxLastName";
|
||||
textBoxLastName.Size = new Size(121, 23);
|
||||
textBoxLastName.TabIndex = 8;
|
||||
//
|
||||
// comboBoxSpecialization
|
||||
//
|
||||
comboBoxSpecialization.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
comboBoxSpecialization.FormattingEnabled = true;
|
||||
comboBoxSpecialization.Location = new Point(152, 178);
|
||||
comboBoxSpecialization.Name = "comboBoxSpecialization";
|
||||
comboBoxSpecialization.Size = new Size(121, 23);
|
||||
comboBoxSpecialization.TabIndex = 10;
|
||||
//
|
||||
// comboBoxSpecializationLevel
|
||||
//
|
||||
comboBoxSpecializationLevel.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
comboBoxSpecializationLevel.FormattingEnabled = true;
|
||||
comboBoxSpecializationLevel.Location = new Point(152, 230);
|
||||
comboBoxSpecializationLevel.Name = "comboBoxSpecializationLevel";
|
||||
comboBoxSpecializationLevel.Size = new Size(121, 23);
|
||||
comboBoxSpecializationLevel.TabIndex = 11;
|
||||
//
|
||||
// numericUpDownRoom
|
||||
//
|
||||
numericUpDownRoom.Location = new Point(152, 128);
|
||||
numericUpDownRoom.Maximum = new decimal(new int[] { 1000, 0, 0, 0 });
|
||||
numericUpDownRoom.Minimum = new decimal(new int[] { 1, 0, 0, 0 });
|
||||
numericUpDownRoom.Name = "numericUpDownRoom";
|
||||
numericUpDownRoom.Size = new Size(121, 23);
|
||||
numericUpDownRoom.TabIndex = 12;
|
||||
numericUpDownRoom.Value = new decimal(new int[] { 1, 0, 0, 0 });
|
||||
//
|
||||
// FormDoctor
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(307, 337);
|
||||
Controls.Add(numericUpDownRoom);
|
||||
Controls.Add(comboBoxSpecializationLevel);
|
||||
Controls.Add(comboBoxSpecialization);
|
||||
Controls.Add(textBoxLastName);
|
||||
Controls.Add(textBoxFirstName);
|
||||
Controls.Add(buttonCancel);
|
||||
Controls.Add(buttonSave);
|
||||
Controls.Add(labelSpecialization);
|
||||
Controls.Add(labelRoom);
|
||||
Controls.Add(labelSpecializationLevel);
|
||||
Controls.Add(labelLastName);
|
||||
Controls.Add(labelFirstName);
|
||||
Name = "FormDoctor";
|
||||
StartPosition = FormStartPosition.CenterScreen;
|
||||
Text = "Врач";
|
||||
((System.ComponentModel.ISupportInitialize)numericUpDownRoom).EndInit();
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private Label labelFirstName;
|
||||
private Label labelLastName;
|
||||
private Label labelSpecializationLevel;
|
||||
private Label labelRoom;
|
||||
private Label labelSpecialization;
|
||||
private Button buttonSave;
|
||||
private Button buttonCancel;
|
||||
private TextBox textBoxFirstName;
|
||||
private TextBox textBoxLastName;
|
||||
private ComboBox comboBoxSpecialization;
|
||||
private ComboBox comboBoxSpecializationLevel;
|
||||
private NumericUpDown numericUpDownRoom;
|
||||
}
|
||||
}
|
107
ProjectPolyclinic/ProjectPolyclinic/Forms/FormDoctor.cs
Normal file
107
ProjectPolyclinic/ProjectPolyclinic/Forms/FormDoctor.cs
Normal file
@ -0,0 +1,107 @@
|
||||
using ProjectPolyclinic.Entities;
|
||||
using ProjectPolyclinic.Entities.Enums;
|
||||
using ProjectPolyclinic.Repositories;
|
||||
using ProjectPolyclinic.Repositories.Implementations;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace ProjectPolyclinic.Forms
|
||||
{
|
||||
public partial class FormDoctor : Form
|
||||
{
|
||||
public FormDoctor(IDoctorRepository doctorRepository)
|
||||
{
|
||||
|
||||
InitializeComponent();
|
||||
_doctorRepository = doctorRepository ??
|
||||
throw new ArgumentNullException(nameof(doctorRepository));
|
||||
|
||||
comboBoxSpecialization.DataSource = Enum.GetValues(typeof(Specialization));
|
||||
|
||||
comboBoxSpecializationLevel.DataSource = Enum.GetValues(typeof(SpecializationLevel));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
private readonly IDoctorRepository _doctorRepository;
|
||||
|
||||
private int? _doctorId;
|
||||
|
||||
|
||||
|
||||
public int Id
|
||||
{
|
||||
set
|
||||
{
|
||||
try
|
||||
{
|
||||
var doctor = _doctorRepository.ReadDoctorById(value);
|
||||
if (doctor == null)
|
||||
{
|
||||
throw new InvalidDataException(nameof(doctor));
|
||||
}
|
||||
textBoxFirstName.Text = doctor.First_Name;
|
||||
textBoxLastName.Text = doctor.Last_Name;
|
||||
numericUpDownRoom.Value = doctor.Room;
|
||||
comboBoxSpecialization.SelectedItem = doctor.Specialization;
|
||||
comboBoxSpecializationLevel.SelectedItem = doctor.SpecializationLevel;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при получении данных", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void buttonSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(textBoxFirstName.Text) || string.IsNullOrWhiteSpace(textBoxLastName.Text) ||
|
||||
numericUpDownRoom.Value < 1 ||
|
||||
comboBoxSpecialization.SelectedItem == null ||
|
||||
comboBoxSpecializationLevel.SelectedItem == null)
|
||||
{
|
||||
throw new Exception("Имеются незаполненные поля");
|
||||
}
|
||||
|
||||
if (_doctorId.HasValue)
|
||||
{
|
||||
_doctorRepository.UpdateDoctor(CreateDoctor(_doctorId.Value));
|
||||
}
|
||||
else
|
||||
{
|
||||
_doctorRepository.CreateDoctor(CreateDoctor(0));
|
||||
}
|
||||
|
||||
Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при сохранении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void buttonCancel_Click(object sender, EventArgs e) => Close();
|
||||
|
||||
private Doctor CreateDoctor(int id) =>
|
||||
Doctor.CreateEntity(id,
|
||||
textBoxFirstName.Text, textBoxLastName.Text,
|
||||
(int)numericUpDownRoom.Value,
|
||||
(Specialization)comboBoxSpecialization.SelectedItem!,
|
||||
(SpecializationLevel)comboBoxSpecializationLevel.SelectedItem!);
|
||||
|
||||
}
|
||||
}
|
@ -1,17 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
|
||||
Example:
|
||||
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
@ -26,36 +26,36 @@
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
162
ProjectPolyclinic/ProjectPolyclinic/Forms/FormDoctorPayment.Designer.cs
generated
Normal file
162
ProjectPolyclinic/ProjectPolyclinic/Forms/FormDoctorPayment.Designer.cs
generated
Normal file
@ -0,0 +1,162 @@
|
||||
namespace ProjectPolyclinic.Forms
|
||||
{
|
||||
partial class FormDoctorPayment
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
labelDoctor = new Label();
|
||||
buttonCancel = new Button();
|
||||
buttonSave = new Button();
|
||||
comboBoxDoctor = new ComboBox();
|
||||
groupBox = new GroupBox();
|
||||
dataGridViewPay = new DataGridView();
|
||||
ColumnMonth = new DataGridViewTextBoxColumn();
|
||||
ColumnCount = new DataGridViewTextBoxColumn();
|
||||
ColumnPayment = new DataGridViewTextBoxColumn();
|
||||
groupBox.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)dataGridViewPay).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// labelDoctor
|
||||
//
|
||||
labelDoctor.AutoSize = true;
|
||||
labelDoctor.Location = new Point(31, 32);
|
||||
labelDoctor.Name = "labelDoctor";
|
||||
labelDoctor.Size = new Size(34, 15);
|
||||
labelDoctor.TabIndex = 0;
|
||||
labelDoctor.Text = "Врач";
|
||||
//
|
||||
// buttonCancel
|
||||
//
|
||||
buttonCancel.Location = new Point(310, 396);
|
||||
buttonCancel.Name = "buttonCancel";
|
||||
buttonCancel.Size = new Size(93, 29);
|
||||
buttonCancel.TabIndex = 11;
|
||||
buttonCancel.Text = "Отмена";
|
||||
buttonCancel.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// buttonSave
|
||||
//
|
||||
buttonSave.Location = new Point(22, 396);
|
||||
buttonSave.Name = "buttonSave";
|
||||
buttonSave.Size = new Size(93, 29);
|
||||
buttonSave.TabIndex = 10;
|
||||
buttonSave.Text = "Сохранить";
|
||||
buttonSave.UseVisualStyleBackColor = true;
|
||||
buttonSave.Click += buttonSave_Click;
|
||||
//
|
||||
// comboBoxDoctor
|
||||
//
|
||||
comboBoxDoctor.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
comboBoxDoctor.FormattingEnabled = true;
|
||||
comboBoxDoctor.Location = new Point(86, 29);
|
||||
comboBoxDoctor.Name = "comboBoxDoctor";
|
||||
comboBoxDoctor.Size = new Size(121, 23);
|
||||
comboBoxDoctor.TabIndex = 12;
|
||||
//
|
||||
// groupBox
|
||||
//
|
||||
groupBox.Controls.Add(dataGridViewPay);
|
||||
groupBox.Location = new Point(22, 114);
|
||||
groupBox.Name = "groupBox";
|
||||
groupBox.Size = new Size(384, 223);
|
||||
groupBox.TabIndex = 13;
|
||||
groupBox.TabStop = false;
|
||||
groupBox.Text = "groupBox1";
|
||||
//
|
||||
// dataGridViewPay
|
||||
//
|
||||
dataGridViewPay.AllowUserToResizeColumns = false;
|
||||
dataGridViewPay.AllowUserToResizeRows = false;
|
||||
dataGridViewPay.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dataGridViewPay.Columns.AddRange(new DataGridViewColumn[] { ColumnMonth, ColumnCount, ColumnPayment });
|
||||
dataGridViewPay.Dock = DockStyle.Fill;
|
||||
dataGridViewPay.Location = new Point(3, 19);
|
||||
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
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(418, 450);
|
||||
Controls.Add(groupBox);
|
||||
Controls.Add(comboBoxDoctor);
|
||||
Controls.Add(buttonCancel);
|
||||
Controls.Add(buttonSave);
|
||||
Controls.Add(labelDoctor);
|
||||
Name = "FormDoctorPayment";
|
||||
StartPosition = FormStartPosition.CenterScreen;
|
||||
Text = "FormDoctorPayment";
|
||||
groupBox.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)dataGridViewPay).EndInit();
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private Label labelDoctor;
|
||||
private Button buttonCancel;
|
||||
private Button buttonSave;
|
||||
private ComboBox comboBoxDoctor;
|
||||
private GroupBox groupBox;
|
||||
private DataGridView dataGridViewPay;
|
||||
private DataGridViewTextBoxColumn ColumnMonth;
|
||||
private DataGridViewTextBoxColumn ColumnCount;
|
||||
private DataGridViewTextBoxColumn ColumnPayment;
|
||||
}
|
||||
}
|
@ -0,0 +1,84 @@
|
||||
using ProjectPolyclinic.Entities;
|
||||
using ProjectPolyclinic.Repositories;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace ProjectPolyclinic.Forms;
|
||||
|
||||
public partial class FormDoctorPayment : Form
|
||||
{
|
||||
|
||||
private readonly IDoctorPayRepository _doctorPayRepository;
|
||||
public FormDoctorPayment(IDoctorPayRepository doctorPayRepository, IDoctorRepository doctorRepository)
|
||||
{
|
||||
InitializeComponent();
|
||||
_doctorPayRepository = doctorPayRepository ??
|
||||
throw new ArgumentNullException(nameof(doctorPayRepository));
|
||||
|
||||
comboBoxDoctor.DataSource = doctorRepository.ReadDoctors();
|
||||
comboBoxDoctor.DisplayMember = "Firts_Name";
|
||||
comboBoxDoctor.ValueMember = "Id";
|
||||
}
|
||||
|
||||
private void buttonSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (dataGridViewPay.RowCount < 1 || comboBoxDoctor.SelectedIndex < 0)
|
||||
{
|
||||
throw new Exception("Имеются не заполненные поля");
|
||||
}
|
||||
|
||||
// Получаем значение из первой строки колонки ColumnMonth
|
||||
string month = dataGridViewPay.Rows[0].Cells["ColumnMonth"].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))
|
||||
{
|
||||
throw new Exception("Месяц не заполнен");
|
||||
}
|
||||
|
||||
// Создаем элемент DoctorPayments
|
||||
_doctorPayRepository.CreateDoctorPayments(DoctorPay.CreateElement(0, (int)comboBoxDoctor.SelectedValue!, month, countPatient, payment));
|
||||
|
||||
|
||||
|
||||
Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при сохранении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonCancel_Click(object sender, EventArgs e) => Close();
|
||||
|
||||
private List<DoctorPay> CreateListDoctorPaymentsFromDataGrid()
|
||||
{
|
||||
var list = new List<DoctorPay>();
|
||||
foreach (DataGridViewRow row in dataGridViewPay.Rows)
|
||||
{
|
||||
if (row.Cells["ColumnMonth"].Value == null || row.Cells["ColumnCount"].Value == null || row.Cells["ColumnPayment"] == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
// ДОДЕЛАТЬ!!!
|
||||
list.Add(DoctorPay.CreateElement(0, 0, row.Cells["ColumnMonth"].Value.ToString(), Convert.ToInt32(row.Cells["ColumnCount"].Value),
|
||||
Convert.ToInt32(row.Cells["ColumnPayment"].Value)));
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
129
ProjectPolyclinic/ProjectPolyclinic/Forms/FormDoctorPayment.resx
Normal file
129
ProjectPolyclinic/ProjectPolyclinic/Forms/FormDoctorPayment.resx
Normal file
@ -0,0 +1,129 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</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>
|
95
ProjectPolyclinic/ProjectPolyclinic/Forms/FormDoctorPayments.Designer.cs
generated
Normal file
95
ProjectPolyclinic/ProjectPolyclinic/Forms/FormDoctorPayments.Designer.cs
generated
Normal file
@ -0,0 +1,95 @@
|
||||
namespace ProjectPolyclinic.Forms
|
||||
{
|
||||
partial class FormDoctorPayments
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
panel1 = new Panel();
|
||||
buttonAdd = new Button();
|
||||
dataGridView = new DataGridView();
|
||||
panel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
panel1.Controls.Add(buttonAdd);
|
||||
panel1.Dock = DockStyle.Right;
|
||||
panel1.Location = new Point(661, 0);
|
||||
panel1.Name = "panel1";
|
||||
panel1.Size = new Size(139, 390);
|
||||
panel1.TabIndex = 0;
|
||||
//
|
||||
// buttonAdd
|
||||
//
|
||||
buttonAdd.BackgroundImage = Properties.Resources.buttonAdd;
|
||||
buttonAdd.BackgroundImageLayout = ImageLayout.Stretch;
|
||||
buttonAdd.Location = new Point(32, 29);
|
||||
buttonAdd.Name = "buttonAdd";
|
||||
buttonAdd.Size = new Size(75, 70);
|
||||
buttonAdd.TabIndex = 0;
|
||||
buttonAdd.UseVisualStyleBackColor = true;
|
||||
buttonAdd.Click += buttonAdd_Click;
|
||||
//
|
||||
// dataGridView
|
||||
//
|
||||
dataGridView.AllowUserToResizeColumns = false;
|
||||
dataGridView.AllowUserToResizeRows = false;
|
||||
dataGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
|
||||
dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dataGridView.Dock = DockStyle.Fill;
|
||||
dataGridView.Location = new Point(0, 0);
|
||||
dataGridView.MultiSelect = false;
|
||||
dataGridView.Name = "dataGridView";
|
||||
dataGridView.RowHeadersVisible = false;
|
||||
dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dataGridView.Size = new Size(661, 390);
|
||||
dataGridView.TabIndex = 1;
|
||||
//
|
||||
// FormDoctorPayments
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(800, 390);
|
||||
Controls.Add(dataGridView);
|
||||
Controls.Add(panel1);
|
||||
Name = "FormDoctorPayments";
|
||||
StartPosition = FormStartPosition.CenterScreen;
|
||||
Text = " ";
|
||||
Load += FormDoctorPayments_Load;
|
||||
panel1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private Panel panel1;
|
||||
private Button buttonAdd;
|
||||
private DataGridView dataGridView;
|
||||
}
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
using ProjectPolyclinic.Repositories;
|
||||
using ProjectPolyclinic.Repositories.Implementations;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Unity;
|
||||
|
||||
namespace ProjectPolyclinic.Forms;
|
||||
|
||||
|
||||
|
||||
public partial class FormDoctorPayments : Form
|
||||
{
|
||||
|
||||
|
||||
private readonly IDoctorPayRepository _doctorPayRepository;
|
||||
|
||||
private readonly IUnityContainer _container;
|
||||
|
||||
|
||||
public FormDoctorPayments(IUnityContainer container, IDoctorPayRepository doctorPayRepository)
|
||||
{
|
||||
InitializeComponent();
|
||||
_container = container ??
|
||||
throw new ArgumentNullException(nameof(container));
|
||||
_doctorPayRepository = doctorPayRepository ??
|
||||
throw new ArgumentNullException(nameof(doctorPayRepository));
|
||||
}
|
||||
|
||||
|
||||
private void FormDoctorPayments_Load(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
LoadList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void LoadList() => dataGridView.DataSource = _doctorPayRepository.ReadDoctorPayments();
|
||||
|
||||
|
||||
|
||||
private void buttonAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
_container.Resolve<FormDoctorPayment>().ShowDialog();
|
||||
LoadList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
123
ProjectPolyclinic/ProjectPolyclinic/Forms/FormDoctors.Designer.cs
generated
Normal file
123
ProjectPolyclinic/ProjectPolyclinic/Forms/FormDoctors.Designer.cs
generated
Normal file
@ -0,0 +1,123 @@
|
||||
namespace ProjectPolyclinic.Forms
|
||||
{
|
||||
partial class FormDoctors
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
panel1 = new Panel();
|
||||
buttonUpdate = new Button();
|
||||
buttonDel = new Button();
|
||||
buttonAdd = new Button();
|
||||
dataGridView = new DataGridView();
|
||||
panel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
panel1.Controls.Add(buttonUpdate);
|
||||
panel1.Controls.Add(buttonDel);
|
||||
panel1.Controls.Add(buttonAdd);
|
||||
panel1.Dock = DockStyle.Right;
|
||||
panel1.Location = new Point(661, 0);
|
||||
panel1.Name = "panel1";
|
||||
panel1.Size = new Size(139, 373);
|
||||
panel1.TabIndex = 0;
|
||||
//
|
||||
// buttonUpdate
|
||||
//
|
||||
buttonUpdate.BackgroundImage = Properties.Resources.buttonUpdate;
|
||||
buttonUpdate.BackgroundImageLayout = ImageLayout.Stretch;
|
||||
buttonUpdate.Location = new Point(32, 241);
|
||||
buttonUpdate.Name = "buttonUpdate";
|
||||
buttonUpdate.Size = new Size(75, 70);
|
||||
buttonUpdate.TabIndex = 2;
|
||||
buttonUpdate.UseVisualStyleBackColor = true;
|
||||
buttonUpdate.Click += buttonUpdate_Click;
|
||||
//
|
||||
// buttonDel
|
||||
//
|
||||
buttonDel.BackgroundImage = Properties.Resources.buttonDel;
|
||||
buttonDel.BackgroundImageLayout = ImageLayout.Stretch;
|
||||
buttonDel.Location = new Point(32, 134);
|
||||
buttonDel.Name = "buttonDel";
|
||||
buttonDel.Size = new Size(75, 70);
|
||||
buttonDel.TabIndex = 1;
|
||||
buttonDel.UseVisualStyleBackColor = true;
|
||||
buttonDel.Click += buttonDel_Click;
|
||||
//
|
||||
// buttonAdd
|
||||
//
|
||||
buttonAdd.BackgroundImage = Properties.Resources.buttonAdd;
|
||||
buttonAdd.BackgroundImageLayout = ImageLayout.Stretch;
|
||||
buttonAdd.Location = new Point(32, 29);
|
||||
buttonAdd.Name = "buttonAdd";
|
||||
buttonAdd.Size = new Size(75, 70);
|
||||
buttonAdd.TabIndex = 0;
|
||||
buttonAdd.UseVisualStyleBackColor = true;
|
||||
buttonAdd.Click += buttonAdd_Click;
|
||||
//
|
||||
// dataGridView
|
||||
//
|
||||
dataGridView.AllowUserToResizeColumns = false;
|
||||
dataGridView.AllowUserToResizeRows = false;
|
||||
dataGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
|
||||
dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dataGridView.Dock = DockStyle.Fill;
|
||||
dataGridView.Location = new Point(0, 0);
|
||||
dataGridView.MultiSelect = false;
|
||||
dataGridView.Name = "dataGridView";
|
||||
dataGridView.RowHeadersVisible = false;
|
||||
dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dataGridView.Size = new Size(661, 373);
|
||||
dataGridView.TabIndex = 1;
|
||||
//
|
||||
// FormDoctors
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(800, 373);
|
||||
Controls.Add(dataGridView);
|
||||
Controls.Add(panel1);
|
||||
Name = "FormDoctors";
|
||||
StartPosition = FormStartPosition.CenterScreen;
|
||||
Text = "Врачи";
|
||||
Load += FormDoctors_Load;
|
||||
panel1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private Panel panel1;
|
||||
private Button buttonUpdate;
|
||||
private Button buttonDel;
|
||||
private Button buttonAdd;
|
||||
private DataGridView dataGridView;
|
||||
}
|
||||
}
|
123
ProjectPolyclinic/ProjectPolyclinic/Forms/FormDoctors.cs
Normal file
123
ProjectPolyclinic/ProjectPolyclinic/Forms/FormDoctors.cs
Normal file
@ -0,0 +1,123 @@
|
||||
using ProjectPolyclinic.Repositories;
|
||||
using ProjectPolyclinic.Repositories.Implementations;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Unity;
|
||||
|
||||
namespace ProjectPolyclinic.Forms;
|
||||
|
||||
|
||||
|
||||
public partial class FormDoctors : Form
|
||||
{
|
||||
|
||||
|
||||
private readonly IUnityContainer _container;
|
||||
|
||||
private readonly IDoctorRepository _doctorRepository;
|
||||
|
||||
|
||||
|
||||
|
||||
public FormDoctors(IUnityContainer container, IDoctorRepository doctorRepository)
|
||||
{
|
||||
InitializeComponent();
|
||||
_container = container ??
|
||||
throw new ArgumentNullException(nameof(container));
|
||||
_doctorRepository = doctorRepository ??
|
||||
throw new ArgumentNullException(nameof(doctorRepository));
|
||||
}
|
||||
|
||||
|
||||
private void FormDoctors_Load(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
LoadList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadList() => dataGridView.DataSource = _doctorRepository.ReadDoctors();
|
||||
|
||||
|
||||
private bool TryGetIdentifierFromSelectedRow(out int id)
|
||||
{
|
||||
id = 0;
|
||||
if (dataGridView.SelectedRows.Count < 1)
|
||||
{
|
||||
MessageBox.Show("Нет выбранной записи", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return false;
|
||||
}
|
||||
id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["id"].Value);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private void buttonAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
_container.Resolve<FormDoctor>().ShowDialog();
|
||||
LoadList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при добавлении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonDel_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!TryGetIdentifierFromSelectedRow(out var findId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (MessageBox.Show("Удалить запись?", "Удаление", MessageBoxButtons.YesNo) != DialogResult.Yes)
|
||||
{
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
_doctorRepository.DeleteDoctor(findId);
|
||||
LoadList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при удалении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonUpdate_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!TryGetIdentifierFromSelectedRow(out var findId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var form = _container.Resolve<FormDoctor>();
|
||||
form.Id = findId;
|
||||
form.ShowDialog();
|
||||
LoadList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при изменении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
}
|
120
ProjectPolyclinic/ProjectPolyclinic/Forms/FormDoctors.resx
Normal file
120
ProjectPolyclinic/ProjectPolyclinic/Forms/FormDoctors.resx
Normal file
@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
140
ProjectPolyclinic/ProjectPolyclinic/Forms/FormDrug.Designer.cs
generated
Normal file
140
ProjectPolyclinic/ProjectPolyclinic/Forms/FormDrug.Designer.cs
generated
Normal file
@ -0,0 +1,140 @@
|
||||
namespace ProjectPolyclinic.Forms
|
||||
{
|
||||
partial class FormDrug
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
buttonCancel = new Button();
|
||||
buttonSave = new Button();
|
||||
labelName = new Label();
|
||||
labelGrams = new Label();
|
||||
labelDescription = new Label();
|
||||
checkedListBoxName = new CheckedListBox();
|
||||
textBoxGrams = new TextBox();
|
||||
textBoxDescription = new TextBox();
|
||||
SuspendLayout();
|
||||
//
|
||||
// buttonCancel
|
||||
//
|
||||
buttonCancel.Location = new Point(177, 302);
|
||||
buttonCancel.Name = "buttonCancel";
|
||||
buttonCancel.Size = new Size(93, 29);
|
||||
buttonCancel.TabIndex = 8;
|
||||
buttonCancel.Text = "Отмена";
|
||||
buttonCancel.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// buttonSave
|
||||
//
|
||||
buttonSave.Location = new Point(38, 302);
|
||||
buttonSave.Name = "buttonSave";
|
||||
buttonSave.Size = new Size(93, 29);
|
||||
buttonSave.TabIndex = 7;
|
||||
buttonSave.Text = "Сохранить";
|
||||
buttonSave.UseVisualStyleBackColor = true;
|
||||
buttonSave.Click += buttonSave_Click;
|
||||
//
|
||||
// labelName
|
||||
//
|
||||
labelName.AutoSize = true;
|
||||
labelName.Location = new Point(38, 44);
|
||||
labelName.Name = "labelName";
|
||||
labelName.Size = new Size(59, 15);
|
||||
labelName.TabIndex = 9;
|
||||
labelName.Text = "Название";
|
||||
//
|
||||
// labelGrams
|
||||
//
|
||||
labelGrams.AutoSize = true;
|
||||
labelGrams.Location = new Point(38, 188);
|
||||
labelGrams.Name = "labelGrams";
|
||||
labelGrams.Size = new Size(60, 15);
|
||||
labelGrams.TabIndex = 10;
|
||||
labelGrams.Text = "Грамовка";
|
||||
//
|
||||
// labelDescription
|
||||
//
|
||||
labelDescription.AutoSize = true;
|
||||
labelDescription.Location = new Point(38, 236);
|
||||
labelDescription.Name = "labelDescription";
|
||||
labelDescription.Size = new Size(45, 15);
|
||||
labelDescription.TabIndex = 11;
|
||||
labelDescription.Text = "Рецепт";
|
||||
//
|
||||
// checkedListBoxName
|
||||
//
|
||||
checkedListBoxName.FormattingEnabled = true;
|
||||
checkedListBoxName.Location = new Point(136, 44);
|
||||
checkedListBoxName.Name = "checkedListBoxName";
|
||||
checkedListBoxName.Size = new Size(161, 94);
|
||||
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.Name = "textBoxDescription";
|
||||
textBoxDescription.Size = new Size(161, 23);
|
||||
textBoxDescription.TabIndex = 14;
|
||||
//
|
||||
// FormDrug
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(309, 357);
|
||||
Controls.Add(textBoxDescription);
|
||||
Controls.Add(textBoxGrams);
|
||||
Controls.Add(checkedListBoxName);
|
||||
Controls.Add(labelDescription);
|
||||
Controls.Add(labelGrams);
|
||||
Controls.Add(labelName);
|
||||
Controls.Add(buttonCancel);
|
||||
Controls.Add(buttonSave);
|
||||
Name = "FormDrug";
|
||||
StartPosition = FormStartPosition.CenterScreen;
|
||||
Text = "FormDrug";
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private Button buttonCancel;
|
||||
private Button buttonSave;
|
||||
private Label labelName;
|
||||
private Label labelGrams;
|
||||
private Label labelDescription;
|
||||
private CheckedListBox checkedListBoxName;
|
||||
private TextBox textBoxGrams;
|
||||
private TextBox textBoxDescription;
|
||||
}
|
||||
}
|
112
ProjectPolyclinic/ProjectPolyclinic/Forms/FormDrug.cs
Normal file
112
ProjectPolyclinic/ProjectPolyclinic/Forms/FormDrug.cs
Normal file
@ -0,0 +1,112 @@
|
||||
using ProjectPolyclinic.Entities.Enums;
|
||||
using ProjectPolyclinic.Entities;
|
||||
using ProjectPolyclinic.Repositories;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace ProjectPolyclinic.Forms;
|
||||
|
||||
public partial class FormDrug : Form
|
||||
{
|
||||
|
||||
private readonly IDrugRepository _drugRepository;
|
||||
|
||||
private int? _dragId;
|
||||
|
||||
|
||||
public int Id
|
||||
{
|
||||
set
|
||||
{
|
||||
try
|
||||
{
|
||||
var drag = _drugRepository.ReadDrugById(value);
|
||||
if (drag == null)
|
||||
{
|
||||
throw new InvalidDataException(nameof(drag));
|
||||
}
|
||||
foreach (DrugsNames elem in Enum.GetValues(typeof(DrugsNames)))
|
||||
{
|
||||
if ((elem & drag.drugsNames) != 0)
|
||||
{
|
||||
checkedListBoxName.SetItemChecked(checkedListBoxName.Items.IndexOf(elem), true);
|
||||
}
|
||||
}
|
||||
textBoxGrams.Text = drag.Grams.ToString();
|
||||
textBoxDescription.Text = drag.Description;
|
||||
_dragId = value;
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при получении данных", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public FormDrug(IDrugRepository drugRepository)
|
||||
{
|
||||
InitializeComponent();
|
||||
_drugRepository = drugRepository ??
|
||||
throw new ArgumentNullException(nameof(drugRepository));
|
||||
// вытаскиваем все значения
|
||||
foreach (var elem in Enum.GetValues(typeof(DrugsNames)))
|
||||
{
|
||||
checkedListBoxName.Items.Add(elem); // заполняем поэлементно значения
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void buttonSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(textBoxGrams.Text) || string.IsNullOrWhiteSpace(textBoxDescription.Text) ||
|
||||
checkedListBoxName.CheckedItems.Count == 0)
|
||||
{
|
||||
throw new Exception("Имеется незаполненные поля");
|
||||
}
|
||||
|
||||
if (_dragId.HasValue)
|
||||
{
|
||||
_drugRepository.UpdateDrug(CreateDrag(_dragId.Value));
|
||||
}
|
||||
else
|
||||
{
|
||||
_drugRepository.CreateDrug(CreateDrag(0));
|
||||
}
|
||||
|
||||
Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при сохранении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonCancel_Click(object sender, EventArgs e) => Close();
|
||||
|
||||
|
||||
private Drug CreateDrag(int id)
|
||||
{
|
||||
DrugsNames drugName = DrugsNames.None;
|
||||
|
||||
foreach (var elem in checkedListBoxName.CheckedItems)
|
||||
{
|
||||
drugName |= (DrugsNames)elem;
|
||||
}
|
||||
|
||||
return Drug.CreateElement(id, drugName, Convert.ToInt32(textBoxGrams.Text), textBoxDescription.Text);
|
||||
}
|
||||
|
||||
|
||||
}
|
120
ProjectPolyclinic/ProjectPolyclinic/Forms/FormDrug.resx
Normal file
120
ProjectPolyclinic/ProjectPolyclinic/Forms/FormDrug.resx
Normal file
@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
123
ProjectPolyclinic/ProjectPolyclinic/Forms/FormDrugs.Designer.cs
generated
Normal file
123
ProjectPolyclinic/ProjectPolyclinic/Forms/FormDrugs.Designer.cs
generated
Normal file
@ -0,0 +1,123 @@
|
||||
namespace ProjectPolyclinic.Forms
|
||||
{
|
||||
partial class FormDrugs
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
panel1 = new Panel();
|
||||
buttonUpdate = new Button();
|
||||
buttonDel = new Button();
|
||||
buttonAdd = new Button();
|
||||
dataGridView = new DataGridView();
|
||||
panel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
panel1.Controls.Add(buttonUpdate);
|
||||
panel1.Controls.Add(buttonDel);
|
||||
panel1.Controls.Add(buttonAdd);
|
||||
panel1.Dock = DockStyle.Right;
|
||||
panel1.Location = new Point(661, 0);
|
||||
panel1.Name = "panel1";
|
||||
panel1.Size = new Size(139, 390);
|
||||
panel1.TabIndex = 0;
|
||||
//
|
||||
// buttonUpdate
|
||||
//
|
||||
buttonUpdate.BackgroundImage = Properties.Resources.buttonUpdate;
|
||||
buttonUpdate.BackgroundImageLayout = ImageLayout.Stretch;
|
||||
buttonUpdate.Location = new Point(32, 241);
|
||||
buttonUpdate.Name = "buttonUpdate";
|
||||
buttonUpdate.Size = new Size(75, 70);
|
||||
buttonUpdate.TabIndex = 2;
|
||||
buttonUpdate.UseVisualStyleBackColor = true;
|
||||
buttonUpdate.Click += buttonUpdate_Click;
|
||||
//
|
||||
// buttonDel
|
||||
//
|
||||
buttonDel.BackgroundImage = Properties.Resources.buttonDel;
|
||||
buttonDel.BackgroundImageLayout = ImageLayout.Stretch;
|
||||
buttonDel.Location = new Point(32, 134);
|
||||
buttonDel.Name = "buttonDel";
|
||||
buttonDel.Size = new Size(75, 70);
|
||||
buttonDel.TabIndex = 1;
|
||||
buttonDel.UseVisualStyleBackColor = true;
|
||||
buttonDel.Click += buttonDel_Click;
|
||||
//
|
||||
// buttonAdd
|
||||
//
|
||||
buttonAdd.BackgroundImage = Properties.Resources.buttonAdd;
|
||||
buttonAdd.BackgroundImageLayout = ImageLayout.Stretch;
|
||||
buttonAdd.Location = new Point(32, 29);
|
||||
buttonAdd.Name = "buttonAdd";
|
||||
buttonAdd.Size = new Size(75, 70);
|
||||
buttonAdd.TabIndex = 0;
|
||||
buttonAdd.UseVisualStyleBackColor = true;
|
||||
buttonAdd.Click += buttonAdd_Click;
|
||||
//
|
||||
// dataGridView
|
||||
//
|
||||
dataGridView.AllowUserToResizeColumns = false;
|
||||
dataGridView.AllowUserToResizeRows = false;
|
||||
dataGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
|
||||
dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dataGridView.Dock = DockStyle.Fill;
|
||||
dataGridView.Location = new Point(0, 0);
|
||||
dataGridView.MultiSelect = false;
|
||||
dataGridView.Name = "dataGridView";
|
||||
dataGridView.RowHeadersVisible = false;
|
||||
dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dataGridView.Size = new Size(661, 390);
|
||||
dataGridView.TabIndex = 1;
|
||||
//
|
||||
// FormDrugs
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(800, 390);
|
||||
Controls.Add(dataGridView);
|
||||
Controls.Add(panel1);
|
||||
Name = "FormDrugs";
|
||||
StartPosition = FormStartPosition.CenterScreen;
|
||||
Text = " ";
|
||||
Load += FormDrugs_Load;
|
||||
panel1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private Panel panel1;
|
||||
private Button buttonUpdate;
|
||||
private Button buttonDel;
|
||||
private Button buttonAdd;
|
||||
private DataGridView dataGridView;
|
||||
}
|
||||
}
|
123
ProjectPolyclinic/ProjectPolyclinic/Forms/FormDrugs.cs
Normal file
123
ProjectPolyclinic/ProjectPolyclinic/Forms/FormDrugs.cs
Normal file
@ -0,0 +1,123 @@
|
||||
using ProjectPolyclinic.Repositories;
|
||||
using ProjectPolyclinic.Repositories.Implementations;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Unity;
|
||||
|
||||
namespace ProjectPolyclinic.Forms;
|
||||
|
||||
|
||||
|
||||
public partial class FormDrugs : Form
|
||||
{
|
||||
|
||||
private readonly IUnityContainer _container;
|
||||
|
||||
private readonly IDrugRepository _dragRepository;
|
||||
|
||||
|
||||
|
||||
public FormDrugs(IUnityContainer container, IDrugRepository dragRepository)
|
||||
{
|
||||
InitializeComponent();
|
||||
_container = container ??
|
||||
throw new ArgumentNullException(nameof(container));
|
||||
_dragRepository = dragRepository ??
|
||||
throw new ArgumentNullException(nameof(dragRepository));
|
||||
}
|
||||
|
||||
|
||||
private void FormDrugs_Load(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
LoadList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void LoadList() => dataGridView.DataSource = _dragRepository.ReadDrug();
|
||||
|
||||
|
||||
|
||||
private void buttonAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
_container.Resolve<FormDrug>().ShowDialog();
|
||||
LoadList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при добавлении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonDel_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!TryGetIdentifierFromSelectedRow(out var findId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (MessageBox.Show("Удалить запись?", "Удаление", MessageBoxButtons.YesNo) != DialogResult.Yes)
|
||||
{
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
_dragRepository.DeleteDrug(findId);
|
||||
LoadList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при удалении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonUpdate_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!TryGetIdentifierFromSelectedRow(out var findId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var form = _container.Resolve<FormDoctor>();
|
||||
form.Id = findId;
|
||||
form.ShowDialog();
|
||||
LoadList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при изменении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private bool TryGetIdentifierFromSelectedRow(out int id)
|
||||
{
|
||||
id = 0;
|
||||
if (dataGridView.SelectedRows.Count < 1)
|
||||
{
|
||||
MessageBox.Show("Нет выбранной записи", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return false;
|
||||
}
|
||||
id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["id"].Value);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
120
ProjectPolyclinic/ProjectPolyclinic/Forms/FormDrugs.resx
Normal file
120
ProjectPolyclinic/ProjectPolyclinic/Forms/FormDrugs.resx
Normal file
@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
109
ProjectPolyclinic/ProjectPolyclinic/Forms/FormMedicalHistories.Designer.cs
generated
Normal file
109
ProjectPolyclinic/ProjectPolyclinic/Forms/FormMedicalHistories.Designer.cs
generated
Normal file
@ -0,0 +1,109 @@
|
||||
namespace ProjectPolyclinic.Forms
|
||||
{
|
||||
partial class FormMedicalHistories
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
panel1 = new Panel();
|
||||
buttonDel = new Button();
|
||||
buttonAdd = new Button();
|
||||
dataGridView = new DataGridView();
|
||||
panel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
panel1.Controls.Add(buttonDel);
|
||||
panel1.Controls.Add(buttonAdd);
|
||||
panel1.Dock = DockStyle.Right;
|
||||
panel1.Location = new Point(661, 0);
|
||||
panel1.Name = "panel1";
|
||||
panel1.Size = new Size(139, 390);
|
||||
panel1.TabIndex = 0;
|
||||
//
|
||||
// buttonDel
|
||||
//
|
||||
buttonDel.BackgroundImage = Properties.Resources.buttonDel;
|
||||
buttonDel.BackgroundImageLayout = ImageLayout.Stretch;
|
||||
buttonDel.Location = new Point(32, 134);
|
||||
buttonDel.Name = "buttonDel";
|
||||
buttonDel.Size = new Size(75, 70);
|
||||
buttonDel.TabIndex = 1;
|
||||
buttonDel.UseVisualStyleBackColor = true;
|
||||
buttonDel.Click += buttonDel_Click;
|
||||
//
|
||||
// buttonAdd
|
||||
//
|
||||
buttonAdd.BackgroundImage = Properties.Resources.buttonAdd;
|
||||
buttonAdd.BackgroundImageLayout = ImageLayout.Stretch;
|
||||
buttonAdd.Location = new Point(32, 29);
|
||||
buttonAdd.Name = "buttonAdd";
|
||||
buttonAdd.Size = new Size(75, 70);
|
||||
buttonAdd.TabIndex = 0;
|
||||
buttonAdd.UseVisualStyleBackColor = true;
|
||||
buttonAdd.Click += buttonAdd_Click;
|
||||
//
|
||||
// dataGridView
|
||||
//
|
||||
dataGridView.AllowUserToResizeColumns = false;
|
||||
dataGridView.AllowUserToResizeRows = false;
|
||||
dataGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
|
||||
dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dataGridView.Dock = DockStyle.Fill;
|
||||
dataGridView.Location = new Point(0, 0);
|
||||
dataGridView.MultiSelect = false;
|
||||
dataGridView.Name = "dataGridView";
|
||||
dataGridView.RowHeadersVisible = false;
|
||||
dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dataGridView.Size = new Size(661, 390);
|
||||
dataGridView.TabIndex = 1;
|
||||
//
|
||||
// FormMedicalHistories
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(800, 390);
|
||||
Controls.Add(dataGridView);
|
||||
Controls.Add(panel1);
|
||||
Name = "FormMedicalHistories";
|
||||
StartPosition = FormStartPosition.CenterScreen;
|
||||
Text = " ";
|
||||
Load += FormMedicalHistories_Load;
|
||||
panel1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private Panel panel1;
|
||||
private Button buttonDel;
|
||||
private Button buttonAdd;
|
||||
private DataGridView dataGridView;
|
||||
}
|
||||
}
|
@ -0,0 +1,122 @@
|
||||
using ProjectPolyclinic.Repositories;
|
||||
using ProjectPolyclinic.Repositories.Implementations;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Unity;
|
||||
|
||||
namespace ProjectPolyclinic.Forms;
|
||||
|
||||
|
||||
|
||||
public partial class FormMedicalHistories : Form
|
||||
{
|
||||
|
||||
|
||||
private readonly IMedicalHistoryRepository _medicalHistoryRepository;
|
||||
|
||||
private readonly IUnityContainer _container;
|
||||
|
||||
|
||||
|
||||
public FormMedicalHistories(IUnityContainer container, IMedicalHistoryRepository medicalHistoryRepository)
|
||||
{
|
||||
InitializeComponent();
|
||||
_container = container ??
|
||||
throw new ArgumentNullException(nameof(container));
|
||||
_medicalHistoryRepository = medicalHistoryRepository ??
|
||||
throw new ArgumentNullException(nameof(medicalHistoryRepository));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private void FormMedicalHistories_Load(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
LoadList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void LoadList() => dataGridView.DataSource = _medicalHistoryRepository.ReadMedicalHistory();
|
||||
|
||||
|
||||
private void buttonAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
//try
|
||||
//{
|
||||
// _container.Resolve<FormMedicalHistory>().ShowDialog();
|
||||
// LoadList();
|
||||
//}
|
||||
//catch (Exception ex)
|
||||
//{
|
||||
// MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
//}
|
||||
|
||||
try
|
||||
{
|
||||
_container.Resolve<FormMedicalHistory>().ShowDialog();
|
||||
LoadList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void buttonDel_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!TryGetIdentifierFromSelectedRow(out var findId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (MessageBox.Show("Удалить запись?", "Удаление",
|
||||
MessageBoxButtons.YesNo) != DialogResult.Yes)
|
||||
{
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
_medicalHistoryRepository.DeletemedicalHistory(findId);
|
||||
LoadList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при удалении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private bool TryGetIdentifierFromSelectedRow(out int id)
|
||||
{
|
||||
id = 0;
|
||||
if (dataGridView.SelectedRows.Count < 1)
|
||||
{
|
||||
MessageBox.Show("Нет выбранной записи", "Ошибка",
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return false;
|
||||
}
|
||||
id =
|
||||
Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
196
ProjectPolyclinic/ProjectPolyclinic/Forms/FormMedicalHistory.Designer.cs
generated
Normal file
196
ProjectPolyclinic/ProjectPolyclinic/Forms/FormMedicalHistory.Designer.cs
generated
Normal file
@ -0,0 +1,196 @@
|
||||
namespace ProjectPolyclinic.Forms
|
||||
{
|
||||
partial class FormMedicalHistory
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
labelPacientName = new Label();
|
||||
labelDoctorName = new Label();
|
||||
comboBoxPacient = new ComboBox();
|
||||
comboBoxDoctor = new ComboBox();
|
||||
groupBox = new GroupBox();
|
||||
dataGridView = new DataGridView();
|
||||
ColumnDrug = new DataGridViewComboBoxColumn();
|
||||
DrugCount = new DataGridViewTextBoxColumn();
|
||||
label = new Label();
|
||||
comboBoxStatus = new ComboBox();
|
||||
buttonCancel = new Button();
|
||||
buttonSave = new Button();
|
||||
groupBox.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// labelPacientName
|
||||
//
|
||||
labelPacientName.AutoSize = true;
|
||||
labelPacientName.Location = new Point(30, 36);
|
||||
labelPacientName.Name = "labelPacientName";
|
||||
labelPacientName.Size = new Size(54, 15);
|
||||
labelPacientName.TabIndex = 0;
|
||||
labelPacientName.Text = "Пациент";
|
||||
//
|
||||
// labelDoctorName
|
||||
//
|
||||
labelDoctorName.AutoSize = true;
|
||||
labelDoctorName.Location = new Point(30, 88);
|
||||
labelDoctorName.Name = "labelDoctorName";
|
||||
labelDoctorName.Size = new Size(47, 15);
|
||||
labelDoctorName.TabIndex = 1;
|
||||
labelDoctorName.Text = "Доктор";
|
||||
//
|
||||
// comboBoxPacient
|
||||
//
|
||||
comboBoxPacient.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
comboBoxPacient.FormattingEnabled = true;
|
||||
comboBoxPacient.Location = new Point(129, 33);
|
||||
comboBoxPacient.Name = "comboBoxPacient";
|
||||
comboBoxPacient.Size = new Size(133, 23);
|
||||
comboBoxPacient.TabIndex = 2;
|
||||
//
|
||||
// comboBoxDoctor
|
||||
//
|
||||
comboBoxDoctor.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
comboBoxDoctor.FormattingEnabled = true;
|
||||
comboBoxDoctor.Location = new Point(129, 85);
|
||||
comboBoxDoctor.Name = "comboBoxDoctor";
|
||||
comboBoxDoctor.Size = new Size(133, 23);
|
||||
comboBoxDoctor.TabIndex = 3;
|
||||
//
|
||||
// groupBox
|
||||
//
|
||||
groupBox.Controls.Add(dataGridView);
|
||||
groupBox.Location = new Point(30, 175);
|
||||
groupBox.Name = "groupBox";
|
||||
groupBox.Size = new Size(235, 247);
|
||||
groupBox.TabIndex = 4;
|
||||
groupBox.TabStop = false;
|
||||
groupBox.Text = "groupBox";
|
||||
//
|
||||
// dataGridView
|
||||
//
|
||||
dataGridView.AllowUserToResizeColumns = false;
|
||||
dataGridView.AllowUserToResizeRows = false;
|
||||
dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dataGridView.Columns.AddRange(new DataGridViewColumn[] { ColumnDrug, DrugCount });
|
||||
dataGridView.Dock = DockStyle.Fill;
|
||||
dataGridView.Location = new Point(3, 19);
|
||||
dataGridView.MultiSelect = false;
|
||||
dataGridView.Name = "dataGridView";
|
||||
dataGridView.RowHeadersVisible = false;
|
||||
dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dataGridView.Size = new Size(229, 225);
|
||||
dataGridView.TabIndex = 0;
|
||||
//
|
||||
// ColumnDrug
|
||||
//
|
||||
ColumnDrug.HeaderText = "Лекарство";
|
||||
ColumnDrug.MinimumWidth = 6;
|
||||
ColumnDrug.Name = "ColumnDrug";
|
||||
ColumnDrug.Width = 125;
|
||||
//
|
||||
// DrugCount
|
||||
//
|
||||
DrugCount.HeaderText = "Количество";
|
||||
DrugCount.Name = "DrugCount";
|
||||
//
|
||||
// label
|
||||
//
|
||||
label.AutoSize = true;
|
||||
label.Location = new Point(30, 139);
|
||||
label.Name = "label";
|
||||
label.Size = new Size(43, 15);
|
||||
label.TabIndex = 5;
|
||||
label.Text = "Статус";
|
||||
//
|
||||
// comboBoxStatus
|
||||
//
|
||||
comboBoxStatus.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
comboBoxStatus.FormattingEnabled = true;
|
||||
comboBoxStatus.Location = new Point(129, 136);
|
||||
comboBoxStatus.Name = "comboBoxStatus";
|
||||
comboBoxStatus.Size = new Size(133, 23);
|
||||
comboBoxStatus.TabIndex = 6;
|
||||
comboBoxStatus.SelectedIndexChanged += comboBoxStatus_SelectedIndexChanged;
|
||||
//
|
||||
// buttonCancel
|
||||
//
|
||||
buttonCancel.Location = new Point(169, 519);
|
||||
buttonCancel.Name = "buttonCancel";
|
||||
buttonCancel.Size = new Size(93, 29);
|
||||
buttonCancel.TabIndex = 10;
|
||||
buttonCancel.Text = "Отмена";
|
||||
buttonCancel.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// buttonSave
|
||||
//
|
||||
buttonSave.Location = new Point(30, 519);
|
||||
buttonSave.Name = "buttonSave";
|
||||
buttonSave.Size = new Size(93, 29);
|
||||
buttonSave.TabIndex = 9;
|
||||
buttonSave.Text = "Сохранить";
|
||||
buttonSave.UseVisualStyleBackColor = true;
|
||||
buttonSave.Click += buttonSave_Click;
|
||||
//
|
||||
// FormMedicalHistory
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(296, 574);
|
||||
Controls.Add(buttonCancel);
|
||||
Controls.Add(buttonSave);
|
||||
Controls.Add(comboBoxStatus);
|
||||
Controls.Add(label);
|
||||
Controls.Add(groupBox);
|
||||
Controls.Add(comboBoxDoctor);
|
||||
Controls.Add(comboBoxPacient);
|
||||
Controls.Add(labelDoctorName);
|
||||
Controls.Add(labelPacientName);
|
||||
Name = "FormMedicalHistory";
|
||||
StartPosition = FormStartPosition.CenterScreen;
|
||||
Text = "FormMedicalHistory";
|
||||
groupBox.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private Label labelPacientName;
|
||||
private Label labelDoctorName;
|
||||
private ComboBox comboBoxPacient;
|
||||
private ComboBox comboBoxDoctor;
|
||||
private GroupBox groupBox;
|
||||
private DataGridView dataGridView;
|
||||
private Label label;
|
||||
private ComboBox comboBoxStatus;
|
||||
private Button buttonCancel;
|
||||
private Button buttonSave;
|
||||
private DataGridViewComboBoxColumn ColumnDrug;
|
||||
private DataGridViewTextBoxColumn DrugCount;
|
||||
}
|
||||
}
|
103
ProjectPolyclinic/ProjectPolyclinic/Forms/FormMedicalHistory.cs
Normal file
103
ProjectPolyclinic/ProjectPolyclinic/Forms/FormMedicalHistory.cs
Normal file
@ -0,0 +1,103 @@
|
||||
using ProjectPolyclinic.Entities;
|
||||
using ProjectPolyclinic.Entities.Enums;
|
||||
using ProjectPolyclinic.Repositories;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using System.Windows.Forms.VisualStyles;
|
||||
|
||||
namespace ProjectPolyclinic.Forms;
|
||||
|
||||
public partial class FormMedicalHistory : Form
|
||||
{
|
||||
|
||||
private readonly IMedicalHistoryRepository _medicalHistoryRepository;
|
||||
|
||||
public FormMedicalHistory(
|
||||
IMedicalHistoryRepository medicalHistoryRepository,
|
||||
IPatientRepository patientRepository,
|
||||
IDoctorRepository doctorRepository,
|
||||
IDrugRepository drugRepository)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
comboBoxStatus.DataSource = Enum.GetValues(typeof(Status));
|
||||
|
||||
_medicalHistoryRepository = medicalHistoryRepository ??
|
||||
throw new ArgumentNullException(nameof(medicalHistoryRepository));
|
||||
|
||||
// Настройка ComboBox
|
||||
comboBoxPacient.DataSource = patientRepository.ReadPatient();
|
||||
comboBoxPacient.DisplayMember = "First_Name";
|
||||
comboBoxPacient.ValueMember = "Id";
|
||||
|
||||
comboBoxDoctor.DataSource = doctorRepository.ReadDoctors();
|
||||
comboBoxDoctor.DisplayMember = "First_Name";
|
||||
comboBoxDoctor.ValueMember = "Id";
|
||||
|
||||
ColumnDrug.DataSource = drugRepository.ReadDrug();
|
||||
ColumnDrug.DisplayMember = "DrugsNames";
|
||||
ColumnDrug.ValueMember = "Id";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private void buttonSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (dataGridView.RowCount < 1 || comboBoxPacient.SelectedIndex < 0 || comboBoxStatus.SelectedIndex < 0)
|
||||
{
|
||||
throw new Exception("Имеются незаполненные поля.");
|
||||
}
|
||||
|
||||
var medicalHistory = MedicalHistory.CreateEntity(
|
||||
0,
|
||||
(int)comboBoxPacient.SelectedValue!,
|
||||
(Status)comboBoxStatus.SelectedItem!,
|
||||
(int)comboBoxDoctor.SelectedValue!,
|
||||
CreateListMedicalHistoryFromDataGrid()
|
||||
);
|
||||
|
||||
_medicalHistoryRepository.CreateMedicalHistory(medicalHistory);
|
||||
MessageBox.Show("История болезни сохранена.", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при сохранении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
private void buttonCancel_Click(object sender, EventArgs e) => Close();
|
||||
|
||||
private List<DrugMedHistory> CreateListMedicalHistoryFromDataGrid()
|
||||
{
|
||||
var list = new List<DrugMedHistory>();
|
||||
|
||||
foreach (DataGridViewRow row in dataGridView.Rows)
|
||||
{
|
||||
if (row.Cells["ColumnDrug"].Value == null || row.Cells["ColumnCount"].Value == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
list.Add(DrugMedHistory.CreateEntity(0, Convert.ToInt32(row.Cells["ColumnDrug"].Value), 0,
|
||||
Convert.ToInt32(row.Cells["ColumnCount"].Value)));
|
||||
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
private void comboBoxStatus_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<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>
|
161
ProjectPolyclinic/ProjectPolyclinic/Forms/FormPatient.Designer.cs
generated
Normal file
161
ProjectPolyclinic/ProjectPolyclinic/Forms/FormPatient.Designer.cs
generated
Normal file
@ -0,0 +1,161 @@
|
||||
namespace ProjectPolyclinic.Forms
|
||||
{
|
||||
partial class FormPatient
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
labelFirstName = new Label();
|
||||
labelLastName = new Label();
|
||||
labelAdress = new Label();
|
||||
labelNumPhone = new Label();
|
||||
textBoxFirstName = new TextBox();
|
||||
textBoxLastName = new TextBox();
|
||||
textBoxAdress = new TextBox();
|
||||
textBoxNumPhone = new TextBox();
|
||||
buttonCancel = new Button();
|
||||
buttonSave = new Button();
|
||||
SuspendLayout();
|
||||
//
|
||||
// labelFirstName
|
||||
//
|
||||
labelFirstName.AutoSize = true;
|
||||
labelFirstName.Location = new Point(34, 36);
|
||||
labelFirstName.Name = "labelFirstName";
|
||||
labelFirstName.Size = new Size(31, 15);
|
||||
labelFirstName.TabIndex = 0;
|
||||
labelFirstName.Text = "Имя";
|
||||
//
|
||||
// labelLastName
|
||||
//
|
||||
labelLastName.AutoSize = true;
|
||||
labelLastName.Location = new Point(34, 89);
|
||||
labelLastName.Name = "labelLastName";
|
||||
labelLastName.Size = new Size(58, 15);
|
||||
labelLastName.TabIndex = 1;
|
||||
labelLastName.Text = "Фамилия";
|
||||
//
|
||||
// labelAdress
|
||||
//
|
||||
labelAdress.AutoSize = true;
|
||||
labelAdress.Location = new Point(34, 143);
|
||||
labelAdress.Name = "labelAdress";
|
||||
labelAdress.Size = new Size(46, 15);
|
||||
labelAdress.TabIndex = 2;
|
||||
labelAdress.Text = "Адресс";
|
||||
//
|
||||
// labelNumPhone
|
||||
//
|
||||
labelNumPhone.AutoSize = true;
|
||||
labelNumPhone.Location = new Point(34, 195);
|
||||
labelNumPhone.Name = "labelNumPhone";
|
||||
labelNumPhone.Size = new Size(101, 15);
|
||||
labelNumPhone.TabIndex = 3;
|
||||
labelNumPhone.Text = "Номер телефона";
|
||||
//
|
||||
// textBoxFirstName
|
||||
//
|
||||
textBoxFirstName.Location = new Point(179, 33);
|
||||
textBoxFirstName.Name = "textBoxFirstName";
|
||||
textBoxFirstName.Size = new Size(207, 23);
|
||||
textBoxFirstName.TabIndex = 4;
|
||||
//
|
||||
// textBoxLastName
|
||||
//
|
||||
textBoxLastName.Location = new Point(179, 81);
|
||||
textBoxLastName.Name = "textBoxLastName";
|
||||
textBoxLastName.Size = new Size(207, 23);
|
||||
textBoxLastName.TabIndex = 5;
|
||||
//
|
||||
// textBoxAdress
|
||||
//
|
||||
textBoxAdress.Location = new Point(179, 140);
|
||||
textBoxAdress.Name = "textBoxAdress";
|
||||
textBoxAdress.Size = new Size(207, 23);
|
||||
textBoxAdress.TabIndex = 6;
|
||||
//
|
||||
// textBoxNumPhone
|
||||
//
|
||||
textBoxNumPhone.Location = new Point(179, 192);
|
||||
textBoxNumPhone.Name = "textBoxNumPhone";
|
||||
textBoxNumPhone.Size = new Size(207, 23);
|
||||
textBoxNumPhone.TabIndex = 7;
|
||||
//
|
||||
// buttonCancel
|
||||
//
|
||||
buttonCancel.Location = new Point(159, 306);
|
||||
buttonCancel.Name = "buttonCancel";
|
||||
buttonCancel.Size = new Size(93, 29);
|
||||
buttonCancel.TabIndex = 9;
|
||||
buttonCancel.Text = "Отмена";
|
||||
buttonCancel.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// buttonSave
|
||||
//
|
||||
buttonSave.Location = new Point(34, 306);
|
||||
buttonSave.Name = "buttonSave";
|
||||
buttonSave.Size = new Size(93, 29);
|
||||
buttonSave.TabIndex = 8;
|
||||
buttonSave.Text = "Сохранить";
|
||||
buttonSave.UseVisualStyleBackColor = true;
|
||||
buttonSave.Click += buttonSave_Click;
|
||||
//
|
||||
// FormPatient
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(405, 347);
|
||||
Controls.Add(buttonCancel);
|
||||
Controls.Add(buttonSave);
|
||||
Controls.Add(textBoxNumPhone);
|
||||
Controls.Add(textBoxAdress);
|
||||
Controls.Add(textBoxLastName);
|
||||
Controls.Add(textBoxFirstName);
|
||||
Controls.Add(labelNumPhone);
|
||||
Controls.Add(labelAdress);
|
||||
Controls.Add(labelLastName);
|
||||
Controls.Add(labelFirstName);
|
||||
Name = "FormPatient";
|
||||
StartPosition = FormStartPosition.CenterScreen;
|
||||
Text = "Пациент";
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private Label labelFirstName;
|
||||
private Label labelLastName;
|
||||
private Label labelAdress;
|
||||
private Label labelNumPhone;
|
||||
private TextBox textBoxFirstName;
|
||||
private TextBox textBoxLastName;
|
||||
private TextBox textBoxAdress;
|
||||
private TextBox textBoxNumPhone;
|
||||
private Button buttonCancel;
|
||||
private Button buttonSave;
|
||||
}
|
||||
}
|
97
ProjectPolyclinic/ProjectPolyclinic/Forms/FormPatient.cs
Normal file
97
ProjectPolyclinic/ProjectPolyclinic/Forms/FormPatient.cs
Normal file
@ -0,0 +1,97 @@
|
||||
using ProjectPolyclinic.Entities;
|
||||
using ProjectPolyclinic.Repositories;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace ProjectPolyclinic.Forms;
|
||||
|
||||
public partial class FormPatient : Form
|
||||
{
|
||||
|
||||
|
||||
private readonly IPatientRepository _patientRepository;
|
||||
|
||||
private int? _patientId;
|
||||
|
||||
|
||||
public FormPatient(IPatientRepository patientRepository)
|
||||
{
|
||||
InitializeComponent();
|
||||
_patientRepository = patientRepository ??
|
||||
throw new ArgumentNullException(nameof(patientRepository));
|
||||
}
|
||||
|
||||
|
||||
|
||||
public int Id // свойство
|
||||
{
|
||||
set
|
||||
{
|
||||
try
|
||||
{
|
||||
var patient = _patientRepository.ReadPatientById(value); // value - некое значение
|
||||
if (patient == null) // по этому значению пытаемся найти запись в репозитории
|
||||
{
|
||||
throw new InvalidDataException(nameof(patient)); // если не находим выкидываем ошибку
|
||||
}
|
||||
// Если все норм, то пытаемся заполнить поля
|
||||
textBoxFirstName.Text = patient.First_Name;
|
||||
textBoxLastName.Text = patient.Last_Name;
|
||||
textBoxAdress.Text = patient.Address;
|
||||
textBoxNumPhone.Text = patient.ContactNumber;
|
||||
_patientId = value;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при получении данных", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void buttonSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
// проверяем что поля заполнены
|
||||
if (string.IsNullOrWhiteSpace(textBoxFirstName.Text) || string.IsNullOrWhiteSpace(textBoxLastName.Text) || string.IsNullOrWhiteSpace(textBoxNumPhone.Text)
|
||||
|| string.IsNullOrWhiteSpace(textBoxAdress.Text))
|
||||
{
|
||||
throw new Exception("Имеются незаполненные поля");
|
||||
}
|
||||
// проверка есть ли у нас id
|
||||
if (_patientId.HasValue)
|
||||
{
|
||||
// мы создаем запись и передаем id
|
||||
_patientRepository.UpdatePatient(CreatePatient(_patientId.Value));
|
||||
}
|
||||
else
|
||||
{
|
||||
// если id нет, то мы создаем запись, с id ноль
|
||||
_patientRepository.CreatPatient(CreatePatient(0));
|
||||
}
|
||||
// закрываем форму
|
||||
Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при сохранении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void ButtonCancel_Click(object sender, EventArgs e) => Close();
|
||||
|
||||
|
||||
private Patient CreatePatient(int id) => Patient.CreateEntity(id, textBoxFirstName.Text, textBoxLastName.Text, textBoxAdress.Text, textBoxNumPhone.Text);
|
||||
|
||||
|
||||
}
|
120
ProjectPolyclinic/ProjectPolyclinic/Forms/FormPatient.resx
Normal file
120
ProjectPolyclinic/ProjectPolyclinic/Forms/FormPatient.resx
Normal file
@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
123
ProjectPolyclinic/ProjectPolyclinic/Forms/FormPatients.Designer.cs
generated
Normal file
123
ProjectPolyclinic/ProjectPolyclinic/Forms/FormPatients.Designer.cs
generated
Normal file
@ -0,0 +1,123 @@
|
||||
namespace ProjectPolyclinic.Forms
|
||||
{
|
||||
partial class FormPatients
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
panel1 = new Panel();
|
||||
buttonUpdate = new Button();
|
||||
buttonDel = new Button();
|
||||
buttonAdd = new Button();
|
||||
dataGridView = new DataGridView();
|
||||
panel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
panel1.Controls.Add(buttonUpdate);
|
||||
panel1.Controls.Add(buttonDel);
|
||||
panel1.Controls.Add(buttonAdd);
|
||||
panel1.Dock = DockStyle.Right;
|
||||
panel1.Location = new Point(661, 0);
|
||||
panel1.Name = "panel1";
|
||||
panel1.Size = new Size(139, 390);
|
||||
panel1.TabIndex = 0;
|
||||
//
|
||||
// buttonUpdate
|
||||
//
|
||||
buttonUpdate.BackgroundImage = Properties.Resources.buttonUpdate;
|
||||
buttonUpdate.BackgroundImageLayout = ImageLayout.Stretch;
|
||||
buttonUpdate.Location = new Point(32, 241);
|
||||
buttonUpdate.Name = "buttonUpdate";
|
||||
buttonUpdate.Size = new Size(75, 70);
|
||||
buttonUpdate.TabIndex = 2;
|
||||
buttonUpdate.UseVisualStyleBackColor = true;
|
||||
buttonUpdate.Click += buttonUpdate_Click;
|
||||
//
|
||||
// buttonDel
|
||||
//
|
||||
buttonDel.BackgroundImage = Properties.Resources.buttonDel;
|
||||
buttonDel.BackgroundImageLayout = ImageLayout.Stretch;
|
||||
buttonDel.Location = new Point(32, 134);
|
||||
buttonDel.Name = "buttonDel";
|
||||
buttonDel.Size = new Size(75, 70);
|
||||
buttonDel.TabIndex = 1;
|
||||
buttonDel.UseVisualStyleBackColor = true;
|
||||
buttonDel.Click += buttonDel_Click;
|
||||
//
|
||||
// buttonAdd
|
||||
//
|
||||
buttonAdd.BackgroundImage = Properties.Resources.buttonAdd;
|
||||
buttonAdd.BackgroundImageLayout = ImageLayout.Stretch;
|
||||
buttonAdd.Location = new Point(32, 29);
|
||||
buttonAdd.Name = "buttonAdd";
|
||||
buttonAdd.Size = new Size(75, 70);
|
||||
buttonAdd.TabIndex = 0;
|
||||
buttonAdd.UseVisualStyleBackColor = true;
|
||||
buttonAdd.Click += buttonAdd_Click;
|
||||
//
|
||||
// dataGridView
|
||||
//
|
||||
dataGridView.AllowUserToResizeColumns = false;
|
||||
dataGridView.AllowUserToResizeRows = false;
|
||||
dataGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
|
||||
dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dataGridView.Dock = DockStyle.Fill;
|
||||
dataGridView.Location = new Point(0, 0);
|
||||
dataGridView.MultiSelect = false;
|
||||
dataGridView.Name = "dataGridView";
|
||||
dataGridView.RowHeadersVisible = false;
|
||||
dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dataGridView.Size = new Size(661, 390);
|
||||
dataGridView.TabIndex = 1;
|
||||
//
|
||||
// FormPatients
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(800, 390);
|
||||
Controls.Add(dataGridView);
|
||||
Controls.Add(panel1);
|
||||
Name = "FormPatients";
|
||||
StartPosition = FormStartPosition.CenterScreen;
|
||||
Text = " ";
|
||||
Load += FormDoctors_Load;
|
||||
panel1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private Panel panel1;
|
||||
private Button buttonUpdate;
|
||||
private Button buttonDel;
|
||||
private Button buttonAdd;
|
||||
private DataGridView dataGridView;
|
||||
}
|
||||
}
|
125
ProjectPolyclinic/ProjectPolyclinic/Forms/FormPatients.cs
Normal file
125
ProjectPolyclinic/ProjectPolyclinic/Forms/FormPatients.cs
Normal file
@ -0,0 +1,125 @@
|
||||
using ProjectPolyclinic.Repositories;
|
||||
using ProjectPolyclinic.Repositories.Implementations;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Unity;
|
||||
|
||||
namespace ProjectPolyclinic.Forms;
|
||||
|
||||
|
||||
|
||||
public partial class FormPatients : Form
|
||||
{
|
||||
|
||||
|
||||
private readonly IUnityContainer _container;
|
||||
|
||||
private readonly IPatientRepository _pacientRepository;
|
||||
|
||||
|
||||
|
||||
public FormPatients(IUnityContainer container, IPatientRepository pacientRepository)
|
||||
{
|
||||
InitializeComponent();
|
||||
_container = container ??
|
||||
throw new ArgumentNullException(nameof(container));
|
||||
_pacientRepository = pacientRepository ??
|
||||
throw new ArgumentNullException(nameof(pacientRepository));
|
||||
}
|
||||
|
||||
|
||||
private void FormDoctors_Load(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
LoadList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void LoadList() => dataGridView.DataSource = _pacientRepository.ReadPatient();
|
||||
|
||||
|
||||
|
||||
private void buttonAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
// мы получаем через container объект FormPatient и вызываем его
|
||||
try
|
||||
{
|
||||
_container.Resolve<FormPatient>().ShowDialog();
|
||||
LoadList(); // обновление списка
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при добавлении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonDel_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!TryGetIdentifierFromSelectedRow(out var findId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (MessageBox.Show("Удалить запись?", "Удаление", MessageBoxButtons.YesNo) != DialogResult.Yes)
|
||||
{
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
_pacientRepository.DeletePatient(findId);
|
||||
LoadList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при удалении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonUpdate_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!TryGetIdentifierFromSelectedRow(out var findId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var form = _container.Resolve<FormPatient>();
|
||||
form.Id = findId;
|
||||
form.ShowDialog();
|
||||
LoadList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при изменении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private bool TryGetIdentifierFromSelectedRow(out int id)
|
||||
{
|
||||
id = 0;
|
||||
if (dataGridView.SelectedRows.Count < 1)
|
||||
{
|
||||
MessageBox.Show("Нет выбранной записи", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return false;
|
||||
}
|
||||
id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["id"].Value);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
120
ProjectPolyclinic/ProjectPolyclinic/Forms/FormPatients.resx
Normal file
120
ProjectPolyclinic/ProjectPolyclinic/Forms/FormPatients.resx
Normal file
@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
@ -1,3 +1,7 @@
|
||||
using ProjectPolyclinic.Repositories.Implementations;
|
||||
using ProjectPolyclinic.Repositories;
|
||||
using Unity;
|
||||
|
||||
namespace ProjectPolyclinic
|
||||
{
|
||||
internal static class Program
|
||||
@ -11,7 +15,25 @@ namespace ProjectPolyclinic
|
||||
// To customize application configuration such as set high DPI settings or default font,
|
||||
// see https://aka.ms/applicationconfiguration.
|
||||
ApplicationConfiguration.Initialize();
|
||||
Application.Run(new Form1());
|
||||
Application.Run(CreateContainer().Resolve<FormPolyclinic>());
|
||||
}
|
||||
|
||||
private static IUnityContainer CreateContainer()
|
||||
{
|
||||
var container = new UnityContainer();
|
||||
|
||||
// çàðåãåñòðèðóåì çàâèñèìîñòü
|
||||
|
||||
container.RegisterType<IPatientRepository, PatientRepository>();
|
||||
container.RegisterType<IDoctorRepository, DoctorRepository>();
|
||||
container.RegisterType<IDoctorPayRepository, DoctorPayRepository>();
|
||||
container.RegisterType<IMedicalHistoryRepository, MedicalHistoryRepository>();
|
||||
container.RegisterType<IDrugRepository, DrugRepository>();
|
||||
|
||||
return container;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -8,4 +8,35 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Unity" Version="5.11.10" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="Forms\FormDrugs.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Forms\FormDoctorPayments.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Forms\FormMedicalHistories.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Forms\FormPatients.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Properties\Resources.Designer.cs">
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Update="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
103
ProjectPolyclinic/ProjectPolyclinic/Properties/Resources.Designer.cs
generated
Normal file
103
ProjectPolyclinic/ProjectPolyclinic/Properties/Resources.Designer.cs
generated
Normal file
@ -0,0 +1,103 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Этот код создан программой.
|
||||
// Исполняемая версия:4.0.30319.42000
|
||||
//
|
||||
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
|
||||
// повторной генерации кода.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ProjectPolyclinic.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Класс ресурса со строгой типизацией для поиска локализованных строк и т.д.
|
||||
/// </summary>
|
||||
// Этот класс создан автоматически классом StronglyTypedResourceBuilder
|
||||
// с помощью такого средства, как ResGen или Visual Studio.
|
||||
// Чтобы добавить или удалить член, измените файл .ResX и снова запустите ResGen
|
||||
// с параметром /str или перестройте свой проект VS.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Возвращает кэшированный экземпляр ResourceManager, использованный этим классом.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ProjectPolyclinic.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Перезаписывает свойство CurrentUICulture текущего потока для всех
|
||||
/// обращений к ресурсу с помощью этого класса ресурса со строгой типизацией.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap buttonAdd {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("buttonAdd", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap buttonDel {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("buttonDel", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap buttonUpdate {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("buttonUpdate", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap polyclinicfon {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("polyclinicfon", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
133
ProjectPolyclinic/ProjectPolyclinic/Properties/Resources.resx
Normal file
133
ProjectPolyclinic/ProjectPolyclinic/Properties/Resources.resx
Normal file
@ -0,0 +1,133 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="polyclinicfon" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\polyclinicfon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="buttonDel" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\buttonDel.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="buttonAdd" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\buttonAdd.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="buttonUpdate" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\buttonUpdate.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
</root>
|
@ -0,0 +1,21 @@
|
||||
using ProjectPolyclinic.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectPolyclinic.Repositories;
|
||||
|
||||
public interface IDoctorPayRepository
|
||||
{
|
||||
IEnumerable<DoctorPay> ReadDoctorPayments();
|
||||
|
||||
DoctorPay ReadDoctorPaymentsById(int id);
|
||||
|
||||
void CreateDoctorPayments(DoctorPay doctorPayments);
|
||||
|
||||
void UpdateDoctorPayments(DoctorPay doctorPayments);
|
||||
|
||||
void DeleteDoctorPayments(int id);
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
using ProjectPolyclinic.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectPolyclinic.Repositories;
|
||||
|
||||
public interface IDoctorRepository
|
||||
{
|
||||
IEnumerable<Doctor> ReadDoctors();
|
||||
|
||||
Doctor ReadDoctorById(int id);
|
||||
|
||||
void CreateDoctor(Doctor doctor);
|
||||
|
||||
void UpdateDoctor(Doctor doctor);
|
||||
|
||||
void DeleteDoctor(int id);
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
using ProjectPolyclinic.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectPolyclinic.Repositories;
|
||||
|
||||
public interface IDrugRepository
|
||||
{
|
||||
IEnumerable<Drug> ReadDrug();
|
||||
|
||||
Drug ReadDrugById(int id);
|
||||
|
||||
void CreateDrug(Drug drag);
|
||||
|
||||
void UpdateDrug(Drug drag);
|
||||
|
||||
void DeleteDrug(int id);
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
using ProjectPolyclinic.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectPolyclinic.Repositories;
|
||||
|
||||
public interface IMedicalHistoryRepository
|
||||
{
|
||||
IEnumerable<MedicalHistory> ReadMedicalHistory(DateTime? dateForm = null, DateTime? dateTo = null, int? DoctorId = null, int? PatientId = null);
|
||||
|
||||
|
||||
void CreateMedicalHistory(MedicalHistory medicalHistory);
|
||||
|
||||
|
||||
void DeletemedicalHistory(int id);
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
using ProjectPolyclinic.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectPolyclinic.Repositories;
|
||||
|
||||
public interface IPatientRepository
|
||||
{
|
||||
IEnumerable<Patient> ReadPatient();
|
||||
|
||||
Patient ReadPatientById(int id);
|
||||
|
||||
void CreatPatient(Patient patient);
|
||||
|
||||
void UpdatePatient(Patient patient);
|
||||
|
||||
void DeletePatient(int id);
|
||||
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
using ProjectPolyclinic.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectPolyclinic.Repositories.Implementations;
|
||||
|
||||
public class DoctorPayRepository : IDoctorPayRepository
|
||||
{
|
||||
public void CreateDoctorPayments(DoctorPay doctorPayments)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void DeleteDoctorPayments(int id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public IEnumerable<DoctorPay> ReadDoctorPayments()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
public DoctorPay ReadDoctorPaymentsById(int id)
|
||||
{
|
||||
return DoctorPay.CreateElement(0, 0, string.Empty, 0, 0);
|
||||
}
|
||||
|
||||
public void UpdateDoctorPayments(DoctorPay doctorPayments)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
using ProjectPolyclinic.Entities;
|
||||
using ProjectPolyclinic.Entities.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectPolyclinic.Repositories.Implementations;
|
||||
|
||||
public class DoctorRepository : IDoctorRepository
|
||||
{
|
||||
public void CreateDoctor(Doctor doctor)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void DeleteDoctor(int id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public Doctor ReadDoctorById(int id)
|
||||
{
|
||||
return Doctor.CreateEntity(0, string.Empty, string.Empty, 0, Specialization.None, SpecializationLevel.None);
|
||||
}
|
||||
|
||||
public IEnumerable<Doctor> ReadDoctors()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
public void UpdateDoctor(Doctor doctor)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
using ProjectPolyclinic.Entities;
|
||||
using ProjectPolyclinic.Entities.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectPolyclinic.Repositories.Implementations;
|
||||
|
||||
public class DrugRepository : IDrugRepository
|
||||
{
|
||||
public void CreateDrug(Drug drag)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void DeleteDrug(int id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public IEnumerable<Drug> ReadDrug()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
public Drug ReadDrugById(int id)
|
||||
{
|
||||
return Drug.CreateElement(0, DrugsNames.None, 0, string.Empty);
|
||||
}
|
||||
|
||||
public void UpdateDrug(Drug drag)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
using ProjectPolyclinic.Entities;
|
||||
using ProjectPolyclinic.Entities.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectPolyclinic.Repositories.Implementations;
|
||||
|
||||
public class MedicalHistoryRepository : IMedicalHistoryRepository
|
||||
{
|
||||
public void CreateMedicalHistory(MedicalHistory medicalHistory)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void DeletemedicalHistory(int id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public IEnumerable<MedicalHistory> ReadMedicalHistory(DateTime? dateForm = null, DateTime? dateTo = null, int? PatientId = null, int? DoctorId = null)
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
using ProjectPolyclinic.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectPolyclinic.Repositories.Implementations;
|
||||
|
||||
public class PatientRepository : IPatientRepository
|
||||
{
|
||||
public void CreatPatient(Patient patient)
|
||||
{
|
||||
}
|
||||
|
||||
public void DeletePatient(int id)
|
||||
{
|
||||
}
|
||||
|
||||
public IEnumerable<Patient> ReadPatient()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
public Patient ReadPatientById(int id)
|
||||
{
|
||||
return Patient.CreateEntity(0, string.Empty, string.Empty, string.Empty, string.Empty);
|
||||
}
|
||||
|
||||
public void UpdatePatient(Patient patient)
|
||||
{
|
||||
}
|
||||
}
|
BIN
ProjectPolyclinic/ProjectPolyclinic/Resources/buttonAdd.jpg
Normal file
BIN
ProjectPolyclinic/ProjectPolyclinic/Resources/buttonAdd.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
BIN
ProjectPolyclinic/ProjectPolyclinic/Resources/buttonDel.png
Normal file
BIN
ProjectPolyclinic/ProjectPolyclinic/Resources/buttonDel.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 171 KiB |
BIN
ProjectPolyclinic/ProjectPolyclinic/Resources/buttonUpdate.png
Normal file
BIN
ProjectPolyclinic/ProjectPolyclinic/Resources/buttonUpdate.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 25 KiB |
BIN
ProjectPolyclinic/ProjectPolyclinic/Resources/polyclinicfon.png
Normal file
BIN
ProjectPolyclinic/ProjectPolyclinic/Resources/polyclinicfon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.7 MiB |
Loading…
x
Reference in New Issue
Block a user
Много пустых строк