Compare commits
No commits in common. "LabWork_1" and "main" have entirely different histories.
@ -1,41 +0,0 @@
|
|||||||
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; }
|
|
||||||
|
|
||||||
public SpecializationLevel SpecializationLevel { get; private set; }
|
|
||||||
|
|
||||||
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
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -1,34 +0,0 @@
|
|||||||
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
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,30 +0,0 @@
|
|||||||
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
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,29 +0,0 @@
|
|||||||
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
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,25 +0,0 @@
|
|||||||
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,
|
|
||||||
}
|
|
@ -1,25 +0,0 @@
|
|||||||
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
|
|
||||||
}
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
|||||||
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
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
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
|
|
||||||
}
|
|
@ -1,41 +0,0 @@
|
|||||||
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
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,35 +0,0 @@
|
|||||||
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
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
39
ProjectPolyclinic/ProjectPolyclinic/Form1.Designer.cs
generated
Normal file
39
ProjectPolyclinic/ProjectPolyclinic/Form1.Designer.cs
generated
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
10
ProjectPolyclinic/ProjectPolyclinic/Form1.cs
Normal file
10
ProjectPolyclinic/ProjectPolyclinic/Form1.cs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
namespace ProjectPolyclinic
|
||||||
|
{
|
||||||
|
public partial class Form1 : Form
|
||||||
|
{
|
||||||
|
public Form1()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,17 +1,17 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<root>
|
<root>
|
||||||
<!--
|
<!--
|
||||||
Microsoft ResX Schema
|
Microsoft ResX Schema
|
||||||
|
|
||||||
Version 2.0
|
Version 2.0
|
||||||
|
|
||||||
The primary goals of this format is to allow a simple XML format
|
The primary goals of this format is to allow a simple XML format
|
||||||
that is mostly human readable. The generation and parsing of the
|
that is mostly human readable. The generation and parsing of the
|
||||||
various data types are done through the TypeConverter classes
|
various data types are done through the TypeConverter classes
|
||||||
associated with the data types.
|
associated with the data types.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
... ado.net/XML headers & schema ...
|
... ado.net/XML headers & schema ...
|
||||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
<resheader name="version">2.0</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>
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
<comment>This is a comment</comment>
|
<comment>This is a comment</comment>
|
||||||
</data>
|
</data>
|
||||||
|
|
||||||
There are any number of "resheader" rows that contain simple
|
There are any number of "resheader" rows that contain simple
|
||||||
name/value pairs.
|
name/value pairs.
|
||||||
|
|
||||||
Each data row contains a name, and value. The row also contains a
|
Each data row contains a name, and value. The row also contains a
|
||||||
type or mimetype. Type corresponds to a .NET class that support
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
text/value conversion through the TypeConverter architecture.
|
text/value conversion through the TypeConverter architecture.
|
||||||
Classes that don't support this are serialized and stored with the
|
Classes that don't support this are serialized and stored with the
|
||||||
mimetype set.
|
mimetype set.
|
||||||
|
|
||||||
The mimetype is used for serialized objects, and tells the
|
The mimetype is used for serialized objects, and tells the
|
||||||
ResXResourceReader how to depersist the object. This is currently not
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
extensible. For a given mimetype the value must be set accordingly:
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
that the ResXResourceWriter will generate, however the reader can
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
read any of the formats listed below.
|
read any of the formats listed below.
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.binary.base64
|
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
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
: and then encoded with base64 encoding.
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.soap.base64
|
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
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
: and then encoded with base64 encoding.
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
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
|
: using a System.ComponentModel.TypeConverter
|
||||||
: and then encoded with base64 encoding.
|
: and then encoded with base64 encoding.
|
||||||
-->
|
-->
|
@ -1,138 +0,0 @@
|
|||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,81 +0,0 @@
|
|||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,123 +0,0 @@
|
|||||||
<?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>
|
|
@ -1,192 +0,0 @@
|
|||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,107 +0,0 @@
|
|||||||
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,120 +0,0 @@
|
|||||||
<?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,125 +0,0 @@
|
|||||||
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();
|
|
||||||
label4 = new Label();
|
|
||||||
dateTimePicker = new DateTimePicker();
|
|
||||||
SuspendLayout();
|
|
||||||
//
|
|
||||||
// labelDoctor
|
|
||||||
//
|
|
||||||
labelDoctor.AutoSize = true;
|
|
||||||
labelDoctor.Location = new Point(35, 43);
|
|
||||||
labelDoctor.Name = "labelDoctor";
|
|
||||||
labelDoctor.Size = new Size(43, 20);
|
|
||||||
labelDoctor.TabIndex = 0;
|
|
||||||
labelDoctor.Text = "Врач";
|
|
||||||
//
|
|
||||||
// buttonCancel
|
|
||||||
//
|
|
||||||
buttonCancel.Location = new Point(240, 143);
|
|
||||||
buttonCancel.Margin = new Padding(3, 4, 3, 4);
|
|
||||||
buttonCancel.Name = "buttonCancel";
|
|
||||||
buttonCancel.Size = new Size(106, 39);
|
|
||||||
buttonCancel.TabIndex = 11;
|
|
||||||
buttonCancel.Text = "Отмена";
|
|
||||||
buttonCancel.UseVisualStyleBackColor = true;
|
|
||||||
//
|
|
||||||
// buttonSave
|
|
||||||
//
|
|
||||||
buttonSave.Location = new Point(35, 143);
|
|
||||||
buttonSave.Margin = new Padding(3, 4, 3, 4);
|
|
||||||
buttonSave.Name = "buttonSave";
|
|
||||||
buttonSave.Size = new Size(106, 39);
|
|
||||||
buttonSave.TabIndex = 10;
|
|
||||||
buttonSave.Text = "Сохранить";
|
|
||||||
buttonSave.UseVisualStyleBackColor = true;
|
|
||||||
buttonSave.Click += buttonSave_Click;
|
|
||||||
//
|
|
||||||
// comboBoxDoctor
|
|
||||||
//
|
|
||||||
comboBoxDoctor.DropDownStyle = ComboBoxStyle.DropDownList;
|
|
||||||
comboBoxDoctor.FormattingEnabled = true;
|
|
||||||
comboBoxDoctor.Location = new Point(193, 40);
|
|
||||||
comboBoxDoctor.Margin = new Padding(3, 4, 3, 4);
|
|
||||||
comboBoxDoctor.Name = "comboBoxDoctor";
|
|
||||||
comboBoxDoctor.Size = new Size(153, 28);
|
|
||||||
comboBoxDoctor.TabIndex = 12;
|
|
||||||
//
|
|
||||||
// label4
|
|
||||||
//
|
|
||||||
label4.AutoSize = true;
|
|
||||||
label4.Location = new Point(35, 99);
|
|
||||||
label4.Name = "label4";
|
|
||||||
label4.Size = new Size(54, 20);
|
|
||||||
label4.TabIndex = 17;
|
|
||||||
label4.Text = "Месяц";
|
|
||||||
//
|
|
||||||
// dateTimePicker
|
|
||||||
//
|
|
||||||
dateTimePicker.CustomFormat = "MMMM yyyy";
|
|
||||||
dateTimePicker.Format = DateTimePickerFormat.Custom;
|
|
||||||
dateTimePicker.Location = new Point(193, 94);
|
|
||||||
dateTimePicker.Name = "dateTimePicker";
|
|
||||||
dateTimePicker.Size = new Size(153, 27);
|
|
||||||
dateTimePicker.TabIndex = 22;
|
|
||||||
//
|
|
||||||
// FormDoctorPayment
|
|
||||||
//
|
|
||||||
AutoScaleDimensions = new SizeF(8F, 20F);
|
|
||||||
AutoScaleMode = AutoScaleMode.Font;
|
|
||||||
ClientSize = new Size(370, 207);
|
|
||||||
Controls.Add(dateTimePicker);
|
|
||||||
Controls.Add(label4);
|
|
||||||
Controls.Add(comboBoxDoctor);
|
|
||||||
Controls.Add(buttonCancel);
|
|
||||||
Controls.Add(buttonSave);
|
|
||||||
Controls.Add(labelDoctor);
|
|
||||||
Margin = new Padding(3, 4, 3, 4);
|
|
||||||
Name = "FormDoctorPayment";
|
|
||||||
StartPosition = FormStartPosition.CenterScreen;
|
|
||||||
Text = "Оплата врачу";
|
|
||||||
ResumeLayout(false);
|
|
||||||
PerformLayout();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
private Label labelDoctor;
|
|
||||||
private Button buttonCancel;
|
|
||||||
private Button buttonSave;
|
|
||||||
private ComboBox comboBoxDoctor;
|
|
||||||
private Label label4;
|
|
||||||
private DateTimePicker dateTimePicker;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,57 +0,0 @@
|
|||||||
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;
|
|
||||||
using System.Windows.Forms.VisualStyles;
|
|
||||||
|
|
||||||
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 (comboBoxDoctor.SelectedIndex < 0)
|
|
||||||
{
|
|
||||||
throw new Exception("Имеются незаполненные поля.");
|
|
||||||
}
|
|
||||||
|
|
||||||
string month = dateTimePicker.Value.ToString();
|
|
||||||
|
|
||||||
//сделать запрос на счет пациентов у каждого врача в medicalhis
|
|
||||||
|
|
||||||
_doctorPayRepository.CreateDoctorPayments(DoctorPay.CreateElement(0, (int)comboBoxDoctor.SelectedValue!, month, 0, 0));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Close();
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
MessageBox.Show(ex.Message, "Ошибка при сохранении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void buttonCancel_Click(object sender, EventArgs e) => Close();
|
|
||||||
}
|
|
@ -1,95 +0,0 @@
|
|||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,70 +0,0 @@
|
|||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -1,120 +0,0 @@
|
|||||||
<?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,123 +0,0 @@
|
|||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,123 +0,0 @@
|
|||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,120 +0,0 @@
|
|||||||
<?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,140 +0,0 @@
|
|||||||
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 = "Лекарство";
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,111 +0,0 @@
|
|||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -1,120 +0,0 @@
|
|||||||
<?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,123 +0,0 @@
|
|||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,123 +0,0 @@
|
|||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -1,120 +0,0 @@
|
|||||||
<?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,109 +0,0 @@
|
|||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,112 +0,0 @@
|
|||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -1,120 +0,0 @@
|
|||||||
<?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,207 +0,0 @@
|
|||||||
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(34, 48);
|
|
||||||
labelPacientName.Name = "labelPacientName";
|
|
||||||
labelPacientName.Size = new Size(69, 20);
|
|
||||||
labelPacientName.TabIndex = 0;
|
|
||||||
labelPacientName.Text = "Пациент";
|
|
||||||
//
|
|
||||||
// labelDoctorName
|
|
||||||
//
|
|
||||||
labelDoctorName.AutoSize = true;
|
|
||||||
labelDoctorName.Location = new Point(34, 117);
|
|
||||||
labelDoctorName.Name = "labelDoctorName";
|
|
||||||
labelDoctorName.Size = new Size(59, 20);
|
|
||||||
labelDoctorName.TabIndex = 1;
|
|
||||||
labelDoctorName.Text = "Доктор";
|
|
||||||
//
|
|
||||||
// comboBoxPacient
|
|
||||||
//
|
|
||||||
comboBoxPacient.DropDownStyle = ComboBoxStyle.DropDownList;
|
|
||||||
comboBoxPacient.FormattingEnabled = true;
|
|
||||||
comboBoxPacient.Location = new Point(147, 44);
|
|
||||||
comboBoxPacient.Margin = new Padding(3, 4, 3, 4);
|
|
||||||
comboBoxPacient.Name = "comboBoxPacient";
|
|
||||||
comboBoxPacient.Size = new Size(151, 28);
|
|
||||||
comboBoxPacient.TabIndex = 2;
|
|
||||||
//
|
|
||||||
// comboBoxDoctor
|
|
||||||
//
|
|
||||||
comboBoxDoctor.DropDownStyle = ComboBoxStyle.DropDownList;
|
|
||||||
comboBoxDoctor.FormattingEnabled = true;
|
|
||||||
comboBoxDoctor.Location = new Point(147, 113);
|
|
||||||
comboBoxDoctor.Margin = new Padding(3, 4, 3, 4);
|
|
||||||
comboBoxDoctor.Name = "comboBoxDoctor";
|
|
||||||
comboBoxDoctor.Size = new Size(151, 28);
|
|
||||||
comboBoxDoctor.TabIndex = 3;
|
|
||||||
//
|
|
||||||
// groupBox
|
|
||||||
//
|
|
||||||
groupBox.Controls.Add(dataGridView);
|
|
||||||
groupBox.Location = new Point(34, 233);
|
|
||||||
groupBox.Margin = new Padding(3, 4, 3, 4);
|
|
||||||
groupBox.Name = "groupBox";
|
|
||||||
groupBox.Padding = new Padding(3, 4, 3, 4);
|
|
||||||
groupBox.Size = new Size(269, 329);
|
|
||||||
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, 24);
|
|
||||||
dataGridView.Margin = new Padding(3, 4, 3, 4);
|
|
||||||
dataGridView.MultiSelect = false;
|
|
||||||
dataGridView.Name = "dataGridView";
|
|
||||||
dataGridView.RowHeadersVisible = false;
|
|
||||||
dataGridView.RowHeadersWidth = 51;
|
|
||||||
dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
|
||||||
dataGridView.Size = new Size(263, 301);
|
|
||||||
dataGridView.TabIndex = 0;
|
|
||||||
//
|
|
||||||
// ColumnDrug
|
|
||||||
//
|
|
||||||
ColumnDrug.HeaderText = "Лекарство";
|
|
||||||
ColumnDrug.MinimumWidth = 6;
|
|
||||||
ColumnDrug.Name = "ColumnDrug";
|
|
||||||
ColumnDrug.Width = 125;
|
|
||||||
//
|
|
||||||
// DrugCount
|
|
||||||
//
|
|
||||||
DrugCount.HeaderText = "Количество";
|
|
||||||
DrugCount.MinimumWidth = 6;
|
|
||||||
DrugCount.Name = "DrugCount";
|
|
||||||
DrugCount.Width = 125;
|
|
||||||
//
|
|
||||||
// label
|
|
||||||
//
|
|
||||||
label.AutoSize = true;
|
|
||||||
label.Location = new Point(34, 185);
|
|
||||||
label.Name = "label";
|
|
||||||
label.Size = new Size(52, 20);
|
|
||||||
label.TabIndex = 5;
|
|
||||||
label.Text = "Статус";
|
|
||||||
//
|
|
||||||
// comboBoxStatus
|
|
||||||
//
|
|
||||||
comboBoxStatus.DropDownStyle = ComboBoxStyle.DropDownList;
|
|
||||||
comboBoxStatus.FormattingEnabled = true;
|
|
||||||
comboBoxStatus.Location = new Point(147, 181);
|
|
||||||
comboBoxStatus.Margin = new Padding(3, 4, 3, 4);
|
|
||||||
comboBoxStatus.Name = "comboBoxStatus";
|
|
||||||
comboBoxStatus.Size = new Size(151, 28);
|
|
||||||
comboBoxStatus.TabIndex = 6;
|
|
||||||
//
|
|
||||||
// buttonCancel
|
|
||||||
//
|
|
||||||
buttonCancel.Location = new Point(193, 692);
|
|
||||||
buttonCancel.Margin = new Padding(3, 4, 3, 4);
|
|
||||||
buttonCancel.Name = "buttonCancel";
|
|
||||||
buttonCancel.Size = new Size(106, 39);
|
|
||||||
buttonCancel.TabIndex = 10;
|
|
||||||
buttonCancel.Text = "Отмена";
|
|
||||||
buttonCancel.UseVisualStyleBackColor = true;
|
|
||||||
//
|
|
||||||
// buttonSave
|
|
||||||
//
|
|
||||||
buttonSave.Location = new Point(34, 692);
|
|
||||||
buttonSave.Margin = new Padding(3, 4, 3, 4);
|
|
||||||
buttonSave.Name = "buttonSave";
|
|
||||||
buttonSave.Size = new Size(106, 39);
|
|
||||||
buttonSave.TabIndex = 9;
|
|
||||||
buttonSave.Text = "Сохранить";
|
|
||||||
buttonSave.UseVisualStyleBackColor = true;
|
|
||||||
buttonSave.Click += buttonSave_Click;
|
|
||||||
//
|
|
||||||
// FormMedicalHistory
|
|
||||||
//
|
|
||||||
AutoScaleDimensions = new SizeF(8F, 20F);
|
|
||||||
AutoScaleMode = AutoScaleMode.Font;
|
|
||||||
ClientSize = new Size(325, 765);
|
|
||||||
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);
|
|
||||||
Margin = new Padding(3, 4, 3, 4);
|
|
||||||
Name = "FormMedicalHistory";
|
|
||||||
StartPosition = FormStartPosition.CenterScreen;
|
|
||||||
Text = "Медицинская история";
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,97 +0,0 @@
|
|||||||
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));
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,132 +0,0 @@
|
|||||||
<?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>
|
|
||||||
<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>
|
|
@ -1,161 +0,0 @@
|
|||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,91 +0,0 @@
|
|||||||
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);
|
|
||||||
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("Имеются незаполненные поля");
|
|
||||||
}
|
|
||||||
if (_patientId.HasValue)
|
|
||||||
{
|
|
||||||
_patientRepository.UpdatePatient(CreatePatient(_patientId.Value));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_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);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -1,120 +0,0 @@
|
|||||||
<?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,123 +0,0 @@
|
|||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,124 +0,0 @@
|
|||||||
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)
|
|
||||||
{
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -1,120 +0,0 @@
|
|||||||
<?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,7 +1,3 @@
|
|||||||
using ProjectPolyclinic.Repositories.Implementations;
|
|
||||||
using ProjectPolyclinic.Repositories;
|
|
||||||
using Unity;
|
|
||||||
|
|
||||||
namespace ProjectPolyclinic
|
namespace ProjectPolyclinic
|
||||||
{
|
{
|
||||||
internal static class Program
|
internal static class Program
|
||||||
@ -15,25 +11,7 @@ namespace ProjectPolyclinic
|
|||||||
// To customize application configuration such as set high DPI settings or default font,
|
// To customize application configuration such as set high DPI settings or default font,
|
||||||
// see https://aka.ms/applicationconfiguration.
|
// see https://aka.ms/applicationconfiguration.
|
||||||
ApplicationConfiguration.Initialize();
|
ApplicationConfiguration.Initialize();
|
||||||
Application.Run(CreateContainer().Resolve<FormPolyclinic>());
|
Application.Run(new Form1());
|
||||||
}
|
}
|
||||||
|
|
||||||
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,35 +8,4 @@
|
|||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
</PropertyGroup>
|
</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>
|
</Project>
|
@ -1,103 +0,0 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
// <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));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,133 +0,0 @@
|
|||||||
<?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>
|
|
@ -1,21 +0,0 @@
|
|||||||
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);
|
|
||||||
}
|
|
@ -1,22 +0,0 @@
|
|||||||
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);
|
|
||||||
|
|
||||||
}
|
|
@ -1,21 +0,0 @@
|
|||||||
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);
|
|
||||||
}
|
|
@ -1,19 +0,0 @@
|
|||||||
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);
|
|
||||||
}
|
|
@ -1,22 +0,0 @@
|
|||||||
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);
|
|
||||||
|
|
||||||
}
|
|
@ -1,36 +0,0 @@
|
|||||||
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();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,37 +0,0 @@
|
|||||||
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)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,37 +0,0 @@
|
|||||||
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)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,28 +0,0 @@
|
|||||||
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 [];
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,33 +0,0 @@
|
|||||||
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)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
Binary file not shown.
Before Width: | Height: | Size: 13 KiB |
Binary file not shown.
Before Width: | Height: | Size: 171 KiB |
Binary file not shown.
Before Width: | Height: | Size: 25 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.7 MiB |
Loading…
x
Reference in New Issue
Block a user