Initial commit
This commit is contained in:
+46
@@ -0,0 +1,46 @@
|
||||
# Build output
|
||||
bin/
|
||||
obj/
|
||||
|
||||
# Build folders
|
||||
Debug/
|
||||
Release/
|
||||
net*/
|
||||
publish/
|
||||
|
||||
# Visual Studio
|
||||
.vs/
|
||||
*.user
|
||||
*.suo
|
||||
*.userosscache
|
||||
*.sln.docstates
|
||||
|
||||
# Rider / JetBrains
|
||||
.idea/
|
||||
*.sln.iml
|
||||
|
||||
# NuGet
|
||||
*.nupkg
|
||||
packages/
|
||||
.nuget/
|
||||
|
||||
# Logs
|
||||
*.log
|
||||
|
||||
# Database backups (если не нужны как часть проекта)
|
||||
*.bak
|
||||
*.tar
|
||||
|
||||
# Temporary files
|
||||
*.tmp
|
||||
*.temp
|
||||
|
||||
# OS files
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
# Screenshots / temporary images
|
||||
# (уберите, если картинки нужны в документации)
|
||||
# *.png
|
||||
# *.jpg
|
||||
# *.jpeg
|
||||
@@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.14.36603.0 d17.14
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Register office", "Register office\Register office.csproj", "{C8CBA323-4CD6-46D0-81AA-1C986EB50C6B}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{C8CBA323-4CD6-46D0-81AA-1C986EB50C6B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{C8CBA323-4CD6-46D0-81AA-1C986EB50C6B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C8CBA323-4CD6-46D0-81AA-1C986EB50C6B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C8CBA323-4CD6-46D0-81AA-1C986EB50C6B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {4BE06EF1-D35E-4B49-A77D-D46964AC9895}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Register_office.BaseClasses
|
||||
{
|
||||
internal interface IUnionId
|
||||
{
|
||||
public abstract object GetId();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
using OfficeOpenXml;
|
||||
using OfficeOpenXml.Drawing.Chart;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Register_office
|
||||
{
|
||||
internal class ExcelManager
|
||||
{
|
||||
public static void ExportToExcel<T>(List<T> data, string filePath)
|
||||
{
|
||||
ExcelPackage.License.SetNonCommercialOrganization("Grant");
|
||||
|
||||
using var package = new ExcelPackage();
|
||||
var worksheet = package.Workbook.Worksheets.Add("Отчёт");
|
||||
|
||||
// Получаем свойства класса
|
||||
var properties = typeof(T).GetProperties();
|
||||
|
||||
// Заголовки (используем атрибут [DisplayName] или имя свойства)
|
||||
for (int i = 0; i < properties.Length; i++)
|
||||
{
|
||||
var displayNameAttr = properties[i].GetCustomAttribute<DisplayNameAttribute>();
|
||||
worksheet.Cells[1, i + 1].Value = displayNameAttr?.DisplayName ?? properties[i].Name;
|
||||
}
|
||||
|
||||
// Данные
|
||||
for (int i = 0; i < data.Count; i++)
|
||||
{
|
||||
for (int j = 0; j < properties.Length; j++)
|
||||
{
|
||||
worksheet.Cells[i + 2, j + 1].Value = properties[j].GetValue(data[i]);
|
||||
}
|
||||
}
|
||||
|
||||
worksheet.Cells[worksheet.Dimension.Address].AutoFitColumns();
|
||||
try
|
||||
{
|
||||
File.WriteAllBytes(filePath, package.GetAsByteArray());
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
MessageBox.Show($"Не получилось сформировать отчет. Пожалуйста, закройте открытый файл отчета",
|
||||
"Отчет о наличии ЛП в конце дня",
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
public static void OpenExcelFile(string filePath)
|
||||
{
|
||||
try
|
||||
{
|
||||
var process = new Process
|
||||
{
|
||||
StartInfo = new ProcessStartInfo(filePath)
|
||||
{
|
||||
UseShellExecute = true // Ключевой параметр!
|
||||
}
|
||||
};
|
||||
process.Start();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show($"Не удалось открыть файл: {ex.Message}", "Отчет о наличии ЛП в конце дня",
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Register_office.Model
|
||||
{
|
||||
internal class Analysis
|
||||
{
|
||||
[DisplayName("Пациент")]
|
||||
[Column("Пациент")]
|
||||
public string Patient { get; set; }
|
||||
|
||||
[DisplayName("Обследование")]
|
||||
[Column("Обследование")]
|
||||
public string Examination { get; set; }
|
||||
|
||||
[DisplayName("Результат")]
|
||||
[Column("Результат")]
|
||||
public string Result { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using Register_office.BaseClasses;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Windows.Forms.Design.Behavior;
|
||||
|
||||
namespace Register_office.Model;
|
||||
|
||||
public partial class Disease : IUnionId
|
||||
{
|
||||
public object GetId() => DiseaseId;
|
||||
|
||||
[Display(Name = "hide")]
|
||||
public int DiseaseId { get; set; }
|
||||
|
||||
[Display(Name = "Название")]
|
||||
public string Name { get; set; } = null!;
|
||||
|
||||
[Display(Name = "Код МКБ")]
|
||||
public string IcdCode { get; set; } = null!;
|
||||
|
||||
[Browsable(false)]
|
||||
public virtual ICollection<DiseaseSyndrome> DiseaseSyndromes { get; set; } = new List<DiseaseSyndrome>();
|
||||
|
||||
[Browsable(false)]
|
||||
public virtual ICollection<HospitalAdmission> HospitalAdmissions { get; set; } = new List<HospitalAdmission>();
|
||||
|
||||
[Browsable(false)]
|
||||
public virtual ICollection<HospitalDischarge> HospitalDischarges { get; set; } = new List<HospitalDischarge>();
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
using Register_office.BaseClasses;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Register_office.Model;
|
||||
|
||||
public partial class DiseaseSyndrome : IUnionId
|
||||
{
|
||||
public object GetId() => DiseaseSyndromeId;
|
||||
|
||||
public int DiseaseSyndromeId { get; set; }
|
||||
|
||||
public int DiseaseId { get; set; }
|
||||
|
||||
public int SyndromeId { get; set; }
|
||||
|
||||
public virtual Disease Disease { get; set; } = null!;
|
||||
|
||||
public virtual SyndromeType Syndrome { get; set; } = null!;
|
||||
}
|
||||
|
||||
internal class DiseaseSyndromeWrapper
|
||||
{
|
||||
[Display(Name = "hide")]
|
||||
public int DiseaseSyndromeId { get; set; }
|
||||
|
||||
[Display(Name = "hide")]
|
||||
public int DiseaseId { get; set; }
|
||||
|
||||
[Display(Name = "hide")]
|
||||
public int SyndromeId { get; set; }
|
||||
|
||||
[Display(Name = "Заболевание")]
|
||||
public string DiseaseName { get; set; } = null!;
|
||||
|
||||
[Display(Name = "Синдром")]
|
||||
public string SyndromeName { get; set; } = null!;
|
||||
|
||||
public DiseaseSyndromeWrapper(DiseaseSyndrome src)
|
||||
{
|
||||
DiseaseSyndromeId = src.DiseaseSyndromeId;
|
||||
DiseaseId = src.DiseaseId;
|
||||
SyndromeId = src.SyndromeId;
|
||||
DiseaseName = src.Disease.Name;
|
||||
SyndromeName = src.Syndrome.Name;
|
||||
}
|
||||
|
||||
internal static List<DiseaseSyndromeWrapper> ToList(List<DiseaseSyndrome> src)
|
||||
{
|
||||
List<DiseaseSyndromeWrapper> res = [];
|
||||
|
||||
foreach (DiseaseSyndrome lst in src)
|
||||
{
|
||||
res.Add(new DiseaseSyndromeWrapper(lst));
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Register_office.Model;
|
||||
|
||||
public partial class Doctor
|
||||
{
|
||||
[Display(Name = "hide")]
|
||||
public int DoctorId { get; set; }
|
||||
|
||||
[Display(Name = "Данные")]
|
||||
public virtual Person DoctorNavigation { get; set; } = null!;
|
||||
|
||||
[Browsable(false)]
|
||||
public virtual ICollection<Prescription> Prescriptions { get; set; } = new List<Prescription>();
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using Register_office.BaseClasses;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Register_office.Model;
|
||||
|
||||
public partial class DrugIntakeMethod : IUnionId
|
||||
{
|
||||
public object GetId() => DrugIntakeMethodId;
|
||||
|
||||
[Display(Name = "hide")]
|
||||
public int DrugIntakeMethodId { get; set; }
|
||||
|
||||
[Display(Name = "Название")]
|
||||
public string Name { get; set; } = null!;
|
||||
|
||||
[Browsable(false)]
|
||||
public virtual ICollection<DrugTypePrescription> DrugTypePrescriptions { get; set; } = new List<DrugTypePrescription>();
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using Register_office.BaseClasses;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Register_office.Model;
|
||||
|
||||
public partial class DrugType : IUnionId
|
||||
{
|
||||
public object GetId() => DrugTypeId;
|
||||
|
||||
[Display(Name = "hide")]
|
||||
public int DrugTypeId { get; set; }
|
||||
|
||||
[Display(Name = "Название на русском")]
|
||||
public string InternationalNameRu { get; set; } = null!;
|
||||
|
||||
[Display(Name = "Название на английском")]
|
||||
public string? InternationalNameEn { get; set; }
|
||||
|
||||
[Display(Name = "Название на латинском")]
|
||||
public string? InternationalNameLa { get; set; }
|
||||
|
||||
[Display(Name = "Брэнд")]
|
||||
public string? BrandNameRu { get; set; }
|
||||
|
||||
[Browsable(false)]
|
||||
public virtual ICollection<DrugTypePrescription> DrugTypePrescriptions { get; set; } = new List<DrugTypePrescription>();
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
using Register_office.BaseClasses;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Register_office.Model;
|
||||
|
||||
public partial class DrugTypePrescription : IUnionId
|
||||
{
|
||||
public object GetId() => DrugPrescriptionId;
|
||||
|
||||
public int DrugPrescriptionId { get; set; }
|
||||
|
||||
public int PrescriptionId { get; set; }
|
||||
|
||||
public int DrugTypeId { get; set; }
|
||||
|
||||
public decimal Dose { get; set; }
|
||||
|
||||
public int DoseUnitId { get; set; }
|
||||
|
||||
public int IntakeMethodId { get; set; }
|
||||
|
||||
public int DurationDays { get; set; }
|
||||
|
||||
public virtual Unit DoseUnit { get; set; } = null!;
|
||||
|
||||
public virtual DrugType DrugType { get; set; } = null!;
|
||||
|
||||
public virtual DrugIntakeMethod IntakeMethod { get; set; } = null!;
|
||||
|
||||
public virtual Prescription Prescription { get; set; } = null!;
|
||||
}
|
||||
|
||||
internal class DrugTypePrescriptionWrapper
|
||||
{
|
||||
[Display(Name = "hide")]
|
||||
public int DrugPrescriptionId { get; set; }
|
||||
|
||||
[Display(Name = "hide")]
|
||||
public int PrescriptionId { get; set; }
|
||||
|
||||
[Display(Name = "hide")]
|
||||
public int DrugTypeId { get; set; }
|
||||
|
||||
[Display(Name = "Лекарства")]
|
||||
public string DrugName { get; set; } = null!;
|
||||
|
||||
[Display(Name = "Количество")]
|
||||
public decimal Dose { get; set; }
|
||||
|
||||
[Display(Name = "hide")]
|
||||
public int DoseUnitId { get; set; }
|
||||
|
||||
[Display(Name = "Единица изм.")]
|
||||
public string UnitName { get; set; } = null!;
|
||||
|
||||
[Display(Name = "hide")]
|
||||
public int IntakeMethodId { get; set; }
|
||||
|
||||
[Display(Name = "Способ приема")]
|
||||
public string IntakeMethodName { get; set; } = null!;
|
||||
|
||||
[Display(Name = "Длительность")]
|
||||
public int DurationDays { get; set; }
|
||||
|
||||
public DrugTypePrescriptionWrapper(DrugTypePrescription src)
|
||||
{
|
||||
DrugPrescriptionId = src.DrugPrescriptionId;
|
||||
PrescriptionId = src.PrescriptionId;
|
||||
DrugTypeId = src.DrugTypeId;
|
||||
DrugName = src.DrugType.InternationalNameRu;
|
||||
Dose = src.Dose;
|
||||
DoseUnitId = src.DoseUnitId;
|
||||
UnitName = src.DoseUnit.Name;
|
||||
IntakeMethodId = src.IntakeMethodId;
|
||||
IntakeMethodName = src.IntakeMethod.Name;
|
||||
DurationDays = src.DurationDays;
|
||||
}
|
||||
|
||||
internal static List<DrugTypePrescriptionWrapper> ToList(List<DrugTypePrescription> src)
|
||||
{
|
||||
List<DrugTypePrescriptionWrapper> res = [];
|
||||
|
||||
foreach (DrugTypePrescription lst in src)
|
||||
{
|
||||
res.Add(new DrugTypePrescriptionWrapper(lst));
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Register_office.Model
|
||||
{
|
||||
public enum ExaminationCategories
|
||||
{
|
||||
Physical, // физикальное обследование
|
||||
Laboratory, // лабораторное обследование
|
||||
Instrumental // инструментальное обследование
|
||||
}
|
||||
|
||||
public enum HospitalDischargeReasonEnum
|
||||
{
|
||||
Death, // смерть
|
||||
Improvement, // улучшение состояния
|
||||
Refusal // отказ от госпитализации или дальнейшего лечения
|
||||
}
|
||||
|
||||
public enum GenderEnum
|
||||
{
|
||||
Male, // мужчина
|
||||
Female // женщина
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
using Register_office.BaseClasses;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Register_office.Model;
|
||||
|
||||
public partial class ExaminationType : IUnionId
|
||||
{
|
||||
public object GetId() => ExaminationTypeId;
|
||||
|
||||
[Display(Name = "hide")]
|
||||
public int ExaminationTypeId { get; set; }
|
||||
|
||||
[Display(Name = "Название")]
|
||||
public string Name { get; set; } = null!;
|
||||
|
||||
[Display(Name = "Категория")]
|
||||
public string Category { get; set; } = null!;
|
||||
|
||||
[Browsable(false)]
|
||||
public virtual ICollection<ExaminationTypePrescription> ExaminationTypePrescriptions { get; set; } = new List<ExaminationTypePrescription>();
|
||||
|
||||
[Browsable(false)]
|
||||
public virtual ICollection<ReferenceValue> ReferenceValues { get; set; } = new List<ReferenceValue>();
|
||||
|
||||
[Browsable(false)]
|
||||
public virtual Result? Result { get; set; }
|
||||
|
||||
[Browsable(false)]
|
||||
public virtual SyndromeExaminationType? SyndromeExaminationType { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
using Register_office.BaseClasses;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Register_office.Model;
|
||||
|
||||
public partial class ExaminationTypePrescription : IUnionId
|
||||
{
|
||||
public object GetId() => ExaminationPrescriptionId;
|
||||
|
||||
public int ExaminationPrescriptionId { get; set; }
|
||||
|
||||
public int PrescriptionId { get; set; }
|
||||
|
||||
public int? ResultId { get; set; }
|
||||
|
||||
public int ExaminationTypeId { get; set; }
|
||||
|
||||
public virtual ExaminationType ExaminationType { get; set; } = null!;
|
||||
|
||||
public virtual Prescription Prescription { get; set; } = null!;
|
||||
|
||||
public virtual Result? Result { get; set; }
|
||||
}
|
||||
|
||||
internal class ExaminationTypePrescriptionWrapper
|
||||
{
|
||||
[Display(Name = "hide")]
|
||||
public int ExaminationPrescriptionId { get; set; }
|
||||
|
||||
[Display(Name = "hide")]
|
||||
public int PrescriptionId { get; set; }
|
||||
|
||||
[Display(Name = "hide")]
|
||||
public int? ResultId { get; set; }
|
||||
|
||||
[Display(Name = "hide")]
|
||||
public int ExaminationTypeId { get; set; }
|
||||
|
||||
[Display(Name = "Результат")]
|
||||
public string Result { get; set; } = null!;
|
||||
|
||||
[Display(Name = "Обследование")]
|
||||
public string ExaminationName { get; set; } = null!;
|
||||
|
||||
public ExaminationTypePrescriptionWrapper(ExaminationTypePrescription src)
|
||||
{
|
||||
ExaminationPrescriptionId = src.ExaminationPrescriptionId;
|
||||
PrescriptionId = src.PrescriptionId;
|
||||
ResultId = src.ResultId;
|
||||
ExaminationTypeId = src.ExaminationTypeId;
|
||||
if (src.Result != null)
|
||||
Result = new ResultWrapper(src.Result).Result;
|
||||
ExaminationName = src.ExaminationType.Name;
|
||||
}
|
||||
|
||||
internal static List<ExaminationTypePrescriptionWrapper> ToList(List<ExaminationTypePrescription> src)
|
||||
{
|
||||
List<ExaminationTypePrescriptionWrapper> res = [];
|
||||
|
||||
foreach (ExaminationTypePrescription lst in src)
|
||||
{
|
||||
res.Add(new ExaminationTypePrescriptionWrapper(lst));
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
using Register_office.BaseClasses;
|
||||
using Register_office.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Register_office;
|
||||
|
||||
public partial class HospitalAdmission : IUnionId
|
||||
{
|
||||
public object GetId() => HospitalAdmissionId;
|
||||
|
||||
public int HospitalAdmissionId { get; set; }
|
||||
|
||||
public int PatientId { get; set; }
|
||||
|
||||
public int PreliminaryDiseaseId { get; set; }
|
||||
|
||||
public DateTime AdmissionDatetime { get; set; }
|
||||
|
||||
public virtual ICollection<HospitalDischarge> HospitalDischarges { get; set; } = new List<HospitalDischarge>();
|
||||
|
||||
public virtual Patient Patient { get; set; } = null!;
|
||||
|
||||
public virtual Disease PreliminaryDisease { get; set; } = null!;
|
||||
}
|
||||
|
||||
internal class HospitalAdmissionWrapper
|
||||
{
|
||||
[Display(Name = "hide")]
|
||||
public int HospitalAdmissionId { get; set; }
|
||||
|
||||
[Display(Name = "hide")]
|
||||
public int PatientId { get; set; }
|
||||
|
||||
[Display(Name = "hide")]
|
||||
public int PreliminaryDiseaseId { get; set; }
|
||||
|
||||
[Display(Name = "Пациент")]
|
||||
public string PatientName { get; set; } = null!;
|
||||
|
||||
[Display(Name = "Заболевание")]
|
||||
public string DiseaseName { get; set; } = null!;
|
||||
|
||||
[Display(Name = "Время")]
|
||||
public DateTime AdmissionDatetime { get; set; }
|
||||
|
||||
public HospitalAdmissionWrapper(HospitalAdmission src)
|
||||
{
|
||||
HospitalAdmissionId = src.HospitalAdmissionId;
|
||||
PatientId = src.PatientId;
|
||||
PreliminaryDiseaseId = src.PreliminaryDiseaseId;
|
||||
DiseaseName = src.PreliminaryDisease.Name;
|
||||
AdmissionDatetime = src.AdmissionDatetime;
|
||||
Person p = src.Patient.PatientNavigation;
|
||||
PatientName = p.LastName + " " + p.FirstName + " " + p.MiddleName;
|
||||
}
|
||||
|
||||
internal static List<HospitalAdmissionWrapper> ToList(List<HospitalAdmission> src)
|
||||
{
|
||||
List<HospitalAdmissionWrapper> res = [];
|
||||
|
||||
foreach (HospitalAdmission lst in src)
|
||||
{
|
||||
res.Add(new HospitalAdmissionWrapper(lst));
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
using Register_office.BaseClasses;
|
||||
using Register_office.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Register_office;
|
||||
|
||||
public partial class HospitalDischarge : IUnionId
|
||||
{
|
||||
public object GetId() => HospitalDischargeId;
|
||||
|
||||
public int HospitalDischargeId { get; set; }
|
||||
|
||||
public int HospitalAdmissionId { get; set; }
|
||||
|
||||
public DateTime DischargeDatetime { get; set; }
|
||||
|
||||
public int FinalDiseaseId { get; set; }
|
||||
|
||||
public string Reason { get; set; } = null!;
|
||||
|
||||
public virtual Disease FinalDisease { get; set; } = null!;
|
||||
|
||||
public virtual HospitalAdmission HospitalAdmission { get; set; } = null!;
|
||||
}
|
||||
|
||||
internal class HospitalDischargeWrapper
|
||||
{
|
||||
[Display(Name = "hide")]
|
||||
public int HospitalDischargeId { get; set; }
|
||||
|
||||
[Display(Name = "hide")]
|
||||
public int HospitalAdmissionId { get; set; }
|
||||
|
||||
[Display(Name = "Пациент")]
|
||||
public string PatientName { get; set; } = null!;
|
||||
|
||||
[Display(Name = "Предв. заболевание")]
|
||||
public string DiseasePrName { get; set; } = null!;
|
||||
|
||||
[Display(Name = "Финал. заболевание")]
|
||||
public string DiseaseFinName { get; set; } = null!;
|
||||
|
||||
[Display(Name = "Время")]
|
||||
public DateTime DischargeDatetime { get; set; }
|
||||
|
||||
[Display(Name = "Причина завершения")]
|
||||
public string Reason { get; set; } = null!;
|
||||
|
||||
public HospitalDischargeWrapper(HospitalDischarge src)
|
||||
{
|
||||
HospitalAdmissionId = src.HospitalAdmissionId;
|
||||
HospitalDischargeId = src.HospitalDischargeId;
|
||||
DiseasePrName = src.HospitalAdmission.PreliminaryDisease.Name;
|
||||
DiseaseFinName = src.FinalDisease.Name;
|
||||
DischargeDatetime = src.DischargeDatetime;
|
||||
Reason = src.Reason;
|
||||
Person p = src.HospitalAdmission.Patient.PatientNavigation;
|
||||
PatientName = p.LastName + " " + p.FirstName + " " + p.MiddleName;
|
||||
}
|
||||
|
||||
internal static List<HospitalDischargeWrapper> ToList(List<HospitalDischarge> src)
|
||||
{
|
||||
List<HospitalDischargeWrapper> res = [];
|
||||
|
||||
foreach (HospitalDischarge lst in src)
|
||||
{
|
||||
res.Add(new HospitalDischargeWrapper(lst));
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using Register_office.BaseClasses;
|
||||
using Register_office.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Register_office;
|
||||
|
||||
public partial class NumericResult : IUnionId
|
||||
{
|
||||
public object GetId() => ResultId;
|
||||
|
||||
public int ResultId { get; set; }
|
||||
|
||||
public decimal Value { get; set; }
|
||||
|
||||
public int UnitId { get; set; }
|
||||
|
||||
public virtual Result Result { get; set; } = null!;
|
||||
|
||||
public virtual Unit Unit { get; set; } = null!;
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
using Register_office.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Register_office;
|
||||
|
||||
public partial class Patient
|
||||
{
|
||||
public int PatientId { get; set; }
|
||||
|
||||
public string PolicyNumber { get; set; } = null!;
|
||||
|
||||
public virtual ICollection<HospitalAdmission> HospitalAdmissions { get; set; } = new List<HospitalAdmission>();
|
||||
|
||||
public virtual Person PatientNavigation { get; set; } = null!;
|
||||
|
||||
public virtual ICollection<Prescription> Prescriptions { get; set; } = new List<Prescription>();
|
||||
}
|
||||
|
||||
internal class PatientWrapper
|
||||
{
|
||||
[Display(Name = "hide")]
|
||||
public int PatientId { get; set; }
|
||||
|
||||
[Display(Name = "Полис")]
|
||||
public string PolicyNumber { get; set; } = null!;
|
||||
|
||||
[Display(Name = "Отчество")]
|
||||
public string LastName { get; set; } = null!;
|
||||
|
||||
[Display(Name = "Имя")]
|
||||
public string FirstName { get; set; } = null!;
|
||||
|
||||
[Display(Name = "Фамилия")]
|
||||
public string? MiddleName { get; set; }
|
||||
|
||||
[Display(Name = "Дата рождения")]
|
||||
public DateOnly BirthDate { get; set; }
|
||||
|
||||
[Display(Name = "Адрес")]
|
||||
public string Address { get; set; } = null!;
|
||||
|
||||
[Display(Name = "Пол")]
|
||||
public string Gender { get; set; } = null!;
|
||||
|
||||
public PatientWrapper(Patient src)
|
||||
{
|
||||
PatientId = src.PatientId;
|
||||
PolicyNumber = src.PolicyNumber;
|
||||
Person p = src.PatientNavigation;
|
||||
LastName = p.LastName;
|
||||
FirstName = p.FirstName;
|
||||
MiddleName = p.MiddleName;
|
||||
BirthDate = p.BirthDate;
|
||||
Address = p.Address;
|
||||
Gender = p.Gender;
|
||||
}
|
||||
|
||||
internal static List<PatientWrapper> ToList(List<Patient> src)
|
||||
{
|
||||
List<PatientWrapper> res = [];
|
||||
|
||||
foreach (Patient lst in src)
|
||||
{
|
||||
res.Add(new PatientWrapper(lst));
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
using Register_office.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Register_office;
|
||||
|
||||
public partial class Person
|
||||
{
|
||||
[Display(Name = "hide")]
|
||||
public int PersonId { get; set; }
|
||||
|
||||
[Display(Name = "Отчество")]
|
||||
public string LastName { get; set; } = null!;
|
||||
|
||||
[Display(Name = "Имя")]
|
||||
public string FirstName { get; set; } = null!;
|
||||
|
||||
[Display(Name = "Фамилия")]
|
||||
public string? MiddleName { get; set; }
|
||||
|
||||
[Display(Name = "Дата рождения")]
|
||||
public DateOnly BirthDate { get; set; }
|
||||
|
||||
[Display(Name = "Адрес")]
|
||||
public string Address { get; set; } = null!;
|
||||
|
||||
[Display(Name = "Пол")]
|
||||
public string Gender { get; set; } = null!;
|
||||
|
||||
[Browsable(false)]
|
||||
public virtual Doctor? Doctor { get; set; }
|
||||
|
||||
[Browsable(false)]
|
||||
public virtual Patient? Patient { get; set; }
|
||||
|
||||
[Browsable(false)]
|
||||
public virtual Registrar? Registrar { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
using Register_office.BaseClasses;
|
||||
using Register_office.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Register_office;
|
||||
|
||||
public partial class Prescription : IUnionId
|
||||
{
|
||||
public object GetId() => PrescriptionId;
|
||||
|
||||
public int PrescriptionId { get; set; }
|
||||
|
||||
public int PatientId { get; set; }
|
||||
|
||||
public int DoctorId { get; set; }
|
||||
|
||||
public virtual Doctor Doctor { get; set; } = null!;
|
||||
|
||||
public virtual DrugTypePrescription? DrugTypePrescription { get; set; }
|
||||
|
||||
public virtual ExaminationTypePrescription? ExaminationTypePrescription { get; set; }
|
||||
|
||||
public virtual Patient Patient { get; set; } = null!;
|
||||
|
||||
public virtual ProcedureTypePrescription? ProcedureTypePrescription { get; set; }
|
||||
}
|
||||
|
||||
internal class PrescriptionWrapper
|
||||
{
|
||||
[Display(Name = "hide")]
|
||||
public int PrescriptionId { get; set; }
|
||||
|
||||
[Display(Name = "hide")]
|
||||
public int PatientId { get; set; }
|
||||
|
||||
[Display(Name = "hide")]
|
||||
public int DoctorId { get; set; }
|
||||
|
||||
[Display(Name = "Пациент")]
|
||||
public string PatientName { get; set; } = null!;
|
||||
|
||||
public PrescriptionWrapper(Prescription src)
|
||||
{
|
||||
PrescriptionId = src.PrescriptionId;
|
||||
PatientId = src.PatientId;
|
||||
DoctorId = src.DoctorId;
|
||||
Person p = src.Patient.PatientNavigation;
|
||||
PatientName = p.LastName + " " + p.FirstName + " " + p.MiddleName;
|
||||
}
|
||||
|
||||
internal static List<PrescriptionWrapper> ToList(List<Prescription> src)
|
||||
{
|
||||
List<PrescriptionWrapper> res = [];
|
||||
|
||||
foreach (Prescription lst in src)
|
||||
{
|
||||
res.Add(new PrescriptionWrapper(lst));
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using Register_office.BaseClasses;
|
||||
using Register_office.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Register_office;
|
||||
|
||||
public partial class ProcedureType : IUnionId
|
||||
{
|
||||
public object GetId() => ProcedureTypeId;
|
||||
|
||||
[Display(Name = "hide")]
|
||||
public int ProcedureTypeId { get; set; }
|
||||
|
||||
[Display(Name = "Название")]
|
||||
public string Name { get; set; } = null!;
|
||||
|
||||
[Browsable(false)]
|
||||
public virtual ICollection<ProcedureTypePrescription> ProcedureTypePrescriptions { get; set; } = new List<ProcedureTypePrescription>();
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
using Register_office.BaseClasses;
|
||||
using Register_office.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Register_office;
|
||||
|
||||
public partial class ProcedureTypePrescription : IUnionId
|
||||
{
|
||||
public object GetId() => ProcedurePrescriptionId;
|
||||
|
||||
public int ProcedurePrescriptionId { get; set; }
|
||||
|
||||
public int PrescriptionId { get; set; }
|
||||
|
||||
public int ProcedureTypeId { get; set; }
|
||||
|
||||
public DateTime ScheduledDatetime { get; set; }
|
||||
|
||||
public virtual Prescription Prescription { get; set; } = null!;
|
||||
|
||||
public virtual ProcedureType ProcedureType { get; set; } = null!;
|
||||
}
|
||||
|
||||
internal class ProcedureTypePrescriptionWrapper
|
||||
{
|
||||
[Display(Name = "hide")]
|
||||
public int ProcedurePrescriptionId { get; set; }
|
||||
|
||||
[Display(Name = "hide")]
|
||||
public int PrescriptionId { get; set; }
|
||||
|
||||
[Display(Name = "hide")]
|
||||
public int ProcedureTypeId { get; set; }
|
||||
|
||||
[Display(Name = "Запланированное время")]
|
||||
public DateTime ScheduledDatetime { get; set; }
|
||||
|
||||
[Display(Name = "Процедура")]
|
||||
public string ProcedureName { get; set; } = null!;
|
||||
|
||||
public ProcedureTypePrescriptionWrapper(ProcedureTypePrescription src)
|
||||
{
|
||||
ProcedurePrescriptionId = src.ProcedurePrescriptionId;
|
||||
PrescriptionId = src.PrescriptionId;
|
||||
ProcedureTypeId = src.ProcedureTypeId;
|
||||
ScheduledDatetime = src.ScheduledDatetime;
|
||||
ProcedureName = src.ProcedureType.Name;
|
||||
}
|
||||
|
||||
internal static List<ProcedureTypePrescriptionWrapper> ToList(List<ProcedureTypePrescription> src)
|
||||
{
|
||||
List<ProcedureTypePrescriptionWrapper> res = [];
|
||||
|
||||
foreach (ProcedureTypePrescription lst in src)
|
||||
{
|
||||
res.Add(new ProcedureTypePrescriptionWrapper(lst));
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using Register_office.BaseClasses;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Register_office.Model;
|
||||
|
||||
public partial class QualitativeResult : IUnionId
|
||||
{
|
||||
public object GetId() => ResultId;
|
||||
|
||||
public int ResultId { get; set; }
|
||||
|
||||
public bool Value { get; set; }
|
||||
|
||||
public virtual Result Result { get; set; } = null!;
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
using Register_office.BaseClasses;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Register_office.Model;
|
||||
|
||||
public partial class ReferenceNumericValue : IUnionId
|
||||
{
|
||||
public object GetId() => ReferenceValueId;
|
||||
|
||||
public int ReferenceValueId { get; set; }
|
||||
|
||||
public decimal? MinValue { get; set; }
|
||||
|
||||
public decimal? MaxValue { get; set; }
|
||||
|
||||
public int UnitId { get; set; }
|
||||
|
||||
public virtual ReferenceValue ReferenceValue { get; set; } = null!;
|
||||
|
||||
public virtual Unit Unit { get; set; } = null!;
|
||||
}
|
||||
|
||||
internal class ReferenceNumericValueWrapper
|
||||
{
|
||||
[Display(Name = "hide")]
|
||||
public int ReferenceValueId { get; set; }
|
||||
|
||||
[Display(Name = "Мин.")]
|
||||
public decimal? MinValue { get; set; }
|
||||
|
||||
[Display(Name = "Макс.")]
|
||||
public decimal? MaxValue { get; set; }
|
||||
|
||||
[Display(Name = "hide")]
|
||||
public int UnitId { get; set; }
|
||||
|
||||
[Display(Name = "Единица изм.")]
|
||||
public string UnitName { get; set; } = null!;
|
||||
|
||||
public ReferenceNumericValueWrapper(ReferenceNumericValue src)
|
||||
{
|
||||
ReferenceValueId = src.ReferenceValueId;
|
||||
MinValue = src.MinValue;
|
||||
MaxValue = src.MaxValue;
|
||||
UnitId = src.UnitId;
|
||||
UnitName = src.Unit.Name;
|
||||
}
|
||||
|
||||
internal static List<ReferenceNumericValueWrapper> ToList(List<ReferenceNumericValue> src)
|
||||
{
|
||||
List<ReferenceNumericValueWrapper> res = [];
|
||||
|
||||
foreach (ReferenceNumericValue lst in src)
|
||||
{
|
||||
res.Add(new ReferenceNumericValueWrapper(lst));
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using Register_office.BaseClasses;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Register_office.Model;
|
||||
|
||||
public partial class ReferenceQualitativeValue : IUnionId
|
||||
{
|
||||
public object GetId() => ReferenceValueId;
|
||||
|
||||
[Display(Name = "hide")]
|
||||
public int ReferenceValueId { get; set; }
|
||||
|
||||
[Display(Name = "Опис. наличия")]
|
||||
public string DescriptionTrue { get; set; } = null!;
|
||||
|
||||
[Display(Name = "Опис. отсутствия")]
|
||||
public string DescriptionFalse { get; set; } = null!;
|
||||
|
||||
[Browsable(false)]
|
||||
public virtual ReferenceValue ReferenceValue { get; set; } = null!;
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
using Register_office.BaseClasses;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Register_office.Model;
|
||||
|
||||
public partial class ReferenceValue : IUnionId
|
||||
{
|
||||
public object GetId() => ReferenceValueId;
|
||||
|
||||
public int ReferenceValueId { get; set; }
|
||||
|
||||
public int ExaminationTypeId { get; set; }
|
||||
|
||||
public int? AgeMin { get; set; }
|
||||
|
||||
public int? AgeMax { get; set; }
|
||||
|
||||
public string Gender { get; set; } = null!;
|
||||
|
||||
public virtual ExaminationType ExaminationType { get; set; } = null!;
|
||||
|
||||
public virtual ReferenceNumericValue? ReferenceNumericValue { get; set; }
|
||||
|
||||
public virtual ReferenceQualitativeValue? ReferenceQualitativeValue { get; set; }
|
||||
}
|
||||
|
||||
internal class ReferenceValueWrapper
|
||||
{
|
||||
[Display(Name = "hide")]
|
||||
public int ReferenceValueId { get; set; }
|
||||
|
||||
[Display(Name = "hide")]
|
||||
public int ExaminationTypeId { get; set; }
|
||||
|
||||
[Display(Name = "Мин. возраст")]
|
||||
public int? AgeMin { get; set; }
|
||||
|
||||
[Display(Name = "Макс. возраст")]
|
||||
public int? AgeMax { get; set; }
|
||||
|
||||
[Display(Name = "Обследование")]
|
||||
public string ExaminationName { get; set; } = null!;
|
||||
|
||||
[Display(Name = "Пол")]
|
||||
public string Gender { get; set; } = null!;
|
||||
|
||||
public ReferenceValueWrapper(ReferenceValue src)
|
||||
{
|
||||
ReferenceValueId = src.ReferenceValueId;
|
||||
ExaminationTypeId = src.ExaminationTypeId;
|
||||
AgeMin = src.AgeMin;
|
||||
AgeMax = src.AgeMax;
|
||||
ExaminationName = src.ExaminationType.Name;
|
||||
Gender = src.Gender;
|
||||
}
|
||||
|
||||
internal static List<ReferenceValueWrapper> ToList(List<ReferenceValue> src)
|
||||
{
|
||||
List<ReferenceValueWrapper> res = [];
|
||||
|
||||
foreach (ReferenceValue lst in src)
|
||||
{
|
||||
res.Add(new ReferenceValueWrapper(lst));
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Register_office.Model;
|
||||
|
||||
public partial class Registrar
|
||||
{
|
||||
[Display(Name = "hide")]
|
||||
public int RegistrarId { get; set; }
|
||||
|
||||
[Display(Name = "Данные")]
|
||||
public virtual Person RegistrarNavigation { get; set; } = null!;
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
using Register_office.BaseClasses;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Register_office.Model;
|
||||
|
||||
public partial class Result : IUnionId
|
||||
{
|
||||
public object GetId() => ResultId;
|
||||
|
||||
public int ResultId { get; set; }
|
||||
|
||||
public int ExaminationId { get; set; }
|
||||
|
||||
public virtual ExaminationType Examination { get; set; } = null!;
|
||||
|
||||
public virtual ICollection<ExaminationTypePrescription> ExaminationTypePrescriptions { get; set; } = new List<ExaminationTypePrescription>();
|
||||
|
||||
public virtual NumericResult? NumericResult { get; set; }
|
||||
|
||||
public virtual QualitativeResult? QualitativeResult { get; set; }
|
||||
}
|
||||
|
||||
internal class ResultWrapper
|
||||
{
|
||||
[Display(Name = "hide")]
|
||||
public int ResultId { get; set; }
|
||||
|
||||
[Display(Name = "hide")]
|
||||
public int ExaminationId { get; set; }
|
||||
|
||||
[Display(Name = "Обследование")]
|
||||
public string Examination { get; set; } = null!;
|
||||
|
||||
[Display(Name = "Результат")]
|
||||
public string Result { get; set; } = null!;
|
||||
|
||||
public ResultWrapper(Result src)
|
||||
{
|
||||
ResultId = src.ResultId;
|
||||
ExaminationId = src.ExaminationId;
|
||||
Examination = src.Examination.Name;
|
||||
Result = src.NumericResult != null
|
||||
? src.NumericResult.Value + " " + src.NumericResult.Unit
|
||||
: (src.QualitativeResult?.Value == true ? "Положительный" : "Отрициательный");
|
||||
}
|
||||
|
||||
internal static List<ResultWrapper> ToList(List<Result> src)
|
||||
{
|
||||
List<ResultWrapper> res = [];
|
||||
|
||||
foreach (Result lst in src)
|
||||
{
|
||||
res.Add(new ResultWrapper(lst));
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
using Register_office.BaseClasses;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Register_office.Model;
|
||||
|
||||
public partial class SyndromeExaminationType : IUnionId
|
||||
{
|
||||
public object GetId() => string.Concat(SyndromeId, ExaminationTypeId);
|
||||
|
||||
public int SyndromeId { get; set; }
|
||||
|
||||
public int ExaminationTypeId { get; set; }
|
||||
|
||||
public virtual ExaminationType ExaminationType { get; set; } = null!;
|
||||
|
||||
public virtual SyndromeType Syndrome { get; set; } = null!;
|
||||
}
|
||||
|
||||
internal class SyndromeExaminationTypeWrapper
|
||||
{
|
||||
[Display(Name = "hide")]
|
||||
public int SyndromeId { get; set; }
|
||||
|
||||
[Display(Name = "hide")]
|
||||
public int ExaminationTypeId { get; set; }
|
||||
|
||||
[Display(Name = "Синдром")]
|
||||
public string SyndromeName { get; set; } = null!;
|
||||
|
||||
[Display(Name = "Обследование")]
|
||||
public string ExaminationName { get; set; } = null!;
|
||||
|
||||
public SyndromeExaminationTypeWrapper(SyndromeExaminationType src)
|
||||
{
|
||||
SyndromeId = src.SyndromeId;
|
||||
ExaminationTypeId = src.ExaminationTypeId;
|
||||
SyndromeName = src.Syndrome.Name;
|
||||
ExaminationName = src.ExaminationType.Name;
|
||||
}
|
||||
|
||||
internal static List<SyndromeExaminationTypeWrapper> ToList(List<SyndromeExaminationType> src)
|
||||
{
|
||||
List<SyndromeExaminationTypeWrapper> res = [];
|
||||
|
||||
foreach (SyndromeExaminationType lst in src)
|
||||
{
|
||||
res.Add(new SyndromeExaminationTypeWrapper(lst));
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using Register_office.BaseClasses;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Register_office.Model;
|
||||
|
||||
public partial class SyndromeType : IUnionId
|
||||
{
|
||||
public object GetId() => SyndromeTypeId;
|
||||
|
||||
[Display(Name = "hide")]
|
||||
public int SyndromeTypeId { get; set; }
|
||||
|
||||
[Display(Name = "Название")]
|
||||
public string Name { get; set; } = null!;
|
||||
|
||||
[Browsable(false)]
|
||||
public virtual ICollection<DiseaseSyndrome> DiseaseSyndromes { get; set; } = new List<DiseaseSyndrome>();
|
||||
|
||||
[Browsable(false)]
|
||||
public virtual SyndromeExaminationType? SyndromeExaminationType { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using Register_office.BaseClasses;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Register_office.Model;
|
||||
|
||||
public partial class Unit : IUnionId
|
||||
{
|
||||
public object GetId() => UnitId;
|
||||
|
||||
[Display(Name = "hide")]
|
||||
public int UnitId { get; set; }
|
||||
|
||||
[Display(Name = "Название")]
|
||||
public string Name { get; set; } = null!;
|
||||
|
||||
[Browsable(false)]
|
||||
public virtual ICollection<DrugTypePrescription> DrugTypePrescriptions { get; set; } = new List<DrugTypePrescription>();
|
||||
|
||||
[Browsable(false)]
|
||||
public virtual ICollection<NumericResult> NumericResults { get; set; } = new List<NumericResult>();
|
||||
|
||||
[Browsable(false)]
|
||||
public virtual ICollection<ReferenceNumericValue> ReferenceNumericValues { get; set; } = new List<ReferenceNumericValue>();
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
using Register_office.Properties;
|
||||
using Register_office.View.LoginV;
|
||||
using Register_office.View.MenuV;
|
||||
using Register_office.View.RegistrationV;
|
||||
using Register_office.ViewModel;
|
||||
|
||||
namespace Register_office
|
||||
{
|
||||
internal static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
// To customize application configuration such as set high DPI settings or default font,
|
||||
// see https://aka.ms/applicationconfiguration.
|
||||
ApplicationConfiguration.Initialize();
|
||||
if (!Init()) return;
|
||||
Application.Run(new LoginForm());
|
||||
}
|
||||
|
||||
private static bool Init()
|
||||
{
|
||||
GeneralViewModel.Instance.Initialize();
|
||||
while (!RegisterOfficeFactory.CanConnect)
|
||||
{
|
||||
MessageBox.Show("Îøèáêà ïîäêëþ÷åíèÿ ê áàçå äàííûõ! " +
|
||||
"Îáðàòèòåñü ê àäìèíèñòðàòîðó áàçû äàííûõ çà ïîìîùüþ íàñòðîéêè ïîäêëþ÷åíèÿ",
|
||||
"Ïîäêëþ÷åíèå ê áàçå äàííûõ", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
|
||||
ConnectionParametersForm form = new();
|
||||
|
||||
{
|
||||
form.tbHost.Text = Settings.Default.Host;
|
||||
form.tbDataBase.Text = Settings.Default.Database;
|
||||
form.tbUsername.Text = Settings.Default.Username;
|
||||
form.tbPassword.Text = Settings.Default.Password;
|
||||
}
|
||||
|
||||
|
||||
if (form.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
Settings.Default.Host = form.tbHost.Text;
|
||||
Settings.Default.Database = form.tbDataBase.Text;
|
||||
Settings.Default.Username = form.tbUsername.Text;
|
||||
Settings.Default.Password = form.tbPassword.Text;
|
||||
Settings.Default.Save();
|
||||
}
|
||||
else return false;
|
||||
GeneralViewModel.Instance.Initialize();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,556 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Register_office.Model;
|
||||
|
||||
namespace Register_office.Properties;
|
||||
|
||||
public partial class RegisterOfficeContext : DbContext
|
||||
{
|
||||
public RegisterOfficeContext()
|
||||
{
|
||||
}
|
||||
|
||||
public RegisterOfficeContext(DbContextOptions<RegisterOfficeContext> options)
|
||||
: base(options)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual DbSet<Disease> Diseases { get; set; }
|
||||
|
||||
public virtual DbSet<DiseaseSyndrome> DiseaseSyndromes { get; set; }
|
||||
|
||||
public virtual DbSet<Doctor> Doctors { get; set; }
|
||||
|
||||
public virtual DbSet<DrugIntakeMethod> DrugIntakeMethods { get; set; }
|
||||
|
||||
public virtual DbSet<DrugType> DrugTypes { get; set; }
|
||||
|
||||
public virtual DbSet<DrugTypePrescription> DrugTypePrescriptions { get; set; }
|
||||
|
||||
public virtual DbSet<ExaminationType> ExaminationTypes { get; set; }
|
||||
|
||||
public virtual DbSet<ExaminationTypePrescription> ExaminationTypePrescriptions { get; set; }
|
||||
|
||||
public virtual DbSet<HospitalAdmission> HospitalAdmissions { get; set; }
|
||||
|
||||
public virtual DbSet<HospitalDischarge> HospitalDischarges { get; set; }
|
||||
|
||||
public virtual DbSet<NumericResult> NumericResults { get; set; }
|
||||
|
||||
public virtual DbSet<Patient> Patients { get; set; }
|
||||
|
||||
public virtual DbSet<Person> People { get; set; }
|
||||
|
||||
public virtual DbSet<Prescription> Prescriptions { get; set; }
|
||||
|
||||
public virtual DbSet<ProcedureType> ProcedureTypes { get; set; }
|
||||
|
||||
public virtual DbSet<ProcedureTypePrescription> ProcedureTypePrescriptions { get; set; }
|
||||
|
||||
public virtual DbSet<QualitativeResult> QualitativeResults { get; set; }
|
||||
|
||||
public virtual DbSet<ReferenceNumericValue> ReferenceNumericValues { get; set; }
|
||||
|
||||
public virtual DbSet<ReferenceQualitativeValue> ReferenceQualitativeValues { get; set; }
|
||||
|
||||
public virtual DbSet<ReferenceValue> ReferenceValues { get; set; }
|
||||
|
||||
public virtual DbSet<Registrar> Registrars { get; set; }
|
||||
|
||||
public virtual DbSet<Result> Results { get; set; }
|
||||
|
||||
public virtual DbSet<SyndromeExaminationType> SyndromeExaminationTypes { get; set; }
|
||||
|
||||
public virtual DbSet<SyndromeType> SyndromeTypes { get; set; }
|
||||
|
||||
public virtual DbSet<Unit> Units { get; set; }
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
#warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see https://go.microsoft.com/fwlink/?LinkId=723263.
|
||||
=> optionsBuilder.UseNpgsql("Host=localhost;Port=5432;Database=register_office;Username=postgres;Password=slavik242");
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder
|
||||
.HasPostgresEnum("examination_categories_enum", new[] { "physical", "laboratory", "instrumental" })
|
||||
.HasPostgresEnum("gender_enum", new[] { "male", "female" })
|
||||
.HasPostgresEnum("hospital_discharge_reason_enum", new[] { "death", "improvement", "refusal" })
|
||||
.HasPostgresEnum("unit_context_enum", new[] { "examination", "medication" });
|
||||
|
||||
modelBuilder.Entity<Disease>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.DiseaseId).HasName("disease_pkey");
|
||||
|
||||
entity.ToTable("disease");
|
||||
|
||||
entity.HasIndex(e => e.IcdCode, "disease_icd_code_key").IsUnique();
|
||||
|
||||
entity.HasIndex(e => e.Name, "disease_name_key").IsUnique();
|
||||
|
||||
entity.Property(e => e.DiseaseId).HasColumnName("disease_id");
|
||||
entity.Property(e => e.IcdCode).HasColumnName("icd_code");
|
||||
entity.Property(e => e.Name).HasColumnName("name");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<DiseaseSyndrome>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.DiseaseSyndromeId).HasName("disease_syndrome_pkey");
|
||||
|
||||
entity.ToTable("disease_syndrome");
|
||||
|
||||
entity.HasIndex(e => new { e.DiseaseId, e.SyndromeId }, "disease_syndrome_disease_id_syndrome_id_key").IsUnique();
|
||||
|
||||
entity.Property(e => e.DiseaseSyndromeId).HasColumnName("disease_syndrome_id");
|
||||
entity.Property(e => e.DiseaseId).HasColumnName("disease_id");
|
||||
entity.Property(e => e.SyndromeId).HasColumnName("syndrome_id");
|
||||
|
||||
entity.HasOne(d => d.Disease).WithMany(p => p.DiseaseSyndromes)
|
||||
.HasForeignKey(d => d.DiseaseId)
|
||||
.HasConstraintName("disease_syndrome_disease_id_fkey");
|
||||
|
||||
entity.HasOne(d => d.Syndrome).WithMany(p => p.DiseaseSyndromes)
|
||||
.HasForeignKey(d => d.SyndromeId)
|
||||
.HasConstraintName("disease_syndrome_syndrome_id_fkey");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<Doctor>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.DoctorId).HasName("doctor_pkey");
|
||||
|
||||
entity.ToTable("doctor");
|
||||
|
||||
entity.Property(e => e.DoctorId)
|
||||
.ValueGeneratedNever()
|
||||
.HasColumnName("doctor_id");
|
||||
|
||||
entity.HasOne(d => d.DoctorNavigation).WithOne(p => p.Doctor)
|
||||
.HasForeignKey<Doctor>(d => d.DoctorId)
|
||||
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||
.HasConstraintName("doctor_doctor_id_fkey");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<DrugIntakeMethod>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.DrugIntakeMethodId).HasName("drug_intake_method_pkey");
|
||||
|
||||
entity.ToTable("drug_intake_method");
|
||||
|
||||
entity.HasIndex(e => e.Name, "drug_intake_method_name_key").IsUnique();
|
||||
|
||||
entity.Property(e => e.DrugIntakeMethodId).HasColumnName("drug_intake_method_id");
|
||||
entity.Property(e => e.Name).HasColumnName("name");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<DrugType>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.DrugTypeId).HasName("drug_type_pkey");
|
||||
|
||||
entity.ToTable("drug_type");
|
||||
|
||||
entity.HasIndex(e => e.BrandNameRu, "drug_type_brand_name_ru_key").IsUnique();
|
||||
|
||||
entity.HasIndex(e => e.InternationalNameEn, "drug_type_international_name_en_key").IsUnique();
|
||||
|
||||
entity.HasIndex(e => e.InternationalNameLa, "drug_type_international_name_la_key").IsUnique();
|
||||
|
||||
entity.HasIndex(e => e.InternationalNameRu, "drug_type_international_name_ru_key").IsUnique();
|
||||
|
||||
entity.Property(e => e.DrugTypeId).HasColumnName("drug_type_id");
|
||||
entity.Property(e => e.BrandNameRu).HasColumnName("brand_name_ru");
|
||||
entity.Property(e => e.InternationalNameEn).HasColumnName("international_name_en");
|
||||
entity.Property(e => e.InternationalNameLa).HasColumnName("international_name_la");
|
||||
entity.Property(e => e.InternationalNameRu).HasColumnName("international_name_ru");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<DrugTypePrescription>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.DrugPrescriptionId).HasName("drug_type_prescription_pkey");
|
||||
|
||||
entity.ToTable("drug_type_prescription");
|
||||
|
||||
entity.HasIndex(e => e.PrescriptionId, "drug_type_prescription_prescription_id_key").IsUnique();
|
||||
|
||||
entity.Property(e => e.DrugPrescriptionId).HasColumnName("drug_prescription_id");
|
||||
entity.Property(e => e.Dose).HasColumnName("dose");
|
||||
entity.Property(e => e.DoseUnitId).HasColumnName("dose_unit_id");
|
||||
entity.Property(e => e.DrugTypeId).HasColumnName("drug_type_id");
|
||||
entity.Property(e => e.DurationDays).HasColumnName("duration_days");
|
||||
entity.Property(e => e.IntakeMethodId).HasColumnName("intake_method_id");
|
||||
entity.Property(e => e.PrescriptionId).HasColumnName("prescription_id");
|
||||
|
||||
entity.HasOne(d => d.DoseUnit).WithMany(p => p.DrugTypePrescriptions)
|
||||
.HasForeignKey(d => d.DoseUnitId)
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.HasConstraintName("drug_type_prescription_dose_unit_id_fkey");
|
||||
|
||||
entity.HasOne(d => d.DrugType).WithMany(p => p.DrugTypePrescriptions)
|
||||
.HasForeignKey(d => d.DrugTypeId)
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.HasConstraintName("drug_type_prescription_drug_type_id_fkey");
|
||||
|
||||
entity.HasOne(d => d.IntakeMethod).WithMany(p => p.DrugTypePrescriptions)
|
||||
.HasForeignKey(d => d.IntakeMethodId)
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.HasConstraintName("drug_type_prescription_intake_method_id_fkey");
|
||||
|
||||
entity.HasOne(d => d.Prescription).WithOne(p => p.DrugTypePrescription)
|
||||
.HasForeignKey<DrugTypePrescription>(d => d.PrescriptionId)
|
||||
.HasConstraintName("drug_type_prescription_prescription_id_fkey");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<ExaminationType>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.ExaminationTypeId).HasName("examination_type_pkey");
|
||||
|
||||
entity.ToTable("examination_type");
|
||||
|
||||
entity.HasIndex(e => e.Name, "examination_type_name_key").IsUnique();
|
||||
|
||||
entity.Property(e => e.ExaminationTypeId).HasColumnName("examination_type_id");
|
||||
entity.Property(e => e.Name).HasColumnName("name");
|
||||
entity.Property(e => e.Category).HasColumnName("category");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<ExaminationTypePrescription>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.ExaminationPrescriptionId).HasName("examination_type_prescription_pkey");
|
||||
|
||||
entity.ToTable("examination_type_prescription");
|
||||
|
||||
entity.HasIndex(e => e.PrescriptionId, "examination_type_prescription_prescription_id_key").IsUnique();
|
||||
|
||||
entity.Property(e => e.ExaminationPrescriptionId).HasColumnName("examination_prescription_id");
|
||||
entity.Property(e => e.ExaminationTypeId).HasColumnName("examination_type_id");
|
||||
entity.Property(e => e.PrescriptionId).HasColumnName("prescription_id");
|
||||
entity.Property(e => e.ResultId).HasColumnName("result_id");
|
||||
|
||||
entity.HasOne(d => d.ExaminationType).WithMany(p => p.ExaminationTypePrescriptions)
|
||||
.HasForeignKey(d => d.ExaminationTypeId)
|
||||
.HasConstraintName("examination_type_prescription_examination_type_id_fkey");
|
||||
|
||||
entity.HasOne(d => d.Prescription).WithOne(p => p.ExaminationTypePrescription)
|
||||
.HasForeignKey<ExaminationTypePrescription>(d => d.PrescriptionId)
|
||||
.HasConstraintName("examination_type_prescription_prescription_id_fkey");
|
||||
|
||||
entity.HasOne(d => d.Result).WithMany(p => p.ExaminationTypePrescriptions)
|
||||
.HasForeignKey(d => d.ResultId)
|
||||
.HasConstraintName("examination_type_prescription_result_id_fkey");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<HospitalAdmission>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.HospitalAdmissionId).HasName("hospital_admission_pkey");
|
||||
|
||||
entity.ToTable("hospital_admission");
|
||||
|
||||
entity.Property(e => e.HospitalAdmissionId).HasColumnName("hospital_admission_id");
|
||||
entity.Property(e => e.AdmissionDatetime)
|
||||
.HasColumnType("timestamp without time zone")
|
||||
.HasColumnName("admission_datetime");
|
||||
entity.Property(e => e.PatientId).HasColumnName("patient_id");
|
||||
entity.Property(e => e.PreliminaryDiseaseId).HasColumnName("preliminary_disease_id");
|
||||
|
||||
entity.HasOne(d => d.Patient).WithMany(p => p.HospitalAdmissions)
|
||||
.HasForeignKey(d => d.PatientId)
|
||||
.HasConstraintName("hospital_admission_patient_id_fkey");
|
||||
|
||||
entity.HasOne(d => d.PreliminaryDisease).WithMany(p => p.HospitalAdmissions)
|
||||
.HasForeignKey(d => d.PreliminaryDiseaseId)
|
||||
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||
.HasConstraintName("hospital_admission_preliminary_disease_id_fkey");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<HospitalDischarge>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.HospitalDischargeId).HasName("hospital_discharge_pkey");
|
||||
|
||||
entity.ToTable("hospital_discharge");
|
||||
|
||||
entity.Property(e => e.HospitalDischargeId).HasColumnName("hospital_discharge_id");
|
||||
entity.Property(e => e.DischargeDatetime)
|
||||
.HasColumnType("timestamp without time zone")
|
||||
.HasColumnName("discharge_datetime");
|
||||
entity.Property(e => e.FinalDiseaseId).HasColumnName("final_disease_id");
|
||||
entity.Property(e => e.HospitalAdmissionId).HasColumnName("hospital_admission_id");
|
||||
entity.Property(e => e.Reason).HasColumnName("reason");
|
||||
|
||||
entity.HasOne(d => d.FinalDisease).WithMany(p => p.HospitalDischarges)
|
||||
.HasForeignKey(d => d.FinalDiseaseId)
|
||||
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||
.HasConstraintName("hospital_discharge_final_disease_id_fkey");
|
||||
|
||||
entity.HasOne(d => d.HospitalAdmission).WithMany(p => p.HospitalDischarges)
|
||||
.HasForeignKey(d => d.HospitalAdmissionId)
|
||||
.HasConstraintName("hospital_discharge_hospital_admission_id_fkey");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<NumericResult>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.ResultId).HasName("numeric_result_pkey");
|
||||
|
||||
entity.ToTable("numeric_result");
|
||||
|
||||
entity.Property(e => e.ResultId)
|
||||
.ValueGeneratedNever()
|
||||
.HasColumnName("result_id");
|
||||
entity.Property(e => e.UnitId).HasColumnName("unit_id");
|
||||
entity.Property(e => e.Value).HasColumnName("value");
|
||||
|
||||
entity.HasOne(d => d.Result).WithOne(p => p.NumericResult)
|
||||
.HasForeignKey<NumericResult>(d => d.ResultId)
|
||||
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||
.HasConstraintName("numeric_result_result_id_fkey");
|
||||
|
||||
entity.HasOne(d => d.Unit).WithMany(p => p.NumericResults)
|
||||
.HasForeignKey(d => d.UnitId)
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.HasConstraintName("numeric_result_unit_id_fkey");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<Patient>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.PatientId).HasName("patient_pkey");
|
||||
|
||||
entity.ToTable("patient");
|
||||
|
||||
entity.Property(e => e.PatientId)
|
||||
.ValueGeneratedNever()
|
||||
.HasColumnName("patient_id");
|
||||
entity.Property(e => e.PolicyNumber).HasColumnName("policy_number");
|
||||
|
||||
entity.HasOne(d => d.PatientNavigation).WithOne(p => p.Patient)
|
||||
.HasForeignKey<Patient>(d => d.PatientId)
|
||||
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||
.HasConstraintName("patient_patient_id_fkey");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<Person>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.PersonId).HasName("person_pkey");
|
||||
|
||||
entity.ToTable("person");
|
||||
|
||||
entity.Property(e => e.PersonId).HasColumnName("person_id");
|
||||
entity.Property(e => e.Address).HasColumnName("address");
|
||||
entity.Property(e => e.BirthDate).HasColumnName("birth_date");
|
||||
entity.Property(e => e.FirstName).HasColumnName("first_name");
|
||||
entity.Property(e => e.LastName).HasColumnName("last_name");
|
||||
entity.Property(e => e.MiddleName).HasColumnName("middle_name");
|
||||
entity.Property(e => e.Gender).HasColumnName(name: "gender");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<Prescription>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.PrescriptionId).HasName("prescription_pkey");
|
||||
|
||||
entity.ToTable("prescription");
|
||||
|
||||
entity.Property(e => e.PrescriptionId).HasColumnName("prescription_id");
|
||||
entity.Property(e => e.DoctorId).HasColumnName("doctor_id");
|
||||
entity.Property(e => e.PatientId).HasColumnName("patient_id");
|
||||
|
||||
entity.HasOne(d => d.Doctor).WithMany(p => p.Prescriptions)
|
||||
.HasForeignKey(d => d.DoctorId)
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.HasConstraintName("prescription_doctor_id_fkey");
|
||||
|
||||
entity.HasOne(d => d.Patient).WithMany(p => p.Prescriptions)
|
||||
.HasForeignKey(d => d.PatientId)
|
||||
.HasConstraintName("prescription_patient_id_fkey");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<ProcedureType>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.ProcedureTypeId).HasName("procedure_type_pkey");
|
||||
|
||||
entity.ToTable("procedure_type");
|
||||
|
||||
entity.HasIndex(e => e.Name, "procedure_type_name_key").IsUnique();
|
||||
|
||||
entity.Property(e => e.ProcedureTypeId).HasColumnName("procedure_type_id");
|
||||
entity.Property(e => e.Name).HasColumnName("name");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<ProcedureTypePrescription>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.ProcedurePrescriptionId).HasName("procedure_type_prescription_pkey");
|
||||
|
||||
entity.ToTable("procedure_type_prescription");
|
||||
|
||||
entity.HasIndex(e => e.PrescriptionId, "procedure_type_prescription_prescription_id_key").IsUnique();
|
||||
|
||||
entity.Property(e => e.ProcedurePrescriptionId).HasColumnName("procedure_prescription_id");
|
||||
entity.Property(e => e.PrescriptionId).HasColumnName("prescription_id");
|
||||
entity.Property(e => e.ProcedureTypeId).HasColumnName("procedure_type_id");
|
||||
entity.Property(e => e.ScheduledDatetime)
|
||||
.HasColumnType("timestamp without time zone")
|
||||
.HasColumnName("scheduled_datetime");
|
||||
|
||||
entity.HasOne(d => d.Prescription).WithOne(p => p.ProcedureTypePrescription)
|
||||
.HasForeignKey<ProcedureTypePrescription>(d => d.PrescriptionId)
|
||||
.HasConstraintName("procedure_type_prescription_prescription_id_fkey");
|
||||
|
||||
entity.HasOne(d => d.ProcedureType).WithMany(p => p.ProcedureTypePrescriptions)
|
||||
.HasForeignKey(d => d.ProcedureTypeId)
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.HasConstraintName("procedure_type_prescription_procedure_type_id_fkey");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<QualitativeResult>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.ResultId).HasName("qualitative_result_pkey");
|
||||
|
||||
entity.ToTable("qualitative_result");
|
||||
|
||||
entity.Property(e => e.ResultId)
|
||||
.ValueGeneratedNever()
|
||||
.HasColumnName("result_id");
|
||||
entity.Property(e => e.Value).HasColumnName("value");
|
||||
|
||||
entity.HasOne(d => d.Result).WithOne(p => p.QualitativeResult)
|
||||
.HasForeignKey<QualitativeResult>(d => d.ResultId)
|
||||
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||
.HasConstraintName("qualitative_result_result_id_fkey");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<ReferenceNumericValue>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.ReferenceValueId).HasName("reference_numeric_value_pkey");
|
||||
|
||||
entity.ToTable("reference_numeric_value");
|
||||
|
||||
entity.Property(e => e.ReferenceValueId)
|
||||
.ValueGeneratedNever()
|
||||
.HasColumnName("reference_value_id");
|
||||
entity.Property(e => e.MaxValue).HasColumnName("max_value");
|
||||
entity.Property(e => e.MinValue).HasColumnName("min_value");
|
||||
entity.Property(e => e.UnitId).HasColumnName("unit_id");
|
||||
|
||||
entity.HasOne(d => d.ReferenceValue).WithOne(p => p.ReferenceNumericValue)
|
||||
.HasForeignKey<ReferenceNumericValue>(d => d.ReferenceValueId)
|
||||
.HasConstraintName("reference_numeric_value_reference_value_id_fkey");
|
||||
|
||||
entity.HasOne(d => d.Unit).WithMany(p => p.ReferenceNumericValues)
|
||||
.HasForeignKey(d => d.UnitId)
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.HasConstraintName("reference_numeric_value_unit_id_fkey");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<ReferenceQualitativeValue>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.ReferenceValueId).HasName("reference_qualitative_value_pkey");
|
||||
|
||||
entity.ToTable("reference_qualitative_value");
|
||||
|
||||
entity.HasIndex(e => new { e.DescriptionTrue, e.DescriptionFalse }, "reference_qualitative_value_description_true_description_fa_key").IsUnique();
|
||||
|
||||
entity.Property(e => e.ReferenceValueId)
|
||||
.ValueGeneratedNever()
|
||||
.HasColumnName("reference_value_id");
|
||||
entity.Property(e => e.DescriptionFalse).HasColumnName("description_false");
|
||||
entity.Property(e => e.DescriptionTrue).HasColumnName("description_true");
|
||||
|
||||
entity.HasOne(d => d.ReferenceValue).WithOne(p => p.ReferenceQualitativeValue)
|
||||
.HasForeignKey<ReferenceQualitativeValue>(d => d.ReferenceValueId)
|
||||
.HasConstraintName("reference_qualitative_value_reference_value_id_fkey");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<ReferenceValue>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.ReferenceValueId).HasName("reference_value_pkey");
|
||||
|
||||
entity.ToTable("reference_value");
|
||||
|
||||
entity.Property(e => e.ReferenceValueId).HasColumnName("reference_value_id");
|
||||
entity.Property(e => e.AgeMax).HasColumnName("age_max");
|
||||
entity.Property(e => e.AgeMin).HasColumnName("age_min");
|
||||
entity.Property(e => e.ExaminationTypeId).HasColumnName("examination_type_id");
|
||||
entity.Property(e => e.Gender).HasColumnName("gender");
|
||||
|
||||
entity.HasOne(d => d.ExaminationType).WithMany(p => p.ReferenceValues)
|
||||
.HasForeignKey(d => d.ExaminationTypeId)
|
||||
.HasConstraintName("reference_value_examination_type_id_fkey");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<Registrar>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.RegistrarId).HasName("registrar_pkey");
|
||||
|
||||
entity.ToTable("registrar");
|
||||
|
||||
entity.Property(e => e.RegistrarId)
|
||||
.ValueGeneratedNever()
|
||||
.HasColumnName("registrar_id");
|
||||
|
||||
entity.HasOne(d => d.RegistrarNavigation).WithOne(p => p.Registrar)
|
||||
.HasForeignKey<Registrar>(d => d.RegistrarId)
|
||||
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||
.HasConstraintName("registrar_registrar_id_fkey");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<Result>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.ResultId).HasName("result_pkey");
|
||||
|
||||
entity.ToTable("result");
|
||||
|
||||
entity.Property(e => e.ResultId).HasColumnName("result_id");
|
||||
entity.Property(e => e.ExaminationId).HasColumnName("examination_id");
|
||||
|
||||
entity.HasOne(d => d.Examination).WithOne(p => p.Result)
|
||||
.HasForeignKey<Result>(d => d.ExaminationId)
|
||||
.HasConstraintName("result_examination_id_fkey");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<SyndromeExaminationType>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.SyndromeId).HasName("syndrome_examination_type_pkey");
|
||||
|
||||
entity.ToTable("syndrome_examination_type");
|
||||
|
||||
entity.HasIndex(e => e.ExaminationTypeId, "syndrome_examination_type_examination_type_id_key").IsUnique();
|
||||
|
||||
entity.Property(e => e.SyndromeId)
|
||||
.ValueGeneratedNever()
|
||||
.HasColumnName("syndrome_id");
|
||||
entity.Property(e => e.ExaminationTypeId).HasColumnName("examination_type_id");
|
||||
|
||||
entity.HasOne(d => d.ExaminationType).WithOne(p => p.SyndromeExaminationType)
|
||||
.HasForeignKey<SyndromeExaminationType>(d => d.ExaminationTypeId)
|
||||
.HasConstraintName("syndrome_examination_type_examination_type_id_fkey");
|
||||
|
||||
entity.HasOne(d => d.Syndrome).WithOne(p => p.SyndromeExaminationType)
|
||||
.HasForeignKey<SyndromeExaminationType>(d => d.SyndromeId)
|
||||
.HasConstraintName("syndrome_examination_type_syndrome_id_fkey");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<SyndromeType>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.SyndromeTypeId).HasName("syndrome_type_pkey");
|
||||
|
||||
entity.ToTable("syndrome_type");
|
||||
|
||||
entity.HasIndex(e => e.Name, "syndrome_type_name_key").IsUnique();
|
||||
|
||||
entity.Property(e => e.SyndromeTypeId).HasColumnName("syndrome_type_id");
|
||||
entity.Property(e => e.Name).HasColumnName("name");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<Unit>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.UnitId).HasName("unit_pkey");
|
||||
|
||||
entity.ToTable("unit");
|
||||
|
||||
entity.HasIndex(e => e.Name, "unit_name_key").IsUnique();
|
||||
|
||||
entity.Property(e => e.UnitId).HasColumnName("unit_id");
|
||||
entity.Property(e => e.Name).HasColumnName("name");
|
||||
});
|
||||
|
||||
OnModelCreatingPartial(modelBuilder);
|
||||
}
|
||||
|
||||
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Npgsql;
|
||||
using Register_office.Properties;
|
||||
|
||||
namespace Register_office.Properties
|
||||
{
|
||||
internal class RegisterOfficeFactory
|
||||
{
|
||||
internal static bool CanConnect = false;
|
||||
internal static RegisterOfficeContext Create(string username, string password)
|
||||
{
|
||||
var builder = new NpgsqlConnectionStringBuilder()
|
||||
{
|
||||
Host = Settings.Default.Host,
|
||||
Database = Settings.Default.Database,
|
||||
Username = username,
|
||||
Password = password
|
||||
};
|
||||
|
||||
var optionsBuilder = new DbContextOptionsBuilder<RegisterOfficeContext>();
|
||||
optionsBuilder.UseNpgsql(builder.ToString());
|
||||
|
||||
RegisterOfficeContext dbContext = new(optionsBuilder.Options);
|
||||
CanConnect = dbContext.Database.CanConnect();
|
||||
|
||||
return dbContext;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Этот код создан программой.
|
||||
// Исполняемая версия:4.0.30319.42000
|
||||
//
|
||||
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
|
||||
// повторной генерации кода.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Register_office.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.14.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
||||
public string Host {
|
||||
get {
|
||||
return ((string)(this["Host"]));
|
||||
}
|
||||
set {
|
||||
this["Host"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
||||
public string Database {
|
||||
get {
|
||||
return ((string)(this["Database"]));
|
||||
}
|
||||
set {
|
||||
this["Database"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
||||
public string Username {
|
||||
get {
|
||||
return ((string)(this["Username"]));
|
||||
}
|
||||
set {
|
||||
this["Username"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
||||
public string Password {
|
||||
get {
|
||||
return ((string)(this["Password"]));
|
||||
}
|
||||
set {
|
||||
this["Password"] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="Apteka.Properties" GeneratedClassName="Settings">
|
||||
<Profiles />
|
||||
<Settings>
|
||||
<Setting Name="Host" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)" />
|
||||
</Setting>
|
||||
<Setting Name="Database" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)" />
|
||||
</Setting>
|
||||
<Setting Name="Username" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)" />
|
||||
</Setting>
|
||||
<Setting Name="Password" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)" />
|
||||
</Setting>
|
||||
</Settings>
|
||||
</SettingsFile>
|
||||
@@ -0,0 +1,91 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net8.0-windows</TargetFramework>
|
||||
<RootNamespace>Register_office</RootNamespace>
|
||||
<Nullable>enable</Nullable>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="EPPlus" Version="8.0.5" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.4" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.4">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.4" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="Properties\Settings.Designer.cs">
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="View\HospitalV\HospitalForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Update="View\HospitalV\HospitalDischargeDataForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Update="View\PatientV\PatientForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Update="View\PrescriptionsV\DrugDataForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Update="View\PrescriptionsV\ExaminationDataForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Update="View\PrescriptionsV\ProcedureDataForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Update="View\PrescriptionsV\PrescriptionForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Update="View\PrescriptionsV\ResultDataForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Update="View\TypesV\DrugTypeForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Update="View\TypesV\DiseaseSyndromeForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Update="View\TypesV\UnitForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Update="View\TypesV\SyndromeExaminationTypeForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Update="View\TypesV\SyndromeTypeForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Update="View\TypesV\ReferenceValueForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Update="View\TypesV\ProcedureTypeForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Update="View\TypesV\ExaminationTypeForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Update="View\TypesV\DrugIntakeMethodForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Update="View\TypesV\DiseaseForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
+158
@@ -0,0 +1,158 @@
|
||||
namespace Register_office.View.TypesV
|
||||
{
|
||||
partial class HospitalDischargeDataForm
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
cbDisease = new ComboBox();
|
||||
label1 = new Label();
|
||||
button2 = new Button();
|
||||
btnOK = new Button();
|
||||
dtpDischarge = new DateTimePicker();
|
||||
label6 = new Label();
|
||||
rtbReason = new RichTextBox();
|
||||
label2 = new Label();
|
||||
SuspendLayout();
|
||||
//
|
||||
// cbDisease
|
||||
//
|
||||
cbDisease.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
cbDisease.Font = new Font("Segoe UI", 12F);
|
||||
cbDisease.FormattingEnabled = true;
|
||||
cbDisease.Items.AddRange(new object[] { "Числовой", "Качественный" });
|
||||
cbDisease.Location = new Point(12, 37);
|
||||
cbDisease.Name = "cbDisease";
|
||||
cbDisease.Size = new Size(341, 29);
|
||||
cbDisease.TabIndex = 24;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
label1.AutoSize = true;
|
||||
label1.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label1.Location = new Point(12, 9);
|
||||
label1.Name = "label1";
|
||||
label1.Size = new Size(186, 25);
|
||||
label1.TabIndex = 25;
|
||||
label1.Text = "Финальный диагноз";
|
||||
//
|
||||
// button2
|
||||
//
|
||||
button2.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
||||
button2.DialogResult = DialogResult.Cancel;
|
||||
button2.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
button2.Location = new Point(192, 271);
|
||||
button2.Name = "button2";
|
||||
button2.Size = new Size(161, 42);
|
||||
button2.TabIndex = 27;
|
||||
button2.Text = "Отмена";
|
||||
button2.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// btnOK
|
||||
//
|
||||
btnOK.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
||||
btnOK.DialogResult = DialogResult.OK;
|
||||
btnOK.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnOK.Location = new Point(12, 271);
|
||||
btnOK.Name = "btnOK";
|
||||
btnOK.Size = new Size(161, 42);
|
||||
btnOK.TabIndex = 26;
|
||||
btnOK.Text = "Добавить";
|
||||
btnOK.UseVisualStyleBackColor = true;
|
||||
btnOK.Click += btnOK_Click;
|
||||
//
|
||||
// dtpDischarge
|
||||
//
|
||||
dtpDischarge.CustomFormat = "HH:mm dd.MM.yyyy";
|
||||
dtpDischarge.Font = new Font("Segoe UI", 12F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
dtpDischarge.Format = DateTimePickerFormat.Custom;
|
||||
dtpDischarge.Location = new Point(9, 97);
|
||||
dtpDischarge.MinDate = new DateTime(1940, 1, 1, 0, 0, 0, 0);
|
||||
dtpDischarge.Name = "dtpDischarge";
|
||||
dtpDischarge.Size = new Size(164, 29);
|
||||
dtpDischarge.TabIndex = 28;
|
||||
//
|
||||
// label6
|
||||
//
|
||||
label6.AutoSize = true;
|
||||
label6.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label6.Location = new Point(9, 69);
|
||||
label6.Name = "label6";
|
||||
label6.Size = new Size(164, 25);
|
||||
label6.TabIndex = 29;
|
||||
label6.Text = "Дата завершения";
|
||||
//
|
||||
// rtbReason
|
||||
//
|
||||
rtbReason.Font = new Font("Segoe UI", 12F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
rtbReason.Location = new Point(9, 157);
|
||||
rtbReason.Name = "rtbReason";
|
||||
rtbReason.Size = new Size(341, 96);
|
||||
rtbReason.TabIndex = 30;
|
||||
rtbReason.Text = "";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
label2.AutoSize = true;
|
||||
label2.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label2.Location = new Point(9, 129);
|
||||
label2.Name = "label2";
|
||||
label2.Size = new Size(202, 25);
|
||||
label2.TabIndex = 31;
|
||||
label2.Text = "Причина завершения";
|
||||
//
|
||||
// HospitalDischargeDataForm
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 17F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(365, 325);
|
||||
Controls.Add(label2);
|
||||
Controls.Add(rtbReason);
|
||||
Controls.Add(dtpDischarge);
|
||||
Controls.Add(label6);
|
||||
Controls.Add(button2);
|
||||
Controls.Add(btnOK);
|
||||
Controls.Add(cbDisease);
|
||||
Controls.Add(label1);
|
||||
Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
FormBorderStyle = FormBorderStyle.FixedToolWindow;
|
||||
Name = "HospitalDischargeDataForm";
|
||||
Text = "Завершение госпитализации";
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
internal ComboBox cbDisease;
|
||||
private Label label1;
|
||||
private Button button2;
|
||||
internal Button btnOK;
|
||||
internal DateTimePicker dtpDischarge;
|
||||
private Label label6;
|
||||
private RichTextBox rtbReason;
|
||||
private Label label2;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Register_office.Model;
|
||||
using Register_office.ViewModel;
|
||||
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 Register_office.View.TypesV
|
||||
{
|
||||
public partial class HospitalDischargeDataForm : Form
|
||||
{
|
||||
private HospitalViewModel _viewModel;
|
||||
private HospitalAdmission _hospitalAdmission;
|
||||
|
||||
public HospitalDischargeDataForm(HospitalAdmission h, bool isForAdd = true)
|
||||
{
|
||||
Init();
|
||||
_hospitalAdmission = h;
|
||||
if (!isForAdd) SetData(h);
|
||||
}
|
||||
|
||||
private void Init()
|
||||
{
|
||||
InitializeComponent();
|
||||
TopMost = true;
|
||||
_viewModel = new();
|
||||
SetDataSourceToComboBoxes();
|
||||
dtpDischarge.Value =
|
||||
dtpDischarge.MaxDate = DateTime.Now;
|
||||
}
|
||||
|
||||
private void SetData(HospitalAdmission ha)
|
||||
{
|
||||
HospitalDischarge hd = _viewModel.GetHospitalDischarge()
|
||||
.First(x => x.HospitalAdmissionId == ha.HospitalAdmissionId);
|
||||
cbDisease.SelectedValue = hd.FinalDiseaseId;
|
||||
rtbReason.Text = hd.Reason;
|
||||
dtpDischarge.Value = hd.DischargeDatetime;
|
||||
|
||||
Text = "Просмотр завершения госпитализации";
|
||||
btnOK.Visible = cbDisease.Enabled =
|
||||
rtbReason.Enabled = dtpDischarge.Enabled = false;
|
||||
}
|
||||
|
||||
private void SetDataSourceToComboBoxes()
|
||||
{
|
||||
cbDisease.DataSource = _viewModel.General.Context.Diseases
|
||||
.Select(x => new ComboBoxItem { Name = x.Name, Id = x.DiseaseId })
|
||||
.OrderBy(cbi => cbi.Name).ToList();
|
||||
cbDisease.DisplayMember = "Name";
|
||||
cbDisease.ValueMember = "Id";
|
||||
}
|
||||
|
||||
private void btnOK_Click(object sender, EventArgs e)
|
||||
{
|
||||
HospitalDischarge hd = new()
|
||||
{
|
||||
HospitalAdmissionId = _hospitalAdmission.HospitalAdmissionId,
|
||||
DischargeDatetime = dtpDischarge.Value,
|
||||
FinalDiseaseId = int.Parse(cbDisease.SelectedValue?.ToString() ?? "-1"),
|
||||
Reason = rtbReason.Text
|
||||
};
|
||||
if (_viewModel.AddHospital(hd) == -1)
|
||||
{
|
||||
DialogResult = DialogResult.None;
|
||||
return;
|
||||
}
|
||||
|
||||
MessageBox.Show("Госпитализация успешно завершена", "Завершение госпитализации",
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
Close();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -0,0 +1,263 @@
|
||||
using Register_office.View;
|
||||
|
||||
namespace Register_office.View.PatientV
|
||||
{
|
||||
partial class HospitalForm
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
components = new System.ComponentModel.Container();
|
||||
splitContainer1 = new SplitContainer();
|
||||
dtpArrive = new DateTimePicker();
|
||||
label6 = new Label();
|
||||
label3 = new Label();
|
||||
cbDisease = new ComboBox();
|
||||
label2 = new Label();
|
||||
cbPatient = new ComboBox();
|
||||
btnAddHospitalAdmission = new Button();
|
||||
btnUpdate = new Button();
|
||||
btnDelete = new Button();
|
||||
btnHospitalDischarge = new Button();
|
||||
dgv = new DataGridView();
|
||||
cmsMedicineProductCost = new ContextMenuStrip(components);
|
||||
cmsMedicineProduct = new ContextMenuStrip(components);
|
||||
((System.ComponentModel.ISupportInitialize)splitContainer1).BeginInit();
|
||||
splitContainer1.Panel1.SuspendLayout();
|
||||
splitContainer1.Panel2.SuspendLayout();
|
||||
splitContainer1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)dgv).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// splitContainer1
|
||||
//
|
||||
splitContainer1.Dock = DockStyle.Fill;
|
||||
splitContainer1.FixedPanel = FixedPanel.Panel1;
|
||||
splitContainer1.Location = new Point(0, 0);
|
||||
splitContainer1.Name = "splitContainer1";
|
||||
splitContainer1.Orientation = Orientation.Horizontal;
|
||||
//
|
||||
// splitContainer1.Panel1
|
||||
//
|
||||
splitContainer1.Panel1.Controls.Add(dtpArrive);
|
||||
splitContainer1.Panel1.Controls.Add(label6);
|
||||
splitContainer1.Panel1.Controls.Add(label3);
|
||||
splitContainer1.Panel1.Controls.Add(cbDisease);
|
||||
splitContainer1.Panel1.Controls.Add(label2);
|
||||
splitContainer1.Panel1.Controls.Add(cbPatient);
|
||||
splitContainer1.Panel1.Controls.Add(btnAddHospitalAdmission);
|
||||
splitContainer1.Panel1.Controls.Add(btnUpdate);
|
||||
splitContainer1.Panel1.Controls.Add(btnDelete);
|
||||
splitContainer1.Panel1.Controls.Add(btnHospitalDischarge);
|
||||
//
|
||||
// splitContainer1.Panel2
|
||||
//
|
||||
splitContainer1.Panel2.Controls.Add(dgv);
|
||||
splitContainer1.Size = new Size(800, 647);
|
||||
splitContainer1.SplitterDistance = 125;
|
||||
splitContainer1.SplitterWidth = 5;
|
||||
splitContainer1.TabIndex = 0;
|
||||
//
|
||||
// dtpArrive
|
||||
//
|
||||
dtpArrive.CustomFormat = "HH:mm dd.MM.yyyy";
|
||||
dtpArrive.Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
dtpArrive.Format = DateTimePickerFormat.Custom;
|
||||
dtpArrive.Location = new Point(232, 78);
|
||||
dtpArrive.MinDate = new DateTime(1940, 1, 1, 0, 0, 0, 0);
|
||||
dtpArrive.Name = "dtpArrive";
|
||||
dtpArrive.Size = new Size(139, 25);
|
||||
dtpArrive.TabIndex = 19;
|
||||
//
|
||||
// label6
|
||||
//
|
||||
label6.AutoSize = true;
|
||||
label6.Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label6.Location = new Point(232, 58);
|
||||
label6.Name = "label6";
|
||||
label6.Size = new Size(114, 17);
|
||||
label6.TabIndex = 20;
|
||||
label6.Text = "Дата поступления";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
label3.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
label3.AutoSize = true;
|
||||
label3.Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label3.Location = new Point(12, 58);
|
||||
label3.Name = "label3";
|
||||
label3.Size = new Size(127, 17);
|
||||
label3.TabIndex = 18;
|
||||
label3.Text = "Предварит. диагноз";
|
||||
//
|
||||
// cbDisease
|
||||
//
|
||||
cbDisease.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
cbDisease.FormattingEnabled = true;
|
||||
cbDisease.Items.AddRange(new object[] { "Физикальное", "Лабораторное", "Инструментальное" });
|
||||
cbDisease.Location = new Point(12, 78);
|
||||
cbDisease.Name = "cbDisease";
|
||||
cbDisease.Size = new Size(211, 25);
|
||||
cbDisease.TabIndex = 17;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
label2.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
label2.AutoSize = true;
|
||||
label2.Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label2.Location = new Point(12, 9);
|
||||
label2.Name = "label2";
|
||||
label2.Size = new Size(57, 17);
|
||||
label2.TabIndex = 16;
|
||||
label2.Text = "Пациент";
|
||||
//
|
||||
// cbPatient
|
||||
//
|
||||
cbPatient.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
cbPatient.FormattingEnabled = true;
|
||||
cbPatient.Items.AddRange(new object[] { "Физикальное", "Лабораторное", "Инструментальное" });
|
||||
cbPatient.Location = new Point(12, 30);
|
||||
cbPatient.Name = "cbPatient";
|
||||
cbPatient.Size = new Size(214, 25);
|
||||
cbPatient.TabIndex = 15;
|
||||
//
|
||||
// btnAddHospitalAdmission
|
||||
//
|
||||
btnAddHospitalAdmission.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
btnAddHospitalAdmission.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnAddHospitalAdmission.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnAddHospitalAdmission.Location = new Point(455, 73);
|
||||
btnAddHospitalAdmission.Name = "btnAddHospitalAdmission";
|
||||
btnAddHospitalAdmission.Size = new Size(333, 33);
|
||||
btnAddHospitalAdmission.TabIndex = 12;
|
||||
btnAddHospitalAdmission.Text = "Добавить";
|
||||
btnAddHospitalAdmission.UseVisualStyleBackColor = true;
|
||||
btnAddHospitalAdmission.Click += btnAddHospitalAdmission_Click;
|
||||
//
|
||||
// btnUpdate
|
||||
//
|
||||
btnUpdate.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
btnUpdate.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnUpdate.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnUpdate.Location = new Point(455, 25);
|
||||
btnUpdate.Name = "btnUpdate";
|
||||
btnUpdate.Size = new Size(169, 33);
|
||||
btnUpdate.TabIndex = 11;
|
||||
btnUpdate.Text = "Изменить";
|
||||
btnUpdate.UseVisualStyleBackColor = true;
|
||||
btnUpdate.Click += btnUpdate_Click;
|
||||
//
|
||||
// btnDelete
|
||||
//
|
||||
btnDelete.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
btnDelete.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnDelete.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnDelete.Location = new Point(630, 25);
|
||||
btnDelete.Name = "btnDelete";
|
||||
btnDelete.Size = new Size(158, 33);
|
||||
btnDelete.TabIndex = 10;
|
||||
btnDelete.Text = "Удалить";
|
||||
btnDelete.UseVisualStyleBackColor = true;
|
||||
btnDelete.Click += btnDelete_Click;
|
||||
//
|
||||
// btnHospitalDischarge
|
||||
//
|
||||
btnHospitalDischarge.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
btnHospitalDischarge.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnHospitalDischarge.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnHospitalDischarge.Location = new Point(232, 25);
|
||||
btnHospitalDischarge.Name = "btnHospitalDischarge";
|
||||
btnHospitalDischarge.Size = new Size(217, 33);
|
||||
btnHospitalDischarge.TabIndex = 7;
|
||||
btnHospitalDischarge.Text = "Завершить госпитализацию";
|
||||
btnHospitalDischarge.UseVisualStyleBackColor = true;
|
||||
btnHospitalDischarge.Click += btnHospitalDischarge_Click;
|
||||
//
|
||||
// dgv
|
||||
//
|
||||
dgv.AllowUserToAddRows = false;
|
||||
dgv.AllowUserToDeleteRows = false;
|
||||
dgv.AllowUserToOrderColumns = true;
|
||||
dgv.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableWithoutHeaderText;
|
||||
dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dgv.Dock = DockStyle.Fill;
|
||||
dgv.Location = new Point(0, 0);
|
||||
dgv.MultiSelect = false;
|
||||
dgv.Name = "dgv";
|
||||
dgv.ReadOnly = true;
|
||||
dgv.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dgv.Size = new Size(800, 517);
|
||||
dgv.TabIndex = 8;
|
||||
dgv.SelectionChanged += dgv_SelectionChanged;
|
||||
//
|
||||
// cmsMedicineProductCost
|
||||
//
|
||||
cmsMedicineProductCost.Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
cmsMedicineProductCost.Name = "cmsMedicineProductCost";
|
||||
cmsMedicineProductCost.Size = new Size(61, 4);
|
||||
//
|
||||
// cmsMedicineProduct
|
||||
//
|
||||
cmsMedicineProduct.Name = "contextMenuStrip1";
|
||||
cmsMedicineProduct.Size = new Size(61, 4);
|
||||
//
|
||||
// HospitalForm
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 17F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(800, 647);
|
||||
Controls.Add(splitContainer1);
|
||||
Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
FormBorderStyle = FormBorderStyle.FixedSingle;
|
||||
Name = "HospitalForm";
|
||||
Text = "Госпитализации";
|
||||
splitContainer1.Panel1.ResumeLayout(false);
|
||||
splitContainer1.Panel1.PerformLayout();
|
||||
splitContainer1.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)splitContainer1).EndInit();
|
||||
splitContainer1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)dgv).EndInit();
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private SplitContainer splitContainer1;
|
||||
private DataGridView dgv;
|
||||
private ContextMenuStrip cmsMedicineProduct;
|
||||
private ContextMenuStrip cmsMedicineProductCost;
|
||||
private Button btnHospitalDischarge;
|
||||
private Button btnDelete;
|
||||
private Button btnAddHospitalAdmission;
|
||||
private Button btnUpdate;
|
||||
private Label label3;
|
||||
private ComboBox cbDisease;
|
||||
private Label label2;
|
||||
private ComboBox cbPatient;
|
||||
internal DateTimePicker dtpArrive;
|
||||
private Label label6;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,156 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.ChangeTracking.Internal;
|
||||
using Register_office.Model;
|
||||
using Register_office.View.TypesV;
|
||||
using Register_office.ViewModel;
|
||||
using System.Data;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Register_office.View.PatientV
|
||||
{
|
||||
public partial class HospitalForm : Form
|
||||
{
|
||||
private HospitalViewModel _viewModel;
|
||||
private HospitalAdmission? _selectedHospital;
|
||||
private string _columnIdName = "HospitalAdmissionId";
|
||||
|
||||
public HospitalForm()
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
public HospitalForm(Patient patient)
|
||||
{
|
||||
Init();
|
||||
dgv.DataSource = new SortableBindingList<HospitalAdmissionWrapper>(
|
||||
HospitalAdmissionWrapper.ToList(_viewModel.GetHospitalAdmission()
|
||||
.Where(x => x.PatientId == patient.PatientId)
|
||||
.ToList()));
|
||||
}
|
||||
|
||||
private void Init()
|
||||
{
|
||||
InitializeComponent();
|
||||
TopMost = true;
|
||||
Text = "Госпитализации";
|
||||
_viewModel = new();
|
||||
_viewModel.ConfigureSettingsDGV<HospitalAdmissionWrapper>(dgv);
|
||||
dtpArrive.Value =
|
||||
dtpArrive.MaxDate = DateTime.Now;
|
||||
SetDataSourceToComboBoxes();
|
||||
UpdateDgv();
|
||||
UpdateElements();
|
||||
}
|
||||
|
||||
private void SetDataSourceToComboBoxes()
|
||||
{
|
||||
cbDisease.DataSource = _viewModel.General.Context.Diseases
|
||||
.Select(x => new ComboBoxItem { Name = x.Name, Id = x.DiseaseId })
|
||||
.OrderBy(cbi => cbi.Name).ToList();
|
||||
cbDisease.DisplayMember = "Name";
|
||||
cbDisease.ValueMember = "Id";
|
||||
|
||||
cbPatient.DataSource = _viewModel.General.Context.Patients
|
||||
.Include(x => x.PatientNavigation)
|
||||
.Select(x => new ComboBoxItem
|
||||
{
|
||||
Name = x.PatientNavigation.FirstName + " " +
|
||||
x.PatientNavigation.FirstName + " " +
|
||||
x.PatientNavigation.LastName,
|
||||
Id = x.PatientId
|
||||
})
|
||||
.OrderBy(cbi => cbi.Name).ToList();
|
||||
cbPatient.DisplayMember = "Name";
|
||||
cbPatient.ValueMember = "Id";
|
||||
}
|
||||
|
||||
private void UpdateElements(bool enableButtons = false)
|
||||
{
|
||||
if (_selectedHospital != null)
|
||||
{
|
||||
cbPatient.SelectedValue = _selectedHospital.PatientId;
|
||||
cbDisease.SelectedValue = _selectedHospital.PreliminaryDiseaseId;
|
||||
dtpArrive.Value = _selectedHospital.AdmissionDatetime;
|
||||
btnHospitalDischarge.Enabled = true;
|
||||
btnHospitalDischarge.Text = _selectedHospital.HospitalDischarges.Any()
|
||||
? "Результаты госпитализации"
|
||||
: "Завершить госпитализацию";
|
||||
}
|
||||
|
||||
btnDelete.Enabled = btnUpdate.Enabled = btnHospitalDischarge.Enabled = enableButtons;
|
||||
}
|
||||
|
||||
private void UpdateDgv()
|
||||
{
|
||||
_viewModel.SetDefaultDataSource<HospitalAdmission>(dgv);
|
||||
}
|
||||
|
||||
private void dgv_SelectionChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (dgv.SelectedRows.Count != 0 && !dgv.CurrentRow.IsNewRow)
|
||||
{
|
||||
DataGridViewRow selectedRow = dgv.SelectedRows[0];
|
||||
int id = int.Parse(selectedRow.Cells[_columnIdName].Value.ToString() ?? "");
|
||||
_selectedHospital = _viewModel.GetHospitalAdmission(id).FirstOrDefault();
|
||||
if (_selectedHospital != null)
|
||||
UpdateElements(true);
|
||||
}
|
||||
}
|
||||
|
||||
private void btnDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (_selectedHospital != null)
|
||||
{
|
||||
_viewModel.DeleteHospital(_selectedHospital);
|
||||
UpdateElements();
|
||||
UpdateDgv();
|
||||
}
|
||||
}
|
||||
|
||||
private void btnUpdate_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (_selectedHospital != null)
|
||||
{
|
||||
_selectedHospital.PatientId = int.Parse(cbPatient.SelectedValue?.ToString() ?? "-1");
|
||||
_selectedHospital.PreliminaryDiseaseId = int.Parse(cbDisease.SelectedValue?.ToString() ?? "-1");
|
||||
_selectedHospital.AdmissionDatetime = dtpArrive.Value;
|
||||
_viewModel.Update();
|
||||
UpdateElements();
|
||||
UpdateDgv();
|
||||
}
|
||||
}
|
||||
|
||||
private void btnAddHospitalAdmission_Click(object sender, EventArgs e)
|
||||
{
|
||||
HospitalAdmission _temp = new()
|
||||
{
|
||||
PatientId = int.Parse(cbPatient.SelectedValue?.ToString() ?? "-1"),
|
||||
PreliminaryDiseaseId = int.Parse(cbDisease.SelectedValue?.ToString() ?? "-1"),
|
||||
AdmissionDatetime = dtpArrive.Value
|
||||
};
|
||||
_viewModel.AddHospital(_temp);
|
||||
UpdateElements();
|
||||
UpdateDgv();
|
||||
}
|
||||
|
||||
private void btnHospitalDischarge_Click(object sender, EventArgs e)
|
||||
{
|
||||
HospitalDischargeDataForm hdf;
|
||||
|
||||
if (_selectedHospital.HospitalDischarges.Any())
|
||||
{
|
||||
hdf = new(_selectedHospital, false);
|
||||
hdf.ShowDialog();
|
||||
}
|
||||
else
|
||||
{
|
||||
hdf = new(_selectedHospital);
|
||||
if (hdf.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
btnHospitalDischarge.Text = "Результаты госпитализации";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="cmsMedicineProductCost.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>184, 17</value>
|
||||
</metadata>
|
||||
<metadata name="cmsMedicineProduct.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
@@ -0,0 +1,237 @@
|
||||
namespace Register_office.View.MenuV
|
||||
{
|
||||
partial class OnlyMenuForm
|
||||
{
|
||||
/// <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();
|
||||
лекарстваToolStripMenuItem = new ToolStripMenuItem();
|
||||
способыприемалекарствToolStripMenuItem = new ToolStripMenuItem();
|
||||
заболеваниеToolStripMenuItem1 = new ToolStripMenuItem();
|
||||
процедурыToolStripMenuItem = new ToolStripMenuItem();
|
||||
синдромыToolStripMenuItem = new ToolStripMenuItem();
|
||||
соответствиеЗаболеванийИСиндромовToolStripMenuItem = new ToolStripMenuItem();
|
||||
обследованияToolStripMenuItem = new ToolStripMenuItem();
|
||||
нормалиОбследованийToolStripMenuItem = new ToolStripMenuItem();
|
||||
CоответствиеСиндромовИОбследованийToolStripMenuItem = new ToolStripMenuItem();
|
||||
единицыИзмеренияToolStripMenuItem = new ToolStripMenuItem();
|
||||
сотрудникиToolStripMenuItem = new ToolStripMenuItem();
|
||||
пациентыToolStripMenuItem = new ToolStripMenuItem();
|
||||
добавитьПациентаToolStripMenuItem = new ToolStripMenuItem();
|
||||
toolStripSeparator1 = new ToolStripSeparator();
|
||||
назначенияToolStripMenuItem = new ToolStripMenuItem();
|
||||
госпитализацииToolStripMenuItem = new ToolStripMenuItem();
|
||||
отчетыToolStripMenuItem = new ToolStripMenuItem();
|
||||
результатыАнализовToolStripMenuItem = new ToolStripMenuItem();
|
||||
menuStrip1.SuspendLayout();
|
||||
SuspendLayout();
|
||||
//
|
||||
// menuStrip1
|
||||
//
|
||||
menuStrip1.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
menuStrip1.Items.AddRange(new ToolStripItem[] { справочникиToolStripMenuItem, сотрудникиToolStripMenuItem, отчетыToolStripMenuItem });
|
||||
menuStrip1.Location = new Point(0, 0);
|
||||
menuStrip1.Name = "menuStrip1";
|
||||
menuStrip1.Size = new Size(800, 33);
|
||||
menuStrip1.TabIndex = 0;
|
||||
menuStrip1.Text = "menuStrip1";
|
||||
//
|
||||
// справочникиToolStripMenuItem
|
||||
//
|
||||
справочникиToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { лекарстваToolStripMenuItem, способыприемалекарствToolStripMenuItem, заболеваниеToolStripMenuItem1, процедурыToolStripMenuItem, синдромыToolStripMenuItem, соответствиеЗаболеванийИСиндромовToolStripMenuItem, обследованияToolStripMenuItem, нормалиОбследованийToolStripMenuItem, CоответствиеСиндромовИОбследованийToolStripMenuItem, единицыИзмеренияToolStripMenuItem });
|
||||
справочникиToolStripMenuItem.Name = "справочникиToolStripMenuItem";
|
||||
справочникиToolStripMenuItem.Size = new Size(142, 29);
|
||||
справочникиToolStripMenuItem.Text = "Справочники";
|
||||
//
|
||||
// лекарстваToolStripMenuItem
|
||||
//
|
||||
лекарстваToolStripMenuItem.Name = "лекарстваToolStripMenuItem";
|
||||
лекарстваToolStripMenuItem.Size = new Size(462, 30);
|
||||
лекарстваToolStripMenuItem.Text = "Лекарства...";
|
||||
лекарстваToolStripMenuItem.Click += лекарстваToolStripMenuItem_Click;
|
||||
//
|
||||
// способыприемалекарствToolStripMenuItem
|
||||
//
|
||||
способыприемалекарствToolStripMenuItem.Name = "способыприемалекарствToolStripMenuItem";
|
||||
способыприемалекарствToolStripMenuItem.Size = new Size(462, 30);
|
||||
способыприемалекарствToolStripMenuItem.Text = "Способы приема лекарств...";
|
||||
способыприемалекарствToolStripMenuItem.Click += способыприемалекарствToolStripMenuItem_Click;
|
||||
//
|
||||
// заболеваниеToolStripMenuItem1
|
||||
//
|
||||
заболеваниеToolStripMenuItem1.Name = "заболеваниеToolStripMenuItem1";
|
||||
заболеваниеToolStripMenuItem1.Size = new Size(462, 30);
|
||||
заболеваниеToolStripMenuItem1.Text = "Заболевания...";
|
||||
заболеваниеToolStripMenuItem1.Click += заболеваниеToolStripMenuItem1_Click;
|
||||
//
|
||||
// процедурыToolStripMenuItem
|
||||
//
|
||||
процедурыToolStripMenuItem.Name = "процедурыToolStripMenuItem";
|
||||
процедурыToolStripMenuItem.Size = new Size(462, 30);
|
||||
процедурыToolStripMenuItem.Text = "Процедуры...";
|
||||
процедурыToolStripMenuItem.Click += процедурыToolStripMenuItem_Click;
|
||||
//
|
||||
// синдромыToolStripMenuItem
|
||||
//
|
||||
синдромыToolStripMenuItem.Name = "синдромыToolStripMenuItem";
|
||||
синдромыToolStripMenuItem.Size = new Size(462, 30);
|
||||
синдромыToolStripMenuItem.Text = "Синдромы...";
|
||||
синдромыToolStripMenuItem.Click += синдромыToolStripMenuItem_Click;
|
||||
//
|
||||
// соответствиеЗаболеванийИСиндромовToolStripMenuItem
|
||||
//
|
||||
соответствиеЗаболеванийИСиндромовToolStripMenuItem.Name = "соответствиеЗаболеванийИСиндромовToolStripMenuItem";
|
||||
соответствиеЗаболеванийИСиндромовToolStripMenuItem.Size = new Size(462, 30);
|
||||
соответствиеЗаболеванийИСиндромовToolStripMenuItem.Text = "Соответствие заболеваний и синдромов...";
|
||||
соответствиеЗаболеванийИСиндромовToolStripMenuItem.Click += соответствиеЗаболеванийИСиндромовToolStripMenuItem_Click;
|
||||
//
|
||||
// обследованияToolStripMenuItem
|
||||
//
|
||||
обследованияToolStripMenuItem.Name = "обследованияToolStripMenuItem";
|
||||
обследованияToolStripMenuItem.Size = new Size(462, 30);
|
||||
обследованияToolStripMenuItem.Text = "Обследования...";
|
||||
обследованияToolStripMenuItem.Click += обследованияToolStripMenuItem_Click;
|
||||
//
|
||||
// нормалиОбследованийToolStripMenuItem
|
||||
//
|
||||
нормалиОбследованийToolStripMenuItem.Name = "нормалиОбследованийToolStripMenuItem";
|
||||
нормалиОбследованийToolStripMenuItem.Size = new Size(462, 30);
|
||||
нормалиОбследованийToolStripMenuItem.Text = "Нормали обследований...";
|
||||
нормалиОбследованийToolStripMenuItem.Click += нормалиОбследованийToolStripMenuItem_Click;
|
||||
//
|
||||
// CоответствиеСиндромовИОбследованийToolStripMenuItem
|
||||
//
|
||||
CоответствиеСиндромовИОбследованийToolStripMenuItem.Name = "CоответствиеСиндромовИОбследованийToolStripMenuItem";
|
||||
CоответствиеСиндромовИОбследованийToolStripMenuItem.Size = new Size(462, 30);
|
||||
CоответствиеСиндромовИОбследованийToolStripMenuItem.Text = "Cоответствие синдромов и обследований...";
|
||||
CоответствиеСиндромовИОбследованийToolStripMenuItem.Click += CоответствиеСиндромовИОбследованийToolStripMenuItem_Click;
|
||||
//
|
||||
// единицыИзмеренияToolStripMenuItem
|
||||
//
|
||||
единицыИзмеренияToolStripMenuItem.Name = "единицыИзмеренияToolStripMenuItem";
|
||||
единицыИзмеренияToolStripMenuItem.Size = new Size(462, 30);
|
||||
единицыИзмеренияToolStripMenuItem.Text = "Единицы измерения...";
|
||||
единицыИзмеренияToolStripMenuItem.Click += единицыИзмеренияToolStripMenuItem_Click;
|
||||
//
|
||||
// сотрудникиToolStripMenuItem
|
||||
//
|
||||
сотрудникиToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { пациентыToolStripMenuItem, добавитьПациентаToolStripMenuItem, toolStripSeparator1, назначенияToolStripMenuItem, госпитализацииToolStripMenuItem });
|
||||
сотрудникиToolStripMenuItem.Name = "сотрудникиToolStripMenuItem";
|
||||
сотрудникиToolStripMenuItem.Size = new Size(85, 29);
|
||||
сотрудникиToolStripMenuItem.Text = "Работа";
|
||||
//
|
||||
// пациентыToolStripMenuItem
|
||||
//
|
||||
пациентыToolStripMenuItem.Name = "пациентыToolStripMenuItem";
|
||||
пациентыToolStripMenuItem.Size = new Size(267, 30);
|
||||
пациентыToolStripMenuItem.Text = "Пациенты...";
|
||||
пациентыToolStripMenuItem.Click += пациентыToolStripMenuItem_Click;
|
||||
//
|
||||
// добавитьПациентаToolStripMenuItem
|
||||
//
|
||||
добавитьПациентаToolStripMenuItem.Name = "добавитьПациентаToolStripMenuItem";
|
||||
добавитьПациентаToolStripMenuItem.Size = new Size(267, 30);
|
||||
добавитьПациентаToolStripMenuItem.Text = "Добавить пациента...";
|
||||
добавитьПациентаToolStripMenuItem.Click += добавитьПациентаToolStripMenuItem_Click;
|
||||
//
|
||||
// toolStripSeparator1
|
||||
//
|
||||
toolStripSeparator1.Name = "toolStripSeparator1";
|
||||
toolStripSeparator1.Size = new Size(264, 6);
|
||||
//
|
||||
// назначенияToolStripMenuItem
|
||||
//
|
||||
назначенияToolStripMenuItem.Name = "назначенияToolStripMenuItem";
|
||||
назначенияToolStripMenuItem.Size = new Size(267, 30);
|
||||
назначенияToolStripMenuItem.Text = "Назначения...";
|
||||
назначенияToolStripMenuItem.Click += назначенияToolStripMenuItem_Click;
|
||||
//
|
||||
// госпитализацииToolStripMenuItem
|
||||
//
|
||||
госпитализацииToolStripMenuItem.Name = "госпитализацииToolStripMenuItem";
|
||||
госпитализацииToolStripMenuItem.Size = new Size(267, 30);
|
||||
госпитализацииToolStripMenuItem.Text = "Госпитализации...";
|
||||
госпитализацииToolStripMenuItem.Click += госпитализацииToolStripMenuItem_Click;
|
||||
//
|
||||
// отчетыToolStripMenuItem
|
||||
//
|
||||
отчетыToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { результатыАнализовToolStripMenuItem });
|
||||
отчетыToolStripMenuItem.Name = "отчетыToolStripMenuItem";
|
||||
отчетыToolStripMenuItem.Size = new Size(88, 29);
|
||||
отчетыToolStripMenuItem.Text = "Отчеты";
|
||||
//
|
||||
// результатыАнализовToolStripMenuItem
|
||||
//
|
||||
результатыАнализовToolStripMenuItem.Name = "результатыАнализовToolStripMenuItem";
|
||||
результатыАнализовToolStripMenuItem.Size = new Size(267, 30);
|
||||
результатыАнализовToolStripMenuItem.Text = "Результаты анализов";
|
||||
результатыАнализовToolStripMenuItem.Click += результатыАнализовToolStripMenuItem_Click;
|
||||
//
|
||||
// OnlyMenuForm
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(800, 35);
|
||||
Controls.Add(menuStrip1);
|
||||
FormBorderStyle = FormBorderStyle.FixedSingle;
|
||||
MainMenuStrip = menuStrip1;
|
||||
MaximizeBox = false;
|
||||
Name = "OnlyMenuForm";
|
||||
Text = "ИНФОРМАЦИОННАЯ СИСТЕМА \"РЕГИСТРАТУРА\"";
|
||||
WindowState = FormWindowState.Maximized;
|
||||
SizeChanged += Form_SizeChanged;
|
||||
menuStrip1.ResumeLayout(false);
|
||||
menuStrip1.PerformLayout();
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private MenuStrip menuStrip1;
|
||||
private ToolStripMenuItem справочникиToolStripMenuItem;
|
||||
private ToolStripMenuItem заболеваниеToolStripMenuItem1;
|
||||
private ToolStripMenuItem способыприемалекарствToolStripMenuItem;
|
||||
private ToolStripMenuItem обследованияToolStripMenuItem;
|
||||
private ToolStripMenuItem нормалиОбследованийToolStripMenuItem;
|
||||
private ToolStripMenuItem сотрудникиToolStripMenuItem;
|
||||
private ToolStripMenuItem отчетыToolStripMenuItem;
|
||||
private ToolStripMenuItem CоответствиеСиндромовИОбследованийToolStripMenuItem;
|
||||
private ToolStripMenuItem пациентыToolStripMenuItem;
|
||||
private ToolStripMenuItem назначенияToolStripMenuItem;
|
||||
private ToolStripMenuItem результатыАнализовToolStripMenuItem;
|
||||
private ToolStripMenuItem процедурыToolStripMenuItem;
|
||||
private ToolStripMenuItem госпитализацииToolStripMenuItem;
|
||||
private ToolStripMenuItem синдромыToolStripMenuItem;
|
||||
private ToolStripMenuItem единицыИзмеренияToolStripMenuItem;
|
||||
private ToolStripMenuItem лекарстваToolStripMenuItem;
|
||||
private ToolStripMenuItem соответствиеЗаболеванийИСиндромовToolStripMenuItem;
|
||||
private ToolStripMenuItem добавитьПациентаToolStripMenuItem;
|
||||
private ToolStripSeparator toolStripSeparator1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
using Register_office;
|
||||
using Register_office.Model;
|
||||
using Register_office.View.LoginV;
|
||||
using Register_office.View.PatientV;
|
||||
using Register_office.View.TypesV;
|
||||
using Register_office.ViewModel;
|
||||
using System.Data;
|
||||
|
||||
namespace Register_office.View.MenuV
|
||||
{
|
||||
public partial class OnlyMenuForm : Form
|
||||
{
|
||||
OnlyMenuViewModel _viewModel;
|
||||
|
||||
public OnlyMenuForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
_viewModel = new();
|
||||
SetFormByRole();
|
||||
}
|
||||
|
||||
private void SetFormByRole()
|
||||
{
|
||||
if (_viewModel.General.DoctorId < 1)
|
||||
{
|
||||
справочникиToolStripMenuItem.Visible =
|
||||
госпитализацииToolStripMenuItem.Visible =
|
||||
отчетыToolStripMenuItem.Visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
private T ShowForm<T>() where T : Form, new()
|
||||
{
|
||||
T? form = _viewModel.General.GetActivatedForm<T>();
|
||||
|
||||
form ??= new();
|
||||
|
||||
form.Visible = true;
|
||||
form.Show();
|
||||
return form;
|
||||
}
|
||||
|
||||
private void ReportAnalyses()
|
||||
{
|
||||
|
||||
List<Analysis> sales = _viewModel.GetReport<Analysis>();
|
||||
|
||||
string fileName = _viewModel.General.PathReport + "/Результаты анализов " +
|
||||
DateOnly.FromDateTime(DateTime.Now) + ".xlsx";
|
||||
|
||||
ExcelManager.ExportToExcel(sales, fileName);
|
||||
ExcelManager.OpenExcelFile(fileName);
|
||||
}
|
||||
|
||||
private void HideForms()
|
||||
{
|
||||
FormCollection formCollection = Application.OpenForms;
|
||||
bool hide = false;
|
||||
if (this.WindowState == FormWindowState.Minimized)
|
||||
hide = false;
|
||||
else if (this.WindowState == FormWindowState.Maximized)
|
||||
hide = true;
|
||||
|
||||
foreach (Form form in formCollection)
|
||||
if (form.Name != this.Name && form.Name != new LoginForm().Name)
|
||||
form.Visible = hide;
|
||||
}
|
||||
|
||||
private void Form_SizeChanged(object sender, EventArgs e)
|
||||
{
|
||||
HideForms();
|
||||
}
|
||||
|
||||
private void заболеваниеToolStripMenuItem1_Click(object sender, EventArgs e)
|
||||
{
|
||||
ShowForm<DiseaseForm>();
|
||||
}
|
||||
|
||||
private void способыприемалекарствToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
ShowForm<DrugIntakeMethodForm>();
|
||||
}
|
||||
|
||||
private void обследованияToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
ShowForm<ExaminationTypeForm>();
|
||||
}
|
||||
|
||||
private void процедурыToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
ShowForm<PatientForm>();
|
||||
}
|
||||
|
||||
private void нормалиОбследованийToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
ShowForm<ReferenceValueForm>();
|
||||
}
|
||||
|
||||
private void синдромыToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
ShowForm<SyndromeTypeForm>();
|
||||
}
|
||||
|
||||
private void CоответствиеСиндромовИОбследованийToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
ShowForm<SyndromeExaminationTypeForm>();
|
||||
}
|
||||
|
||||
private void единицыИзмеренияToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
ShowForm<UnitForm>();
|
||||
}
|
||||
|
||||
private void лекарстваToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
ShowForm<DrugTypeForm>();
|
||||
}
|
||||
|
||||
private void соответствиеЗаболеванийИСиндромовToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
ShowForm<DiseaseSyndromeForm>();
|
||||
}
|
||||
|
||||
private void пациентыToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
ShowForm<PatientForm>();
|
||||
}
|
||||
|
||||
private void добавитьПациентаToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
ShowForm<PatientDataForm>();
|
||||
}
|
||||
|
||||
private void назначенияToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
ShowForm<PrescriptionForm>();
|
||||
}
|
||||
|
||||
private void госпитализацииToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
ShowForm<HospitalForm>();
|
||||
}
|
||||
|
||||
private void результатыАнализовToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
ReportAnalyses();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
@@ -0,0 +1,281 @@
|
||||
namespace Register_office.View.PatientV
|
||||
{
|
||||
partial class PatientDataForm
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
label1 = new Label();
|
||||
tbName = new TextBox();
|
||||
lblData = new Label();
|
||||
tbSurname = new TextBox();
|
||||
label3 = new Label();
|
||||
tbPatronymic = new TextBox();
|
||||
label4 = new Label();
|
||||
label6 = new Label();
|
||||
label7 = new Label();
|
||||
btnOK = new Button();
|
||||
button2 = new Button();
|
||||
dtpBirthday = new DateTimePicker();
|
||||
cbGender = new ComboBox();
|
||||
lblIdPerson = new Label();
|
||||
label5 = new Label();
|
||||
tbAddress = new TextBox();
|
||||
mtbPolicy = new MaskedTextBox();
|
||||
label2 = new Label();
|
||||
SuspendLayout();
|
||||
//
|
||||
// label1
|
||||
//
|
||||
label1.AutoSize = true;
|
||||
label1.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label1.Location = new Point(12, 49);
|
||||
label1.Name = "label1";
|
||||
label1.Size = new Size(91, 25);
|
||||
label1.TabIndex = 0;
|
||||
label1.Text = "Фамилия";
|
||||
//
|
||||
// tbName
|
||||
//
|
||||
tbName.Font = new Font("Segoe UI", 12F);
|
||||
tbName.Location = new Point(12, 137);
|
||||
tbName.Name = "tbName";
|
||||
tbName.Size = new Size(398, 29);
|
||||
tbName.TabIndex = 1;
|
||||
tbName.KeyPress += TextBoxKeyPress;
|
||||
//
|
||||
// lblData
|
||||
//
|
||||
lblData.AutoSize = true;
|
||||
lblData.Font = new Font("Segoe UI", 18F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
lblData.Location = new Point(78, 9);
|
||||
lblData.Name = "lblData";
|
||||
lblData.Size = new Size(233, 32);
|
||||
lblData.TabIndex = 2;
|
||||
lblData.Text = "Данные о пациенте";
|
||||
//
|
||||
// tbSurname
|
||||
//
|
||||
tbSurname.Font = new Font("Segoe UI", 12F);
|
||||
tbSurname.Location = new Point(12, 77);
|
||||
tbSurname.Name = "tbSurname";
|
||||
tbSurname.Size = new Size(398, 29);
|
||||
tbSurname.TabIndex = 0;
|
||||
tbSurname.KeyPress += TextBoxKeyPress;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
label3.AutoSize = true;
|
||||
label3.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label3.Location = new Point(12, 109);
|
||||
label3.Name = "label3";
|
||||
label3.Size = new Size(49, 25);
|
||||
label3.TabIndex = 3;
|
||||
label3.Text = "Имя";
|
||||
//
|
||||
// tbPatronymic
|
||||
//
|
||||
tbPatronymic.Font = new Font("Segoe UI", 12F);
|
||||
tbPatronymic.Location = new Point(12, 197);
|
||||
tbPatronymic.Name = "tbPatronymic";
|
||||
tbPatronymic.Size = new Size(398, 29);
|
||||
tbPatronymic.TabIndex = 2;
|
||||
tbPatronymic.KeyPress += TextBoxKeyPress;
|
||||
//
|
||||
// label4
|
||||
//
|
||||
label4.AutoSize = true;
|
||||
label4.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label4.Location = new Point(12, 169);
|
||||
label4.Name = "label4";
|
||||
label4.Size = new Size(93, 25);
|
||||
label4.TabIndex = 5;
|
||||
label4.Text = "Отчество";
|
||||
//
|
||||
// label6
|
||||
//
|
||||
label6.AutoSize = true;
|
||||
label6.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label6.Location = new Point(12, 289);
|
||||
label6.Name = "label6";
|
||||
label6.Size = new Size(146, 25);
|
||||
label6.TabIndex = 9;
|
||||
label6.Text = "Дата рождения";
|
||||
//
|
||||
// label7
|
||||
//
|
||||
label7.AutoSize = true;
|
||||
label7.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label7.Location = new Point(246, 289);
|
||||
label7.Name = "label7";
|
||||
label7.Size = new Size(47, 25);
|
||||
label7.TabIndex = 11;
|
||||
label7.Text = "Пол";
|
||||
//
|
||||
// btnOK
|
||||
//
|
||||
btnOK.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
||||
btnOK.DialogResult = DialogResult.OK;
|
||||
btnOK.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnOK.Location = new Point(12, 421);
|
||||
btnOK.Name = "btnOK";
|
||||
btnOK.Size = new Size(161, 42);
|
||||
btnOK.TabIndex = 7;
|
||||
btnOK.Text = "Принять";
|
||||
btnOK.UseVisualStyleBackColor = true;
|
||||
btnOK.Click += btnOK_Click;
|
||||
//
|
||||
// button2
|
||||
//
|
||||
button2.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
||||
button2.DialogResult = DialogResult.Cancel;
|
||||
button2.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
button2.Location = new Point(249, 421);
|
||||
button2.Name = "button2";
|
||||
button2.Size = new Size(161, 42);
|
||||
button2.TabIndex = 8;
|
||||
button2.Text = "Отмена";
|
||||
button2.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// dtpBirthday
|
||||
//
|
||||
dtpBirthday.Font = new Font("Segoe UI", 12F);
|
||||
dtpBirthday.Location = new Point(12, 317);
|
||||
dtpBirthday.MinDate = new DateTime(1940, 1, 1, 0, 0, 0, 0);
|
||||
dtpBirthday.Name = "dtpBirthday";
|
||||
dtpBirthday.Size = new Size(200, 29);
|
||||
dtpBirthday.TabIndex = 4;
|
||||
//
|
||||
// cbGender
|
||||
//
|
||||
cbGender.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
cbGender.Font = new Font("Segoe UI", 12F);
|
||||
cbGender.FormattingEnabled = true;
|
||||
cbGender.Items.AddRange(new object[] { "Мужчина", "Женщина" });
|
||||
cbGender.Location = new Point(246, 317);
|
||||
cbGender.Name = "cbGender";
|
||||
cbGender.Size = new Size(161, 29);
|
||||
cbGender.TabIndex = 5;
|
||||
//
|
||||
// lblIdPerson
|
||||
//
|
||||
lblIdPerson.AutoSize = true;
|
||||
lblIdPerson.Location = new Point(229, 328);
|
||||
lblIdPerson.Name = "lblIdPerson";
|
||||
lblIdPerson.Size = new Size(0, 15);
|
||||
lblIdPerson.TabIndex = 21;
|
||||
lblIdPerson.Visible = false;
|
||||
//
|
||||
// label5
|
||||
//
|
||||
label5.AutoSize = true;
|
||||
label5.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label5.Location = new Point(12, 229);
|
||||
label5.Name = "label5";
|
||||
label5.Size = new Size(64, 25);
|
||||
label5.TabIndex = 7;
|
||||
label5.Text = "Адрес";
|
||||
//
|
||||
// tbAddress
|
||||
//
|
||||
tbAddress.Font = new Font("Segoe UI", 12F);
|
||||
tbAddress.Location = new Point(12, 257);
|
||||
tbAddress.Name = "tbAddress";
|
||||
tbAddress.Size = new Size(398, 29);
|
||||
tbAddress.TabIndex = 3;
|
||||
//
|
||||
// mtbPolicy
|
||||
//
|
||||
mtbPolicy.Font = new Font("Segoe UI", 12F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
mtbPolicy.Location = new Point(12, 377);
|
||||
mtbPolicy.Mask = "9999999999999999";
|
||||
mtbPolicy.Name = "mtbPolicy";
|
||||
mtbPolicy.Size = new Size(161, 29);
|
||||
mtbPolicy.TabIndex = 24;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
label2.AutoSize = true;
|
||||
label2.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label2.Location = new Point(12, 349);
|
||||
label2.Name = "label2";
|
||||
label2.Size = new Size(67, 25);
|
||||
label2.TabIndex = 23;
|
||||
label2.Text = "Полис";
|
||||
//
|
||||
// PatientDataForm
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(425, 475);
|
||||
Controls.Add(mtbPolicy);
|
||||
Controls.Add(label2);
|
||||
Controls.Add(lblIdPerson);
|
||||
Controls.Add(cbGender);
|
||||
Controls.Add(dtpBirthday);
|
||||
Controls.Add(button2);
|
||||
Controls.Add(btnOK);
|
||||
Controls.Add(label7);
|
||||
Controls.Add(label6);
|
||||
Controls.Add(tbAddress);
|
||||
Controls.Add(label5);
|
||||
Controls.Add(tbPatronymic);
|
||||
Controls.Add(label4);
|
||||
Controls.Add(tbSurname);
|
||||
Controls.Add(label3);
|
||||
Controls.Add(lblData);
|
||||
Controls.Add(tbName);
|
||||
Controls.Add(label1);
|
||||
FormBorderStyle = FormBorderStyle.FixedToolWindow;
|
||||
Name = "PatientDataForm";
|
||||
StartPosition = FormStartPosition.CenterScreen;
|
||||
Text = "Данные пациента";
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private Label label1;
|
||||
private Label label3;
|
||||
private Label label4;
|
||||
private Label label6;
|
||||
private Label label7;
|
||||
private Button button2;
|
||||
internal DateTimePicker dtpBirthday;
|
||||
internal ComboBox cbGender;
|
||||
internal TextBox tbName;
|
||||
internal TextBox tbSurname;
|
||||
internal TextBox tbPatronymic;
|
||||
internal Label lblData;
|
||||
internal Button btnOK;
|
||||
internal Label lblIdPerson;
|
||||
private Label label5;
|
||||
internal TextBox tbAddress;
|
||||
private MaskedTextBox mtbPolicy;
|
||||
private Label label2;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
using Register_office.Model;
|
||||
using Register_office.ViewModel;
|
||||
|
||||
namespace Register_office.View.PatientV
|
||||
{
|
||||
public partial class PatientDataForm : Form
|
||||
{
|
||||
private PatientViewModel _viewModel;
|
||||
|
||||
public PatientDataForm()
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
public PatientDataForm(Patient e)
|
||||
{
|
||||
Init();
|
||||
SetPatientData(e);
|
||||
}
|
||||
|
||||
private void Init()
|
||||
{
|
||||
InitializeComponent();
|
||||
TopMost = true;
|
||||
_viewModel = new();
|
||||
SetDataSourceToComboBoxes();
|
||||
dtpBirthday.Value =
|
||||
dtpBirthday.MaxDate = DateTime.Now;
|
||||
}
|
||||
|
||||
private void SetPatientData(Patient patient)
|
||||
{
|
||||
mtbPolicy.Text = patient.PolicyNumber;
|
||||
Person p = patient.PatientNavigation;
|
||||
tbSurname.Text = p.MiddleName;
|
||||
tbName.Text = p.FirstName;
|
||||
tbPatronymic.Text = p.LastName;
|
||||
tbAddress.Text = p.Address;
|
||||
dtpBirthday.Value = new(p.BirthDate, new());
|
||||
cbGender.Text = p.Gender;
|
||||
|
||||
string patientName = string.Concat(tbSurname.Text, " ",
|
||||
tbName.Text, " ", tbPatronymic.Text);
|
||||
|
||||
Text = "Изменение данных";
|
||||
lblData.Dock = DockStyle.Top;
|
||||
lblData.Text = patientName;
|
||||
lblIdPerson.Text = p.PersonId.ToString();
|
||||
}
|
||||
|
||||
private void SetDataSourceToComboBoxes()
|
||||
{
|
||||
cbGender.DataSource = new string[] { "Мужчина", "Женщина" };
|
||||
}
|
||||
|
||||
private void TextBoxKeyPress(object sender, KeyPressEventArgs e)
|
||||
{
|
||||
// Разрешаем только буквы
|
||||
if (!char.IsControl(e.KeyChar) && !char.IsLetter(e.KeyChar))
|
||||
{
|
||||
e.Handled = true; // Блокируем ввод
|
||||
}
|
||||
}
|
||||
|
||||
private void btnOK_Click(object sender, EventArgs e)
|
||||
{
|
||||
Person person = new();
|
||||
person = SetPersonData(person);
|
||||
int id = person.PersonId;
|
||||
|
||||
if (lblIdPerson.Text != "")
|
||||
{
|
||||
person = _viewModel.GetPerson(id).First();
|
||||
person = SetPersonData(person);
|
||||
person.Patient.PolicyNumber = mtbPolicy.Text;
|
||||
_viewModel.Update();
|
||||
}
|
||||
else
|
||||
{
|
||||
id = _viewModel.AddPerson(person);
|
||||
if (id == -1)
|
||||
{
|
||||
DialogResult = DialogResult.None;
|
||||
return;
|
||||
}
|
||||
|
||||
Patient p = new()
|
||||
{
|
||||
PatientId = id,
|
||||
PolicyNumber = mtbPolicy.Text
|
||||
};
|
||||
if (!_viewModel.AddPatient(p))
|
||||
{
|
||||
DialogResult = DialogResult.None;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
MessageBox.Show("Пациент успешно добавлен", "Добавление пользователя",
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
Close();
|
||||
|
||||
}
|
||||
|
||||
private Person SetPersonData(Person p)
|
||||
{
|
||||
p.MiddleName = tbSurname.Text;
|
||||
p.FirstName = tbName.Text;
|
||||
p.LastName = tbPatronymic.Text;
|
||||
p.Address = tbAddress.Text;
|
||||
p.BirthDate = DateOnly.FromDateTime(dtpBirthday.Value);
|
||||
p.Gender = cbGender.Text;
|
||||
|
||||
if (lblIdPerson.Text != "")
|
||||
p.PersonId = int.Parse(lblIdPerson.Text);
|
||||
|
||||
return p;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -0,0 +1,181 @@
|
||||
using Register_office.View;
|
||||
|
||||
namespace Register_office.View.PatientV
|
||||
{
|
||||
partial class PatientForm
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
components = new System.ComponentModel.Container();
|
||||
splitContainer1 = new SplitContainer();
|
||||
btnDelete = new Button();
|
||||
btnUpdate = new Button();
|
||||
btnHospital = new Button();
|
||||
btnPrescription = new Button();
|
||||
dgv = new DataGridView();
|
||||
cmsMedicineProductCost = new ContextMenuStrip(components);
|
||||
cmsMedicineProduct = new ContextMenuStrip(components);
|
||||
((System.ComponentModel.ISupportInitialize)splitContainer1).BeginInit();
|
||||
splitContainer1.Panel1.SuspendLayout();
|
||||
splitContainer1.Panel2.SuspendLayout();
|
||||
splitContainer1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)dgv).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// splitContainer1
|
||||
//
|
||||
splitContainer1.Dock = DockStyle.Fill;
|
||||
splitContainer1.FixedPanel = FixedPanel.Panel1;
|
||||
splitContainer1.Location = new Point(0, 0);
|
||||
splitContainer1.Name = "splitContainer1";
|
||||
splitContainer1.Orientation = Orientation.Horizontal;
|
||||
//
|
||||
// splitContainer1.Panel1
|
||||
//
|
||||
splitContainer1.Panel1.Controls.Add(btnDelete);
|
||||
splitContainer1.Panel1.Controls.Add(btnUpdate);
|
||||
splitContainer1.Panel1.Controls.Add(btnHospital);
|
||||
splitContainer1.Panel1.Controls.Add(btnPrescription);
|
||||
//
|
||||
// splitContainer1.Panel2
|
||||
//
|
||||
splitContainer1.Panel2.Controls.Add(dgv);
|
||||
splitContainer1.Size = new Size(800, 647);
|
||||
splitContainer1.SplitterDistance = 70;
|
||||
splitContainer1.SplitterWidth = 5;
|
||||
splitContainer1.TabIndex = 0;
|
||||
//
|
||||
// btnDelete
|
||||
//
|
||||
btnDelete.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
btnDelete.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnDelete.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnDelete.Location = new Point(619, 28);
|
||||
btnDelete.Name = "btnDelete";
|
||||
btnDelete.Size = new Size(169, 33);
|
||||
btnDelete.TabIndex = 10;
|
||||
btnDelete.Text = "Удалить";
|
||||
btnDelete.UseVisualStyleBackColor = true;
|
||||
btnDelete.Click += btnDelete_Click;
|
||||
//
|
||||
// btnUpdate
|
||||
//
|
||||
btnUpdate.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
btnUpdate.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnUpdate.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnUpdate.Location = new Point(449, 28);
|
||||
btnUpdate.Name = "btnUpdate";
|
||||
btnUpdate.Size = new Size(164, 33);
|
||||
btnUpdate.TabIndex = 9;
|
||||
btnUpdate.Text = "Изменить";
|
||||
btnUpdate.UseVisualStyleBackColor = true;
|
||||
btnUpdate.Click += btnUpdate_Click;
|
||||
//
|
||||
// btnHospital
|
||||
//
|
||||
btnHospital.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
btnHospital.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnHospital.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnHospital.Location = new Point(12, 28);
|
||||
btnHospital.Name = "btnHospital";
|
||||
btnHospital.Size = new Size(162, 33);
|
||||
btnHospital.TabIndex = 7;
|
||||
btnHospital.Text = "Госпитализации";
|
||||
btnHospital.UseVisualStyleBackColor = true;
|
||||
btnHospital.Click += btnHospital_Click;
|
||||
//
|
||||
// btnPrescription
|
||||
//
|
||||
btnPrescription.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
btnPrescription.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnPrescription.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnPrescription.Location = new Point(180, 28);
|
||||
btnPrescription.Name = "btnPrescription";
|
||||
btnPrescription.Size = new Size(162, 33);
|
||||
btnPrescription.TabIndex = 5;
|
||||
btnPrescription.Text = "Назначения";
|
||||
btnPrescription.UseVisualStyleBackColor = true;
|
||||
btnPrescription.Click += btnPrescription_Click;
|
||||
//
|
||||
// dgv
|
||||
//
|
||||
dgv.AllowUserToAddRows = false;
|
||||
dgv.AllowUserToDeleteRows = false;
|
||||
dgv.AllowUserToOrderColumns = true;
|
||||
dgv.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableWithoutHeaderText;
|
||||
dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dgv.Dock = DockStyle.Fill;
|
||||
dgv.Location = new Point(0, 0);
|
||||
dgv.MultiSelect = false;
|
||||
dgv.Name = "dgv";
|
||||
dgv.ReadOnly = true;
|
||||
dgv.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dgv.Size = new Size(800, 572);
|
||||
dgv.TabIndex = 8;
|
||||
dgv.SelectionChanged += dgv_SelectionChanged;
|
||||
//
|
||||
// cmsMedicineProductCost
|
||||
//
|
||||
cmsMedicineProductCost.Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
cmsMedicineProductCost.Name = "cmsMedicineProductCost";
|
||||
cmsMedicineProductCost.Size = new Size(61, 4);
|
||||
//
|
||||
// cmsMedicineProduct
|
||||
//
|
||||
cmsMedicineProduct.Name = "contextMenuStrip1";
|
||||
cmsMedicineProduct.Size = new Size(61, 4);
|
||||
//
|
||||
// PatientForm
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 17F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(800, 647);
|
||||
Controls.Add(splitContainer1);
|
||||
Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
FormBorderStyle = FormBorderStyle.FixedSingle;
|
||||
Name = "PatientForm";
|
||||
Text = "Пациенты";
|
||||
splitContainer1.Panel1.ResumeLayout(false);
|
||||
splitContainer1.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)splitContainer1).EndInit();
|
||||
splitContainer1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)dgv).EndInit();
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private SplitContainer splitContainer1;
|
||||
private DataGridView dgv;
|
||||
private ContextMenuStrip cmsMedicineProduct;
|
||||
private ContextMenuStrip cmsMedicineProductCost;
|
||||
private Button btnHospital;
|
||||
private Button btnPrescription;
|
||||
private Button btnUpdate;
|
||||
private Button btnDelete;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
using Microsoft.EntityFrameworkCore.ChangeTracking.Internal;
|
||||
using Register_office.Model;
|
||||
using Register_office.ViewModel;
|
||||
using System.Data;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Register_office.View.PatientV
|
||||
{
|
||||
public partial class PatientForm : Form
|
||||
{
|
||||
private PatientViewModel _viewModel;
|
||||
private Patient? _selectedPatient;
|
||||
private string _columnIdName = "PatientId";
|
||||
private Patient _temp;
|
||||
|
||||
public PatientForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
TopMost = true;
|
||||
Text = "Пациенты";
|
||||
_viewModel = new();
|
||||
_viewModel.ConfigureSettingsDGV<PatientWrapper>(dgv);
|
||||
UpdateDgv();
|
||||
UpdateElements();
|
||||
btnPrescription.Visible = _viewModel.General.DoctorId != 0;
|
||||
}
|
||||
|
||||
private void UpdateElements(bool enableButtons = false)
|
||||
{
|
||||
if (_selectedPatient == null)
|
||||
btnPrescription.Enabled = btnHospital.Enabled = false;
|
||||
else
|
||||
{
|
||||
btnHospital.Enabled = _selectedPatient.HospitalAdmissions.Count != 0;
|
||||
btnPrescription.Enabled = _selectedPatient.Prescriptions.Count != 0;
|
||||
}
|
||||
btnUpdate.Enabled = btnDelete.Enabled = enableButtons;
|
||||
}
|
||||
|
||||
private void UpdateDgv()
|
||||
{
|
||||
_viewModel.SetDefaultDataSource(dgv);
|
||||
}
|
||||
|
||||
private void dgv_SelectionChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (dgv.SelectedRows.Count != 0 && !dgv.CurrentRow.IsNewRow)
|
||||
{
|
||||
DataGridViewRow selectedRow = dgv.SelectedRows[0];
|
||||
int id = int.Parse(selectedRow.Cells[_columnIdName].Value.ToString() ?? "");
|
||||
_selectedPatient = _viewModel.GetPatient(id).FirstOrDefault();
|
||||
if (_selectedPatient != null)
|
||||
UpdateElements(true);
|
||||
}
|
||||
}
|
||||
|
||||
private void btnUpdate_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (_selectedPatient != null)
|
||||
{
|
||||
PatientDataForm pf = new(_selectedPatient);
|
||||
if (pf.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
UpdateElements();
|
||||
UpdateDgv();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void btnDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (_selectedPatient != null)
|
||||
{
|
||||
_viewModel.DeletePatient(_selectedPatient);
|
||||
UpdateElements();
|
||||
UpdateDgv();
|
||||
}
|
||||
}
|
||||
|
||||
private void btnPrescription_Click(object sender, EventArgs e)
|
||||
{
|
||||
PrescriptionForm pf = new(_selectedPatient);
|
||||
pf.ShowDialog();
|
||||
}
|
||||
|
||||
private void btnHospital_Click(object sender, EventArgs e)
|
||||
{
|
||||
HospitalForm hf = new(_selectedPatient);
|
||||
hf.ShowDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="cmsMedicineProductCost.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>184, 17</value>
|
||||
</metadata>
|
||||
<metadata name="cmsMedicineProduct.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
+244
@@ -0,0 +1,244 @@
|
||||
namespace Register_office.View.PatientV
|
||||
{
|
||||
partial class DrugDataForm
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
label7 = new Label();
|
||||
btnOK = new Button();
|
||||
button2 = new Button();
|
||||
cbDrug = new ComboBox();
|
||||
cbPatient = new ComboBox();
|
||||
label1 = new Label();
|
||||
label5 = new Label();
|
||||
cbUnit = new ComboBox();
|
||||
label2 = new Label();
|
||||
nudDose = new NumericUpDown();
|
||||
cbIntakeMethod = new ComboBox();
|
||||
label3 = new Label();
|
||||
label4 = new Label();
|
||||
nudDurationDays = new NumericUpDown();
|
||||
((System.ComponentModel.ISupportInitialize)nudDose).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)nudDurationDays).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// label7
|
||||
//
|
||||
label7.AutoSize = true;
|
||||
label7.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label7.Location = new Point(12, 69);
|
||||
label7.Name = "label7";
|
||||
label7.Size = new Size(103, 25);
|
||||
label7.TabIndex = 11;
|
||||
label7.Text = "Лекарство";
|
||||
//
|
||||
// btnOK
|
||||
//
|
||||
btnOK.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
||||
btnOK.DialogResult = DialogResult.OK;
|
||||
btnOK.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnOK.Location = new Point(12, 330);
|
||||
btnOK.Name = "btnOK";
|
||||
btnOK.Size = new Size(161, 42);
|
||||
btnOK.TabIndex = 3;
|
||||
btnOK.Text = "Добавить";
|
||||
btnOK.UseVisualStyleBackColor = true;
|
||||
btnOK.Click += btnOK_Click;
|
||||
//
|
||||
// button2
|
||||
//
|
||||
button2.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
||||
button2.DialogResult = DialogResult.Cancel;
|
||||
button2.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
button2.Location = new Point(249, 330);
|
||||
button2.Name = "button2";
|
||||
button2.Size = new Size(161, 42);
|
||||
button2.TabIndex = 4;
|
||||
button2.Text = "Отмена";
|
||||
button2.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// cbDrug
|
||||
//
|
||||
cbDrug.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
cbDrug.Font = new Font("Segoe UI", 12F);
|
||||
cbDrug.FormattingEnabled = true;
|
||||
cbDrug.Location = new Point(12, 97);
|
||||
cbDrug.Name = "cbDrug";
|
||||
cbDrug.Size = new Size(398, 29);
|
||||
cbDrug.TabIndex = 1;
|
||||
//
|
||||
// cbPatient
|
||||
//
|
||||
cbPatient.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
cbPatient.Font = new Font("Segoe UI", 12F);
|
||||
cbPatient.FormattingEnabled = true;
|
||||
cbPatient.Items.AddRange(new object[] { "Мужчина", "Женщина" });
|
||||
cbPatient.Location = new Point(12, 37);
|
||||
cbPatient.Name = "cbPatient";
|
||||
cbPatient.Size = new Size(398, 29);
|
||||
cbPatient.TabIndex = 0;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
label1.AutoSize = true;
|
||||
label1.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label1.Location = new Point(12, 9);
|
||||
label1.Name = "label1";
|
||||
label1.Size = new Size(87, 25);
|
||||
label1.TabIndex = 23;
|
||||
label1.Text = "Пациент";
|
||||
//
|
||||
// label5
|
||||
//
|
||||
label5.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
label5.AutoSize = true;
|
||||
label5.Font = new Font("Segoe UI", 14.25F);
|
||||
label5.Location = new Point(224, 129);
|
||||
label5.Name = "label5";
|
||||
label5.Size = new Size(186, 25);
|
||||
label5.TabIndex = 28;
|
||||
label5.Text = "Единица измерения";
|
||||
//
|
||||
// cbUnit
|
||||
//
|
||||
cbUnit.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
cbUnit.Font = new Font("Segoe UI", 12F);
|
||||
cbUnit.FormattingEnabled = true;
|
||||
cbUnit.Items.AddRange(new object[] { "Физикальное", "Лабораторное", "Инструментальное" });
|
||||
cbUnit.Location = new Point(224, 157);
|
||||
cbUnit.Name = "cbUnit";
|
||||
cbUnit.Size = new Size(186, 29);
|
||||
cbUnit.TabIndex = 27;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
label2.AutoSize = true;
|
||||
label2.Font = new Font("Segoe UI", 14.25F);
|
||||
label2.Location = new Point(12, 129);
|
||||
label2.Name = "label2";
|
||||
label2.Size = new Size(54, 25);
|
||||
label2.TabIndex = 26;
|
||||
label2.Text = "Доза";
|
||||
//
|
||||
// nudDose
|
||||
//
|
||||
nudDose.DecimalPlaces = 2;
|
||||
nudDose.Font = new Font("Segoe UI", 12F);
|
||||
nudDose.Increment = new decimal(new int[] { 1, 0, 0, 65536 });
|
||||
nudDose.Location = new Point(12, 157);
|
||||
nudDose.Minimum = new decimal(new int[] { 1, 0, 0, 0 });
|
||||
nudDose.Name = "nudDose";
|
||||
nudDose.Size = new Size(120, 29);
|
||||
nudDose.TabIndex = 25;
|
||||
nudDose.Value = new decimal(new int[] { 1, 0, 0, 0 });
|
||||
//
|
||||
// cbIntakeMethod
|
||||
//
|
||||
cbIntakeMethod.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
cbIntakeMethod.Font = new Font("Segoe UI", 12F);
|
||||
cbIntakeMethod.FormattingEnabled = true;
|
||||
cbIntakeMethod.Location = new Point(12, 217);
|
||||
cbIntakeMethod.Name = "cbIntakeMethod";
|
||||
cbIntakeMethod.Size = new Size(398, 29);
|
||||
cbIntakeMethod.TabIndex = 29;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
label3.AutoSize = true;
|
||||
label3.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label3.Location = new Point(12, 189);
|
||||
label3.Name = "label3";
|
||||
label3.Size = new Size(148, 25);
|
||||
label3.TabIndex = 30;
|
||||
label3.Text = "Способ приема";
|
||||
//
|
||||
// label4
|
||||
//
|
||||
label4.AutoSize = true;
|
||||
label4.Font = new Font("Segoe UI", 14.25F);
|
||||
label4.Location = new Point(12, 249);
|
||||
label4.Name = "label4";
|
||||
label4.Size = new Size(276, 25);
|
||||
label4.TabIndex = 32;
|
||||
label4.Text = "Длительность приема (в днях)";
|
||||
//
|
||||
// nudDurationDays
|
||||
//
|
||||
nudDurationDays.Font = new Font("Segoe UI", 12F);
|
||||
nudDurationDays.Location = new Point(12, 277);
|
||||
nudDurationDays.Minimum = new decimal(new int[] { 1, 0, 0, 0 });
|
||||
nudDurationDays.Name = "nudDurationDays";
|
||||
nudDurationDays.Size = new Size(65, 29);
|
||||
nudDurationDays.TabIndex = 31;
|
||||
nudDurationDays.Value = new decimal(new int[] { 1, 0, 0, 0 });
|
||||
//
|
||||
// DrugDataForm
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(425, 384);
|
||||
Controls.Add(label4);
|
||||
Controls.Add(nudDurationDays);
|
||||
Controls.Add(cbIntakeMethod);
|
||||
Controls.Add(label3);
|
||||
Controls.Add(label5);
|
||||
Controls.Add(cbUnit);
|
||||
Controls.Add(label2);
|
||||
Controls.Add(nudDose);
|
||||
Controls.Add(cbPatient);
|
||||
Controls.Add(label1);
|
||||
Controls.Add(cbDrug);
|
||||
Controls.Add(button2);
|
||||
Controls.Add(btnOK);
|
||||
Controls.Add(label7);
|
||||
FormBorderStyle = FormBorderStyle.FixedToolWindow;
|
||||
Name = "DrugDataForm";
|
||||
StartPosition = FormStartPosition.CenterScreen;
|
||||
Text = "Назначение лекарства";
|
||||
((System.ComponentModel.ISupportInitialize)nudDose).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)nudDurationDays).EndInit();
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
private Label label7;
|
||||
private Button button2;
|
||||
internal ComboBox cbDrug;
|
||||
internal Button btnOK;
|
||||
internal ComboBox cbPatient;
|
||||
private Label label1;
|
||||
private Label label5;
|
||||
private ComboBox cbUnit;
|
||||
private Label label2;
|
||||
private NumericUpDown nudDose;
|
||||
internal ComboBox cbIntakeMethod;
|
||||
private Label label3;
|
||||
private Label label4;
|
||||
private NumericUpDown nudDurationDays;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Register_office.Model;
|
||||
using Register_office.ViewModel;
|
||||
|
||||
namespace Register_office.View.PatientV
|
||||
{
|
||||
public partial class DrugDataForm : Form
|
||||
{
|
||||
private PrescriptionViewModel _viewModel;
|
||||
private Prescription? _prescription;
|
||||
|
||||
public DrugDataForm()
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
public DrugDataForm(Prescription p)
|
||||
{
|
||||
Init();
|
||||
SetData(p);
|
||||
}
|
||||
|
||||
private void Init()
|
||||
{
|
||||
InitializeComponent();
|
||||
TopMost = true;
|
||||
_viewModel = new();
|
||||
SetDataSourceToComboBoxes();
|
||||
}
|
||||
|
||||
private void SetData(Prescription prescription)
|
||||
{
|
||||
_prescription = prescription;
|
||||
cbPatient.SelectedValue = prescription.PatientId;
|
||||
cbDrug.SelectedValue = prescription.DrugTypePrescription.DrugTypeId;
|
||||
cbUnit.SelectedValue = prescription.DrugTypePrescription.DoseUnitId;
|
||||
nudDose.Value = prescription.DrugTypePrescription.Dose;
|
||||
cbIntakeMethod.SelectedValue = prescription.DrugTypePrescription.IntakeMethodId;
|
||||
nudDurationDays.Value = prescription.DrugTypePrescription.DurationDays;
|
||||
|
||||
Text = "Просмотр процедуры";
|
||||
btnOK.Visible = cbPatient.Enabled =
|
||||
cbIntakeMethod.Enabled = cbUnit.Enabled =
|
||||
nudDose.Enabled = nudDurationDays.Enabled =
|
||||
cbDrug.Enabled = false;
|
||||
}
|
||||
|
||||
private void SetDataSourceToComboBoxes()
|
||||
{
|
||||
cbDrug.DataSource = _viewModel.General.Context.DrugTypes
|
||||
.Select(x => new ComboBoxItem { Name = x.InternationalNameRu, Id = x.DrugTypeId })
|
||||
.OrderBy(cbi => cbi.Name).ToList();
|
||||
cbDrug.DisplayMember = "Name";
|
||||
cbDrug.ValueMember = "Id";
|
||||
|
||||
cbPatient.DataSource = _viewModel.General.Context.Patients
|
||||
.Include(x => x.PatientNavigation)
|
||||
.Select(x => new ComboBoxItem
|
||||
{
|
||||
Name = x.PatientNavigation.FirstName + " " +
|
||||
x.PatientNavigation.FirstName + " " +
|
||||
x.PatientNavigation.LastName,
|
||||
Id = x.PatientId
|
||||
})
|
||||
.OrderBy(cbi => cbi.Name).ToList();
|
||||
cbPatient.DisplayMember = "Name";
|
||||
cbPatient.ValueMember = "Id";
|
||||
|
||||
cbIntakeMethod.DataSource = _viewModel.General.Context.DrugIntakeMethods
|
||||
.Select(x => new ComboBoxItem { Name = x.Name, Id = x.DrugIntakeMethodId })
|
||||
.OrderBy(cbi => cbi.Name).ToList();
|
||||
cbIntakeMethod.DisplayMember = "Name";
|
||||
cbIntakeMethod.ValueMember = "Id";
|
||||
|
||||
cbUnit.DataSource = _viewModel.General.Context.Units
|
||||
.Select(x => new ComboBoxItem { Name = x.Name, Id = x.UnitId })
|
||||
.OrderBy(cbi => cbi.Name).ToList();
|
||||
cbUnit.DisplayMember = "Name";
|
||||
cbUnit.ValueMember = "Id";
|
||||
}
|
||||
|
||||
private void btnOK_Click(object sender, EventArgs e)
|
||||
{
|
||||
Prescription p = new()
|
||||
{
|
||||
DoctorId = _viewModel.General.DoctorId,
|
||||
PatientId = int.Parse(cbPatient.SelectedValue?.ToString() ?? "-1")
|
||||
};
|
||||
|
||||
Prescription? prInDb = _viewModel.General.Context.Prescriptions
|
||||
.FirstOrDefault(x => x.PatientId == p.PatientId && x.DoctorId == p.DoctorId);
|
||||
int id = prInDb?.PrescriptionId ?? 0;
|
||||
if (prInDb == null)
|
||||
{
|
||||
id = _viewModel.AddPrescription(p);
|
||||
if (id == -1)
|
||||
{
|
||||
DialogResult = DialogResult.None;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
DrugTypePrescription pr = new()
|
||||
{
|
||||
PrescriptionId = id,
|
||||
DrugTypeId = int.Parse(cbDrug.SelectedValue?.ToString() ?? "0"),
|
||||
DoseUnitId = int.Parse(cbUnit.SelectedValue?.ToString() ?? "0"),
|
||||
IntakeMethodId = int.Parse(cbIntakeMethod.SelectedValue?.ToString() ?? "0"),
|
||||
Dose = nudDose.Value,
|
||||
DurationDays = (int)nudDurationDays.Value
|
||||
};
|
||||
if (_viewModel.AddPrescription(pr) == -1)
|
||||
{
|
||||
DialogResult = DialogResult.None;
|
||||
return;
|
||||
}
|
||||
|
||||
MessageBox.Show("Лекарство успешно назначено", "Назначение пользователю",
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
Close();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
+147
@@ -0,0 +1,147 @@
|
||||
namespace Register_office.View.PatientV
|
||||
{
|
||||
partial class ExaminationDataForm
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
label7 = new Label();
|
||||
btnOK = new Button();
|
||||
button2 = new Button();
|
||||
cbExamination = new ComboBox();
|
||||
cbPatient = new ComboBox();
|
||||
label1 = new Label();
|
||||
btnResult = new Button();
|
||||
SuspendLayout();
|
||||
//
|
||||
// label7
|
||||
//
|
||||
label7.AutoSize = true;
|
||||
label7.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label7.Location = new Point(12, 69);
|
||||
label7.Name = "label7";
|
||||
label7.Size = new Size(139, 25);
|
||||
label7.TabIndex = 11;
|
||||
label7.Text = "Обследование";
|
||||
//
|
||||
// btnOK
|
||||
//
|
||||
btnOK.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
||||
btnOK.DialogResult = DialogResult.OK;
|
||||
btnOK.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnOK.Location = new Point(12, 225);
|
||||
btnOK.Name = "btnOK";
|
||||
btnOK.Size = new Size(161, 42);
|
||||
btnOK.TabIndex = 3;
|
||||
btnOK.Text = "Добавить";
|
||||
btnOK.UseVisualStyleBackColor = true;
|
||||
btnOK.Click += btnOK_Click;
|
||||
//
|
||||
// button2
|
||||
//
|
||||
button2.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
||||
button2.DialogResult = DialogResult.Cancel;
|
||||
button2.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
button2.Location = new Point(249, 225);
|
||||
button2.Name = "button2";
|
||||
button2.Size = new Size(161, 42);
|
||||
button2.TabIndex = 4;
|
||||
button2.Text = "Отмена";
|
||||
button2.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// cbExamination
|
||||
//
|
||||
cbExamination.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
cbExamination.Font = new Font("Segoe UI", 12F);
|
||||
cbExamination.FormattingEnabled = true;
|
||||
cbExamination.Location = new Point(12, 97);
|
||||
cbExamination.Name = "cbExamination";
|
||||
cbExamination.Size = new Size(398, 29);
|
||||
cbExamination.TabIndex = 1;
|
||||
//
|
||||
// cbPatient
|
||||
//
|
||||
cbPatient.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
cbPatient.Font = new Font("Segoe UI", 12F);
|
||||
cbPatient.FormattingEnabled = true;
|
||||
cbPatient.Items.AddRange(new object[] { "Мужчина", "Женщина" });
|
||||
cbPatient.Location = new Point(12, 37);
|
||||
cbPatient.Name = "cbPatient";
|
||||
cbPatient.Size = new Size(398, 29);
|
||||
cbPatient.TabIndex = 0;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
label1.AutoSize = true;
|
||||
label1.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label1.Location = new Point(12, 9);
|
||||
label1.Name = "label1";
|
||||
label1.Size = new Size(87, 25);
|
||||
label1.TabIndex = 23;
|
||||
label1.Text = "Пациент";
|
||||
//
|
||||
// btnResult
|
||||
//
|
||||
btnResult.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
||||
btnResult.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnResult.Location = new Point(12, 155);
|
||||
btnResult.Name = "btnResult";
|
||||
btnResult.Size = new Size(398, 42);
|
||||
btnResult.TabIndex = 24;
|
||||
btnResult.Text = "Результаты";
|
||||
btnResult.UseVisualStyleBackColor = true;
|
||||
btnResult.Click += btnResult_Click;
|
||||
//
|
||||
// ExaminationDataForm
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(425, 279);
|
||||
Controls.Add(btnResult);
|
||||
Controls.Add(cbPatient);
|
||||
Controls.Add(label1);
|
||||
Controls.Add(cbExamination);
|
||||
Controls.Add(button2);
|
||||
Controls.Add(btnOK);
|
||||
Controls.Add(label7);
|
||||
FormBorderStyle = FormBorderStyle.FixedToolWindow;
|
||||
Name = "ExaminationDataForm";
|
||||
StartPosition = FormStartPosition.CenterScreen;
|
||||
Text = "Назначение обследования";
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
private Label label7;
|
||||
private Button button2;
|
||||
internal ComboBox cbExamination;
|
||||
internal Button btnOK;
|
||||
internal ComboBox cbPatient;
|
||||
private Label label1;
|
||||
internal Button btnResult;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Register_office.Model;
|
||||
using Register_office.View.TypesV;
|
||||
using Register_office.ViewModel;
|
||||
|
||||
namespace Register_office.View.PatientV
|
||||
{
|
||||
public partial class ExaminationDataForm : Form
|
||||
{
|
||||
private PrescriptionViewModel _viewModel;
|
||||
private Prescription? _prescription;
|
||||
bool _isResult;
|
||||
public ExaminationDataForm()
|
||||
{
|
||||
Init();
|
||||
btnResult.Visible = false;
|
||||
}
|
||||
|
||||
public ExaminationDataForm(Prescription p)
|
||||
{
|
||||
Init();
|
||||
SetData(p);
|
||||
}
|
||||
|
||||
private void Init()
|
||||
{
|
||||
InitializeComponent();
|
||||
TopMost = true;
|
||||
_viewModel = new();
|
||||
SetDataSourceToComboBoxes();
|
||||
}
|
||||
|
||||
private void SetData(Prescription prescription)
|
||||
{
|
||||
_prescription = prescription;
|
||||
cbPatient.SelectedValue = prescription.PatientId;
|
||||
cbExamination.SelectedValue = prescription.ExaminationTypePrescription.ExaminationTypeId;
|
||||
|
||||
Text = "Просмотр обследования";
|
||||
btnOK.Visible = cbPatient.Enabled =
|
||||
cbExamination.Enabled = false;
|
||||
|
||||
_isResult = prescription.ExaminationTypePrescription.ResultId != null;
|
||||
btnResult.Text = _isResult
|
||||
? "Посмотреть результаты"
|
||||
: "Добавить результаты";
|
||||
btnResult.Visible = true;
|
||||
}
|
||||
|
||||
private void SetDataSourceToComboBoxes()
|
||||
{
|
||||
cbExamination.DataSource = _viewModel.General.Context.ExaminationTypes
|
||||
.Select(x => new ComboBoxItem { Name = x.Name, Id = x.ExaminationTypeId })
|
||||
.OrderBy(cbi => cbi.Name).ToList();
|
||||
cbExamination.DisplayMember = "Name";
|
||||
cbExamination.ValueMember = "Id";
|
||||
|
||||
cbPatient.DataSource = _viewModel.General.Context.Patients
|
||||
.Include(x => x.PatientNavigation)
|
||||
.Select(x => new ComboBoxItem
|
||||
{
|
||||
Name = x.PatientNavigation.FirstName + " " +
|
||||
x.PatientNavigation.FirstName + " " +
|
||||
x.PatientNavigation.LastName,
|
||||
Id = x.PatientId
|
||||
})
|
||||
.OrderBy(cbi => cbi.Name).ToList();
|
||||
cbPatient.DisplayMember = "Name";
|
||||
cbPatient.ValueMember = "Id";
|
||||
}
|
||||
|
||||
private void btnOK_Click(object sender, EventArgs e)
|
||||
{
|
||||
Prescription p = new()
|
||||
{
|
||||
DoctorId = _viewModel.General.DoctorId,
|
||||
PatientId = int.Parse(cbPatient.SelectedValue?.ToString() ?? "-1")
|
||||
};
|
||||
|
||||
Prescription? prInDb = _viewModel.General.Context.Prescriptions
|
||||
.FirstOrDefault(x => x.PatientId == p.PatientId && x.DoctorId == p.DoctorId);
|
||||
int id = prInDb?.PrescriptionId ?? 0;
|
||||
if (prInDb == null)
|
||||
{
|
||||
id = _viewModel.AddPrescription(p);
|
||||
if (id == -1)
|
||||
{
|
||||
DialogResult = DialogResult.None;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
ExaminationTypePrescription pr = new()
|
||||
{
|
||||
PrescriptionId = id,
|
||||
ExaminationTypeId = int.Parse(cbExamination.SelectedValue?.ToString() ?? "0")
|
||||
};
|
||||
if (_viewModel.AddPrescription(pr) == -1)
|
||||
{
|
||||
DialogResult = DialogResult.None;
|
||||
return;
|
||||
}
|
||||
|
||||
MessageBox.Show("Обследование успешно назначено", "Назначение пользователю",
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
Close();
|
||||
|
||||
}
|
||||
|
||||
private void btnResult_Click(object sender, EventArgs e)
|
||||
{
|
||||
ResultDataForm rf;
|
||||
if (!_isResult)
|
||||
{
|
||||
rf = new(_prescription.ExaminationTypePrescription);
|
||||
if (rf.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
_isResult = true;
|
||||
btnResult.Text = "Посмотреть результаты";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
rf = new(_prescription.ExaminationTypePrescription, false);
|
||||
rf.ShowDialog();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
+258
@@ -0,0 +1,258 @@
|
||||
using Register_office.View;
|
||||
|
||||
namespace Register_office.View.PatientV
|
||||
{
|
||||
partial class PrescriptionForm
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
components = new System.ComponentModel.Container();
|
||||
splitContainer1 = new SplitContainer();
|
||||
label2 = new Label();
|
||||
btnProcedureShow = new Button();
|
||||
btnExaminationShow = new Button();
|
||||
btnDrugShow = new Button();
|
||||
label1 = new Label();
|
||||
btnProcedureAdd = new Button();
|
||||
btnDelete = new Button();
|
||||
btnExaminationAdd = new Button();
|
||||
btnDrugAdd = new Button();
|
||||
dgv = new DataGridView();
|
||||
cmsMedicineProductCost = new ContextMenuStrip(components);
|
||||
cmsMedicineProduct = new ContextMenuStrip(components);
|
||||
((System.ComponentModel.ISupportInitialize)splitContainer1).BeginInit();
|
||||
splitContainer1.Panel1.SuspendLayout();
|
||||
splitContainer1.Panel2.SuspendLayout();
|
||||
splitContainer1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)dgv).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// splitContainer1
|
||||
//
|
||||
splitContainer1.Dock = DockStyle.Fill;
|
||||
splitContainer1.FixedPanel = FixedPanel.Panel1;
|
||||
splitContainer1.Location = new Point(0, 0);
|
||||
splitContainer1.Name = "splitContainer1";
|
||||
splitContainer1.Orientation = Orientation.Horizontal;
|
||||
//
|
||||
// splitContainer1.Panel1
|
||||
//
|
||||
splitContainer1.Panel1.Controls.Add(label2);
|
||||
splitContainer1.Panel1.Controls.Add(btnProcedureShow);
|
||||
splitContainer1.Panel1.Controls.Add(btnExaminationShow);
|
||||
splitContainer1.Panel1.Controls.Add(btnDrugShow);
|
||||
splitContainer1.Panel1.Controls.Add(label1);
|
||||
splitContainer1.Panel1.Controls.Add(btnProcedureAdd);
|
||||
splitContainer1.Panel1.Controls.Add(btnDelete);
|
||||
splitContainer1.Panel1.Controls.Add(btnExaminationAdd);
|
||||
splitContainer1.Panel1.Controls.Add(btnDrugAdd);
|
||||
//
|
||||
// splitContainer1.Panel2
|
||||
//
|
||||
splitContainer1.Panel2.Controls.Add(dgv);
|
||||
splitContainer1.Size = new Size(800, 647);
|
||||
splitContainer1.SplitterDistance = 134;
|
||||
splitContainer1.SplitterWidth = 5;
|
||||
splitContainer1.TabIndex = 0;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
label2.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
label2.AutoSize = true;
|
||||
label2.Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label2.Location = new Point(12, 73);
|
||||
label2.Name = "label2";
|
||||
label2.Size = new Size(80, 17);
|
||||
label2.TabIndex = 16;
|
||||
label2.Text = "Посмотреть";
|
||||
//
|
||||
// btnProcedureShow
|
||||
//
|
||||
btnProcedureShow.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
btnProcedureShow.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnProcedureShow.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnProcedureShow.Location = new Point(348, 93);
|
||||
btnProcedureShow.Name = "btnProcedureShow";
|
||||
btnProcedureShow.Size = new Size(162, 33);
|
||||
btnProcedureShow.TabIndex = 15;
|
||||
btnProcedureShow.Text = "Процедуру";
|
||||
btnProcedureShow.UseVisualStyleBackColor = true;
|
||||
btnProcedureShow.Click += btnProcedureShow_Click;
|
||||
//
|
||||
// btnExaminationShow
|
||||
//
|
||||
btnExaminationShow.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
btnExaminationShow.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnExaminationShow.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnExaminationShow.Location = new Point(12, 93);
|
||||
btnExaminationShow.Name = "btnExaminationShow";
|
||||
btnExaminationShow.Size = new Size(162, 33);
|
||||
btnExaminationShow.TabIndex = 14;
|
||||
btnExaminationShow.Text = "Обследование";
|
||||
btnExaminationShow.UseVisualStyleBackColor = true;
|
||||
btnExaminationShow.Click += btnExaminationShow_Click;
|
||||
//
|
||||
// btnDrugShow
|
||||
//
|
||||
btnDrugShow.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
btnDrugShow.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnDrugShow.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnDrugShow.Location = new Point(180, 93);
|
||||
btnDrugShow.Name = "btnDrugShow";
|
||||
btnDrugShow.Size = new Size(162, 33);
|
||||
btnDrugShow.TabIndex = 13;
|
||||
btnDrugShow.Text = "Лекарство";
|
||||
btnDrugShow.UseVisualStyleBackColor = true;
|
||||
btnDrugShow.Click += btnDrugShow_Click;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
label1.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
label1.AutoSize = true;
|
||||
label1.Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label1.Location = new Point(12, 8);
|
||||
label1.Name = "label1";
|
||||
label1.Size = new Size(66, 17);
|
||||
label1.TabIndex = 12;
|
||||
label1.Text = "Добавить";
|
||||
//
|
||||
// btnProcedureAdd
|
||||
//
|
||||
btnProcedureAdd.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
btnProcedureAdd.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnProcedureAdd.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnProcedureAdd.Location = new Point(348, 28);
|
||||
btnProcedureAdd.Name = "btnProcedureAdd";
|
||||
btnProcedureAdd.Size = new Size(162, 33);
|
||||
btnProcedureAdd.TabIndex = 11;
|
||||
btnProcedureAdd.Text = "Процедуру";
|
||||
btnProcedureAdd.UseVisualStyleBackColor = true;
|
||||
btnProcedureAdd.Click += btnProcedureAdd_Click;
|
||||
//
|
||||
// btnDelete
|
||||
//
|
||||
btnDelete.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
btnDelete.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnDelete.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnDelete.Location = new Point(619, 28);
|
||||
btnDelete.Name = "btnDelete";
|
||||
btnDelete.Size = new Size(169, 33);
|
||||
btnDelete.TabIndex = 10;
|
||||
btnDelete.Text = "Удалить";
|
||||
btnDelete.UseVisualStyleBackColor = true;
|
||||
btnDelete.Click += btnDelete_Click;
|
||||
//
|
||||
// btnExaminationAdd
|
||||
//
|
||||
btnExaminationAdd.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
btnExaminationAdd.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnExaminationAdd.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnExaminationAdd.Location = new Point(12, 28);
|
||||
btnExaminationAdd.Name = "btnExaminationAdd";
|
||||
btnExaminationAdd.Size = new Size(162, 33);
|
||||
btnExaminationAdd.TabIndex = 7;
|
||||
btnExaminationAdd.Text = "Обследование";
|
||||
btnExaminationAdd.UseVisualStyleBackColor = true;
|
||||
btnExaminationAdd.Click += btnExaminationAdd_Click;
|
||||
//
|
||||
// btnDrugAdd
|
||||
//
|
||||
btnDrugAdd.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
btnDrugAdd.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnDrugAdd.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnDrugAdd.Location = new Point(180, 28);
|
||||
btnDrugAdd.Name = "btnDrugAdd";
|
||||
btnDrugAdd.Size = new Size(162, 33);
|
||||
btnDrugAdd.TabIndex = 5;
|
||||
btnDrugAdd.Text = "Лекарство";
|
||||
btnDrugAdd.UseVisualStyleBackColor = true;
|
||||
btnDrugAdd.Click += btnDrugAdd_Click;
|
||||
//
|
||||
// dgv
|
||||
//
|
||||
dgv.AllowUserToAddRows = false;
|
||||
dgv.AllowUserToDeleteRows = false;
|
||||
dgv.AllowUserToOrderColumns = true;
|
||||
dgv.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableWithoutHeaderText;
|
||||
dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dgv.Dock = DockStyle.Fill;
|
||||
dgv.Location = new Point(0, 0);
|
||||
dgv.MultiSelect = false;
|
||||
dgv.Name = "dgv";
|
||||
dgv.ReadOnly = true;
|
||||
dgv.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dgv.Size = new Size(800, 508);
|
||||
dgv.TabIndex = 8;
|
||||
dgv.SelectionChanged += dgv_SelectionChanged;
|
||||
//
|
||||
// cmsMedicineProductCost
|
||||
//
|
||||
cmsMedicineProductCost.Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
cmsMedicineProductCost.Name = "cmsMedicineProductCost";
|
||||
cmsMedicineProductCost.Size = new Size(61, 4);
|
||||
//
|
||||
// cmsMedicineProduct
|
||||
//
|
||||
cmsMedicineProduct.Name = "contextMenuStrip1";
|
||||
cmsMedicineProduct.Size = new Size(61, 4);
|
||||
//
|
||||
// PrescriptionForm
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 17F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(800, 647);
|
||||
Controls.Add(splitContainer1);
|
||||
Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
FormBorderStyle = FormBorderStyle.FixedSingle;
|
||||
Name = "PrescriptionForm";
|
||||
Text = "Пациенты";
|
||||
splitContainer1.Panel1.ResumeLayout(false);
|
||||
splitContainer1.Panel1.PerformLayout();
|
||||
splitContainer1.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)splitContainer1).EndInit();
|
||||
splitContainer1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)dgv).EndInit();
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private SplitContainer splitContainer1;
|
||||
private DataGridView dgv;
|
||||
private ContextMenuStrip cmsMedicineProduct;
|
||||
private ContextMenuStrip cmsMedicineProductCost;
|
||||
private Button btnExaminationAdd;
|
||||
private Button btnDrugAdd;
|
||||
private Button btnDelete;
|
||||
private Button btnProcedureAdd;
|
||||
private Label label1;
|
||||
private Label label2;
|
||||
private Button btnProcedureShow;
|
||||
private Button btnExaminationShow;
|
||||
private Button btnDrugShow;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.ChangeTracking.Internal;
|
||||
using Register_office.Model;
|
||||
using Register_office.ViewModel;
|
||||
using System.Data;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Register_office.View.PatientV
|
||||
{
|
||||
public partial class PrescriptionForm : Form
|
||||
{
|
||||
private PrescriptionViewModel _viewModel;
|
||||
private Prescription? _selectedPrescription;
|
||||
private string _columnIdName = "PrescriptionId";
|
||||
|
||||
public PrescriptionForm()
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
public PrescriptionForm(Patient patient)
|
||||
{
|
||||
Init();
|
||||
dgv.DataSource = new SortableBindingList<PrescriptionWrapper>(
|
||||
PrescriptionWrapper.ToList(_viewModel.General.Context.Prescriptions
|
||||
.Where(x => x.PatientId == patient.PatientId)
|
||||
.ToList()));
|
||||
}
|
||||
|
||||
private void Init()
|
||||
{
|
||||
InitializeComponent();
|
||||
TopMost = true;
|
||||
Text = "Назначения";
|
||||
_viewModel = new();
|
||||
_viewModel.ConfigureSettingsDGV<PrescriptionWrapper>(dgv);
|
||||
UpdateDgv();
|
||||
UpdateElements();
|
||||
}
|
||||
|
||||
private void UpdateElements(bool enableButtons = false)
|
||||
{
|
||||
if (_selectedPrescription == null)
|
||||
btnDrugShow.Enabled = btnExaminationShow.Enabled = btnProcedureShow.Enabled = false;
|
||||
else
|
||||
{
|
||||
btnDrugShow.Enabled = _selectedPrescription.DrugTypePrescription != null;
|
||||
btnExaminationShow.Enabled = _selectedPrescription.ExaminationTypePrescription != null;
|
||||
btnProcedureShow.Enabled = _selectedPrescription.ProcedureTypePrescription != null;
|
||||
}
|
||||
btnDelete.Enabled = enableButtons;
|
||||
}
|
||||
|
||||
private void UpdateDgv()
|
||||
{
|
||||
_viewModel.SetDefaultDataSource<Prescription>(dgv);
|
||||
}
|
||||
|
||||
private void dgv_SelectionChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (dgv.SelectedRows.Count != 0 && !dgv.CurrentRow.IsNewRow)
|
||||
{
|
||||
DataGridViewRow selectedRow = dgv.SelectedRows[0];
|
||||
int id = int.Parse(selectedRow.Cells[_columnIdName].Value.ToString() ?? "");
|
||||
_selectedPrescription = _viewModel.General.Context.Prescriptions
|
||||
.Include(x => x.ProcedureTypePrescription)
|
||||
.Include(x => x.DrugTypePrescription)
|
||||
.Include(x => x.ExaminationTypePrescription)
|
||||
.Where(x => x.PrescriptionId == id).FirstOrDefault();
|
||||
if (_selectedPrescription != null)
|
||||
UpdateElements(true);
|
||||
}
|
||||
}
|
||||
|
||||
private void btnDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (_selectedPrescription != null)
|
||||
{
|
||||
_viewModel.DeletePrescription(_selectedPrescription);
|
||||
UpdateElements();
|
||||
UpdateDgv();
|
||||
}
|
||||
}
|
||||
|
||||
private void btnProcedureAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
ProcedureDataForm pf = new();
|
||||
pf.ShowDialog();
|
||||
UpdateDgv();
|
||||
}
|
||||
|
||||
private void btnProcedureShow_Click(object sender, EventArgs e)
|
||||
{
|
||||
ProcedureDataForm pf = new(_selectedPrescription);
|
||||
pf.ShowDialog();
|
||||
}
|
||||
|
||||
private void btnDrugAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
DrugDataForm pf = new();
|
||||
pf.ShowDialog();
|
||||
UpdateDgv();
|
||||
}
|
||||
|
||||
private void btnDrugShow_Click(object sender, EventArgs e)
|
||||
{
|
||||
DrugDataForm pf = new(_selectedPrescription);
|
||||
pf.ShowDialog();
|
||||
}
|
||||
|
||||
private void btnExaminationAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
ExaminationDataForm pf = new();
|
||||
pf.ShowDialog();
|
||||
UpdateDgv();
|
||||
}
|
||||
|
||||
private void btnExaminationShow_Click(object sender, EventArgs e)
|
||||
{
|
||||
ExaminationDataForm pf = new(_selectedPrescription);
|
||||
pf.ShowDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="cmsMedicineProductCost.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>184, 17</value>
|
||||
</metadata>
|
||||
<metadata name="cmsMedicineProduct.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
+157
@@ -0,0 +1,157 @@
|
||||
namespace Register_office.View.PatientV
|
||||
{
|
||||
partial class ProcedureDataForm
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
label6 = new Label();
|
||||
label7 = new Label();
|
||||
btnOK = new Button();
|
||||
button2 = new Button();
|
||||
dtpSchedule = new DateTimePicker();
|
||||
cbProcedure = new ComboBox();
|
||||
cbPatient = new ComboBox();
|
||||
label1 = new Label();
|
||||
SuspendLayout();
|
||||
//
|
||||
// label6
|
||||
//
|
||||
label6.AutoSize = true;
|
||||
label6.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label6.Location = new Point(12, 139);
|
||||
label6.Name = "label6";
|
||||
label6.Size = new Size(163, 25);
|
||||
label6.TabIndex = 9;
|
||||
label6.Text = "Дата проведения";
|
||||
//
|
||||
// label7
|
||||
//
|
||||
label7.AutoSize = true;
|
||||
label7.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label7.Location = new Point(12, 69);
|
||||
label7.Name = "label7";
|
||||
label7.Size = new Size(109, 25);
|
||||
label7.TabIndex = 11;
|
||||
label7.Text = "Процедура";
|
||||
//
|
||||
// btnOK
|
||||
//
|
||||
btnOK.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
||||
btnOK.DialogResult = DialogResult.OK;
|
||||
btnOK.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnOK.Location = new Point(12, 225);
|
||||
btnOK.Name = "btnOK";
|
||||
btnOK.Size = new Size(161, 42);
|
||||
btnOK.TabIndex = 3;
|
||||
btnOK.Text = "Добавить";
|
||||
btnOK.UseVisualStyleBackColor = true;
|
||||
btnOK.Click += btnOK_Click;
|
||||
//
|
||||
// button2
|
||||
//
|
||||
button2.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
||||
button2.DialogResult = DialogResult.Cancel;
|
||||
button2.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
button2.Location = new Point(249, 225);
|
||||
button2.Name = "button2";
|
||||
button2.Size = new Size(161, 42);
|
||||
button2.TabIndex = 4;
|
||||
button2.Text = "Отмена";
|
||||
button2.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// dtpSchedule
|
||||
//
|
||||
dtpSchedule.Font = new Font("Segoe UI", 12F);
|
||||
dtpSchedule.Location = new Point(12, 167);
|
||||
dtpSchedule.MinDate = new DateTime(1940, 1, 1, 0, 0, 0, 0);
|
||||
dtpSchedule.Name = "dtpSchedule";
|
||||
dtpSchedule.Size = new Size(200, 29);
|
||||
dtpSchedule.TabIndex = 2;
|
||||
//
|
||||
// cbProcedure
|
||||
//
|
||||
cbProcedure.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
cbProcedure.Font = new Font("Segoe UI", 12F);
|
||||
cbProcedure.FormattingEnabled = true;
|
||||
cbProcedure.Location = new Point(12, 97);
|
||||
cbProcedure.Name = "cbProcedure";
|
||||
cbProcedure.Size = new Size(398, 29);
|
||||
cbProcedure.TabIndex = 1;
|
||||
//
|
||||
// cbPatient
|
||||
//
|
||||
cbPatient.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
cbPatient.Font = new Font("Segoe UI", 12F);
|
||||
cbPatient.FormattingEnabled = true;
|
||||
cbPatient.Items.AddRange(new object[] { "Мужчина", "Женщина" });
|
||||
cbPatient.Location = new Point(12, 37);
|
||||
cbPatient.Name = "cbPatient";
|
||||
cbPatient.Size = new Size(398, 29);
|
||||
cbPatient.TabIndex = 0;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
label1.AutoSize = true;
|
||||
label1.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label1.Location = new Point(12, 9);
|
||||
label1.Name = "label1";
|
||||
label1.Size = new Size(87, 25);
|
||||
label1.TabIndex = 23;
|
||||
label1.Text = "Пациент";
|
||||
//
|
||||
// ProcedureDataForm
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(425, 279);
|
||||
Controls.Add(cbPatient);
|
||||
Controls.Add(label1);
|
||||
Controls.Add(cbProcedure);
|
||||
Controls.Add(dtpSchedule);
|
||||
Controls.Add(button2);
|
||||
Controls.Add(btnOK);
|
||||
Controls.Add(label7);
|
||||
Controls.Add(label6);
|
||||
FormBorderStyle = FormBorderStyle.FixedToolWindow;
|
||||
Name = "ProcedureDataForm";
|
||||
StartPosition = FormStartPosition.CenterScreen;
|
||||
Text = "Назначение процедуры";
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
private Label label6;
|
||||
private Label label7;
|
||||
private Button button2;
|
||||
internal DateTimePicker dtpSchedule;
|
||||
internal ComboBox cbProcedure;
|
||||
internal Button btnOK;
|
||||
internal ComboBox cbPatient;
|
||||
private Label label1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Register_office.Model;
|
||||
using Register_office.ViewModel;
|
||||
|
||||
namespace Register_office.View.PatientV
|
||||
{
|
||||
public partial class ProcedureDataForm : Form
|
||||
{
|
||||
private PrescriptionViewModel _viewModel;
|
||||
private Prescription? _prescription;
|
||||
|
||||
public ProcedureDataForm()
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
public ProcedureDataForm(Prescription p)
|
||||
{
|
||||
Init();
|
||||
SetData(p);
|
||||
}
|
||||
|
||||
private void Init()
|
||||
{
|
||||
InitializeComponent();
|
||||
TopMost = true;
|
||||
_viewModel = new();
|
||||
SetDataSourceToComboBoxes();
|
||||
dtpSchedule.Value =
|
||||
dtpSchedule.MinDate = DateTime.Now;
|
||||
dtpSchedule.MaxDate = DateTime.Now.AddDays(180);
|
||||
}
|
||||
|
||||
private void SetData(Prescription prescription)
|
||||
{
|
||||
_prescription = prescription;
|
||||
cbPatient.SelectedValue = prescription.PatientId;
|
||||
dtpSchedule.Value =
|
||||
dtpSchedule.MinDate = prescription.ProcedureTypePrescription.ScheduledDatetime;
|
||||
cbProcedure.SelectedValue = prescription.ProcedureTypePrescription.ProcedureTypeId;
|
||||
|
||||
Text = "Просмотр процедуры";
|
||||
btnOK.Visible = cbPatient.Enabled =
|
||||
dtpSchedule.Enabled = cbProcedure.Enabled= false;
|
||||
}
|
||||
|
||||
private void SetDataSourceToComboBoxes()
|
||||
{
|
||||
cbProcedure.DataSource = _viewModel.General.Context.ProcedureTypes
|
||||
.Select(x => new ComboBoxItem { Name = x.Name, Id = x.ProcedureTypeId })
|
||||
.OrderBy(cbi => cbi.Name).ToList();
|
||||
cbProcedure.DisplayMember = "Name";
|
||||
cbProcedure.ValueMember = "Id";
|
||||
|
||||
cbPatient.DataSource = _viewModel.General.Context.Patients
|
||||
.Include(x => x.PatientNavigation)
|
||||
.Select(x => new ComboBoxItem
|
||||
{
|
||||
Name = x.PatientNavigation.FirstName + " " +
|
||||
x.PatientNavigation.FirstName + " " +
|
||||
x.PatientNavigation.LastName,
|
||||
Id = x.PatientId
|
||||
})
|
||||
.OrderBy(cbi => cbi.Name).ToList();
|
||||
cbPatient.DisplayMember = "Name";
|
||||
cbPatient.ValueMember = "Id";
|
||||
}
|
||||
|
||||
private void btnOK_Click(object sender, EventArgs e)
|
||||
{
|
||||
Prescription p = new()
|
||||
{
|
||||
DoctorId = _viewModel.General.DoctorId,
|
||||
PatientId = int.Parse(cbPatient.SelectedValue?.ToString() ?? "-1")
|
||||
};
|
||||
|
||||
Prescription? prInDb = _viewModel.General.Context.Prescriptions
|
||||
.FirstOrDefault(x => x.PatientId == p.PatientId && x.DoctorId == p.DoctorId);
|
||||
int id = prInDb?.PrescriptionId ?? 0;
|
||||
if (prInDb == null)
|
||||
{
|
||||
id = _viewModel.AddPrescription(p);
|
||||
if (id == -1)
|
||||
{
|
||||
DialogResult = DialogResult.None;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
ProcedureTypePrescription pr = new()
|
||||
{
|
||||
PrescriptionId = id,
|
||||
ProcedureTypeId = int.Parse(cbProcedure.SelectedValue?.ToString() ?? "0"),
|
||||
ScheduledDatetime = dtpSchedule.Value
|
||||
};
|
||||
if (_viewModel.AddPrescription(pr) == -1)
|
||||
{
|
||||
DialogResult = DialogResult.None;
|
||||
return;
|
||||
}
|
||||
|
||||
MessageBox.Show("Процедура успешно назначена", "Назначение пользователю",
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
Close();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
+217
@@ -0,0 +1,217 @@
|
||||
namespace Register_office.View.TypesV
|
||||
{
|
||||
partial class ResultDataForm
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
cbTypeResult = new ComboBox();
|
||||
label1 = new Label();
|
||||
button2 = new Button();
|
||||
btnOK = new Button();
|
||||
cbValue = new ComboBox();
|
||||
lblBool = new Label();
|
||||
lblUnit = new Label();
|
||||
cbUnit = new ComboBox();
|
||||
lblCount = new Label();
|
||||
nudCount = new NumericUpDown();
|
||||
cbExamination = new ComboBox();
|
||||
label2 = new Label();
|
||||
((System.ComponentModel.ISupportInitialize)nudCount).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// cbTypeResult
|
||||
//
|
||||
cbTypeResult.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
cbTypeResult.Font = new Font("Segoe UI", 12F);
|
||||
cbTypeResult.FormattingEnabled = true;
|
||||
cbTypeResult.Items.AddRange(new object[] { "Числовой", "Качественный" });
|
||||
cbTypeResult.Location = new Point(12, 37);
|
||||
cbTypeResult.Name = "cbTypeResult";
|
||||
cbTypeResult.Size = new Size(143, 29);
|
||||
cbTypeResult.TabIndex = 24;
|
||||
cbTypeResult.TextChanged += cbTypeResult_TextChanged;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
label1.AutoSize = true;
|
||||
label1.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label1.Location = new Point(12, 9);
|
||||
label1.Name = "label1";
|
||||
label1.Size = new Size(143, 25);
|
||||
label1.TabIndex = 25;
|
||||
label1.Text = "Тип результата";
|
||||
//
|
||||
// button2
|
||||
//
|
||||
button2.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
||||
button2.DialogResult = DialogResult.Cancel;
|
||||
button2.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
button2.Location = new Point(192, 201);
|
||||
button2.Name = "button2";
|
||||
button2.Size = new Size(161, 42);
|
||||
button2.TabIndex = 27;
|
||||
button2.Text = "Отмена";
|
||||
button2.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// btnOK
|
||||
//
|
||||
btnOK.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
||||
btnOK.DialogResult = DialogResult.OK;
|
||||
btnOK.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnOK.Location = new Point(12, 201);
|
||||
btnOK.Name = "btnOK";
|
||||
btnOK.Size = new Size(161, 42);
|
||||
btnOK.TabIndex = 26;
|
||||
btnOK.Text = "Добавить";
|
||||
btnOK.UseVisualStyleBackColor = true;
|
||||
btnOK.Click += btnOK_Click;
|
||||
//
|
||||
// cbValue
|
||||
//
|
||||
cbValue.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
cbValue.Font = new Font("Segoe UI", 12F);
|
||||
cbValue.FormattingEnabled = true;
|
||||
cbValue.Items.AddRange(new object[] { "Положительный", "Отрицательный" });
|
||||
cbValue.Location = new Point(12, 97);
|
||||
cbValue.Name = "cbValue";
|
||||
cbValue.Size = new Size(143, 29);
|
||||
cbValue.TabIndex = 31;
|
||||
//
|
||||
// lblBool
|
||||
//
|
||||
lblBool.AutoSize = true;
|
||||
lblBool.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
lblBool.Location = new Point(12, 69);
|
||||
lblBool.Name = "lblBool";
|
||||
lblBool.Size = new Size(96, 25);
|
||||
lblBool.TabIndex = 32;
|
||||
lblBool.Text = "Результат";
|
||||
//
|
||||
// lblUnit
|
||||
//
|
||||
lblUnit.AutoSize = true;
|
||||
lblUnit.Font = new Font("Segoe UI", 14.25F);
|
||||
lblUnit.Location = new Point(167, 129);
|
||||
lblUnit.Name = "lblUnit";
|
||||
lblUnit.Size = new Size(186, 25);
|
||||
lblUnit.TabIndex = 36;
|
||||
lblUnit.Text = "Единица измерения";
|
||||
//
|
||||
// cbUnit
|
||||
//
|
||||
cbUnit.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
cbUnit.Font = new Font("Segoe UI", 12F);
|
||||
cbUnit.FormattingEnabled = true;
|
||||
cbUnit.Items.AddRange(new object[] { "Физикальное", "Лабораторное", "Инструментальное" });
|
||||
cbUnit.Location = new Point(167, 157);
|
||||
cbUnit.Name = "cbUnit";
|
||||
cbUnit.Size = new Size(186, 29);
|
||||
cbUnit.TabIndex = 35;
|
||||
//
|
||||
// lblCount
|
||||
//
|
||||
lblCount.AutoSize = true;
|
||||
lblCount.Font = new Font("Segoe UI", 14.25F);
|
||||
lblCount.Location = new Point(12, 129);
|
||||
lblCount.Name = "lblCount";
|
||||
lblCount.Size = new Size(114, 25);
|
||||
lblCount.TabIndex = 34;
|
||||
lblCount.Text = "Количество";
|
||||
//
|
||||
// nudCount
|
||||
//
|
||||
nudCount.DecimalPlaces = 2;
|
||||
nudCount.Font = new Font("Segoe UI", 12F);
|
||||
nudCount.Increment = new decimal(new int[] { 1, 0, 0, 65536 });
|
||||
nudCount.Location = new Point(12, 157);
|
||||
nudCount.Minimum = new decimal(new int[] { 100, 0, 0, int.MinValue });
|
||||
nudCount.Name = "nudCount";
|
||||
nudCount.Size = new Size(143, 29);
|
||||
nudCount.TabIndex = 33;
|
||||
//
|
||||
// cbExamination
|
||||
//
|
||||
cbExamination.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
cbExamination.Font = new Font("Segoe UI", 12F);
|
||||
cbExamination.FormattingEnabled = true;
|
||||
cbExamination.Items.AddRange(new object[] { "Числовой", "Качественный" });
|
||||
cbExamination.Location = new Point(167, 37);
|
||||
cbExamination.Name = "cbExamination";
|
||||
cbExamination.Size = new Size(186, 29);
|
||||
cbExamination.TabIndex = 37;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
label2.AutoSize = true;
|
||||
label2.Font = new Font("Segoe UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label2.Location = new Point(167, 9);
|
||||
label2.Name = "label2";
|
||||
label2.Size = new Size(139, 25);
|
||||
label2.TabIndex = 38;
|
||||
label2.Text = "Обследование";
|
||||
//
|
||||
// ResultDataForm
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 17F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(365, 255);
|
||||
Controls.Add(cbExamination);
|
||||
Controls.Add(label2);
|
||||
Controls.Add(lblUnit);
|
||||
Controls.Add(cbUnit);
|
||||
Controls.Add(lblCount);
|
||||
Controls.Add(nudCount);
|
||||
Controls.Add(cbValue);
|
||||
Controls.Add(lblBool);
|
||||
Controls.Add(button2);
|
||||
Controls.Add(btnOK);
|
||||
Controls.Add(cbTypeResult);
|
||||
Controls.Add(label1);
|
||||
Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
FormBorderStyle = FormBorderStyle.FixedToolWindow;
|
||||
Name = "ResultDataForm";
|
||||
Text = "Результаты";
|
||||
((System.ComponentModel.ISupportInitialize)nudCount).EndInit();
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
internal ComboBox cbTypeResult;
|
||||
private Label label1;
|
||||
private Button button2;
|
||||
internal Button btnOK;
|
||||
internal ComboBox cbValue;
|
||||
private Label lblBool;
|
||||
private Label lblUnit;
|
||||
private ComboBox cbUnit;
|
||||
private Label lblCount;
|
||||
private NumericUpDown nudCount;
|
||||
internal ComboBox cbExamination;
|
||||
private Label label2;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Register_office.Model;
|
||||
using Register_office.ViewModel;
|
||||
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 Register_office.View.TypesV
|
||||
{
|
||||
public partial class ResultDataForm : Form
|
||||
{
|
||||
private ResultViewModel _viewModel;
|
||||
private ExaminationTypePrescription? _prescription;
|
||||
bool _isNumericResult;
|
||||
public ResultDataForm(ExaminationTypePrescription p, bool isForAdd = true)
|
||||
{
|
||||
Init();
|
||||
_prescription = p;
|
||||
cbExamination.SelectedValue = p.ExaminationTypeId;
|
||||
cbExamination.Enabled = false;
|
||||
if (!isForAdd) SetData(p);
|
||||
}
|
||||
|
||||
private void Init()
|
||||
{
|
||||
InitializeComponent();
|
||||
TopMost = true;
|
||||
_viewModel = new();
|
||||
SetDataSourceToComboBoxes();
|
||||
}
|
||||
|
||||
private void SetData(ExaminationTypePrescription prescription)
|
||||
{
|
||||
_prescription = _viewModel.General.Context.ExaminationTypePrescriptions
|
||||
.Include(x => x.Result)
|
||||
.ThenInclude(y => y.NumericResult)
|
||||
.Include(x => x.Result)
|
||||
.ThenInclude(y => y.QualitativeResult)
|
||||
.First(x => x.ExaminationPrescriptionId == prescription.ExaminationPrescriptionId);
|
||||
_isNumericResult = _prescription.Result.QualitativeResult == null;
|
||||
cbTypeResult.Text = _isNumericResult
|
||||
? "Числовой"
|
||||
: "Качественный";
|
||||
if (_isNumericResult)
|
||||
{
|
||||
nudCount.Value = _prescription.Result.NumericResult.Value;
|
||||
cbUnit.SelectedValue = _prescription.Result.NumericResult.UnitId;
|
||||
|
||||
nudCount.Visible = cbUnit.Visible =
|
||||
lblCount.Visible = lblUnit.Visible = true;
|
||||
cbValue.Visible = lblBool.Visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
cbValue.Text = _prescription.Result.QualitativeResult.Value
|
||||
? "Положительный"
|
||||
: "Отрицательный";
|
||||
nudCount.Visible = cbUnit.Visible =
|
||||
lblCount.Visible = lblUnit.Visible = false;
|
||||
cbValue.Visible = lblBool.Visible = true;
|
||||
}
|
||||
|
||||
Text = "Просмотр результатов";
|
||||
btnOK.Visible = cbTypeResult.Enabled =
|
||||
nudCount.Enabled = cbUnit.Enabled =
|
||||
cbValue.Enabled = false;
|
||||
}
|
||||
|
||||
private void SetDataSourceToComboBoxes()
|
||||
{
|
||||
cbTypeResult.SelectedItem = cbTypeResult.Items[0];
|
||||
cbExamination.DataSource = _viewModel.General.Context.ExaminationTypes
|
||||
.Select(x => new ComboBoxItem { Name = x.Name, Id = x.ExaminationTypeId })
|
||||
.OrderBy(cbi => cbi.Name).ToList();
|
||||
cbExamination.DisplayMember = "Name";
|
||||
cbExamination.ValueMember = "Id";
|
||||
|
||||
cbUnit.DataSource = _viewModel.General.Context.Units
|
||||
.Select(x => new ComboBoxItem { Name = x.Name, Id = x.UnitId })
|
||||
.OrderBy(cbi => cbi.Name).ToList();
|
||||
cbUnit.DisplayMember = "Name";
|
||||
cbUnit.ValueMember = "Id";
|
||||
}
|
||||
|
||||
private void btnOK_Click(object sender, EventArgs e)
|
||||
{
|
||||
Result r = new()
|
||||
{
|
||||
ExaminationId = int.Parse(cbExamination.SelectedValue?.ToString() ?? "-1")
|
||||
};
|
||||
|
||||
int id = _viewModel.AddResult(r);
|
||||
if (id == -1)
|
||||
{
|
||||
DialogResult = DialogResult.None;
|
||||
return;
|
||||
}
|
||||
|
||||
if (cbTypeResult.Text == "Качественный")
|
||||
{
|
||||
QualitativeResult qr = new()
|
||||
{
|
||||
ResultId = id,
|
||||
Value = cbValue.Text == "Положительный"
|
||||
};
|
||||
if (_viewModel.AddResult(qr) == -1)
|
||||
{
|
||||
DialogResult = DialogResult.None;
|
||||
_viewModel.DeleteResult(r);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
NumericResult nr = new()
|
||||
{
|
||||
ResultId = id,
|
||||
UnitId = int.Parse(cbUnit.SelectedValue?.ToString() ?? "0"),
|
||||
Value = nudCount.Value
|
||||
};
|
||||
if (_viewModel.AddResult(nr) == -1)
|
||||
{
|
||||
DialogResult = DialogResult.None;
|
||||
_viewModel.DeleteResult(r);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
_prescription.ResultId = id;
|
||||
_viewModel.Update();
|
||||
|
||||
MessageBox.Show("Результаты успешно добавлены", "Результаты обследования",
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
Close();
|
||||
|
||||
}
|
||||
|
||||
private void cbTypeResult_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (cbTypeResult.Text == "Качественный")
|
||||
{
|
||||
nudCount.Visible = cbUnit.Visible =
|
||||
lblCount.Visible = lblUnit.Visible = false;
|
||||
cbValue.Visible = lblBool.Visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
nudCount.Visible = cbUnit.Visible =
|
||||
lblCount.Visible = lblUnit.Visible = true;
|
||||
cbValue.Visible = lblBool.Visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
+164
@@ -0,0 +1,164 @@
|
||||
namespace Register_office.View.RegistrationV
|
||||
{
|
||||
partial class ConnectionParametersForm
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
button1 = new Button();
|
||||
tbHost = new TextBox();
|
||||
label2 = new Label();
|
||||
tbDataBase = new TextBox();
|
||||
label1 = new Label();
|
||||
tbPassword = new TextBox();
|
||||
label3 = new Label();
|
||||
tbUsername = new TextBox();
|
||||
label4 = new Label();
|
||||
SuspendLayout();
|
||||
//
|
||||
// button1
|
||||
//
|
||||
button1.DialogResult = DialogResult.OK;
|
||||
button1.Font = new Font("Segoe UI", 12F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
button1.Location = new Point(12, 236);
|
||||
button1.Name = "button1";
|
||||
button1.Size = new Size(75, 29);
|
||||
button1.TabIndex = 2;
|
||||
button1.Text = "ОК";
|
||||
button1.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// tbHost
|
||||
//
|
||||
tbHost.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
||||
tbHost.Font = new Font("Segoe UI", 12F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
tbHost.Location = new Point(12, 33);
|
||||
tbHost.Name = "tbHost";
|
||||
tbHost.Size = new Size(212, 29);
|
||||
tbHost.TabIndex = 30;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
label2.AutoSize = true;
|
||||
label2.Font = new Font("Segoe UI", 12F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label2.Location = new Point(12, 9);
|
||||
label2.Name = "label2";
|
||||
label2.Size = new Size(124, 21);
|
||||
label2.TabIndex = 31;
|
||||
label2.Text = "Владелец (Host)";
|
||||
//
|
||||
// tbDataBase
|
||||
//
|
||||
tbDataBase.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
||||
tbDataBase.Font = new Font("Segoe UI", 12F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
tbDataBase.Location = new Point(12, 89);
|
||||
tbDataBase.Name = "tbDataBase";
|
||||
tbDataBase.Size = new Size(212, 29);
|
||||
tbDataBase.TabIndex = 32;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
label1.AutoSize = true;
|
||||
label1.Font = new Font("Segoe UI", 12F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label1.Location = new Point(12, 65);
|
||||
label1.Name = "label1";
|
||||
label1.Size = new Size(99, 21);
|
||||
label1.TabIndex = 33;
|
||||
label1.Text = "База данных";
|
||||
//
|
||||
// tbPassword
|
||||
//
|
||||
tbPassword.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
||||
tbPassword.Font = new Font("Segoe UI", 12F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
tbPassword.Location = new Point(12, 201);
|
||||
tbPassword.Name = "tbPassword";
|
||||
tbPassword.Size = new Size(212, 29);
|
||||
tbPassword.TabIndex = 36;
|
||||
tbPassword.UseSystemPasswordChar = true;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
label3.AutoSize = true;
|
||||
label3.Font = new Font("Segoe UI", 12F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label3.Location = new Point(12, 177);
|
||||
label3.Name = "label3";
|
||||
label3.Size = new Size(63, 21);
|
||||
label3.TabIndex = 37;
|
||||
label3.Text = "Пароль";
|
||||
//
|
||||
// tbUsername
|
||||
//
|
||||
tbUsername.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
||||
tbUsername.Font = new Font("Segoe UI", 12F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
tbUsername.Location = new Point(12, 145);
|
||||
tbUsername.Name = "tbUsername";
|
||||
tbUsername.Size = new Size(212, 29);
|
||||
tbUsername.TabIndex = 34;
|
||||
//
|
||||
// label4
|
||||
//
|
||||
label4.AutoSize = true;
|
||||
label4.Font = new Font("Segoe UI", 12F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label4.Location = new Point(12, 121);
|
||||
label4.Name = "label4";
|
||||
label4.Size = new Size(151, 21);
|
||||
label4.TabIndex = 35;
|
||||
label4.Text = "Суперпользователь";
|
||||
//
|
||||
// ConnectionParametersForm
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(236, 269);
|
||||
Controls.Add(tbPassword);
|
||||
Controls.Add(label3);
|
||||
Controls.Add(tbUsername);
|
||||
Controls.Add(label4);
|
||||
Controls.Add(tbDataBase);
|
||||
Controls.Add(label1);
|
||||
Controls.Add(tbHost);
|
||||
Controls.Add(label2);
|
||||
Controls.Add(button1);
|
||||
FormBorderStyle = FormBorderStyle.FixedToolWindow;
|
||||
Name = "ConnectionParametersForm";
|
||||
StartPosition = FormStartPosition.CenterScreen;
|
||||
Text = "Параметры подключения";
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private Button button1;
|
||||
internal TextBox tbHost;
|
||||
private Label label2;
|
||||
internal TextBox tbDataBase;
|
||||
private Label label1;
|
||||
internal TextBox tbPassword;
|
||||
private Label label3;
|
||||
internal TextBox tbUsername;
|
||||
private Label label4;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace Register_office.View.RegistrationV
|
||||
{
|
||||
public partial class ConnectionParametersForm : Form
|
||||
{
|
||||
public ConnectionParametersForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -0,0 +1,121 @@
|
||||
namespace Register_office.View.LoginV
|
||||
{
|
||||
partial class LoginForm
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
label1 = new Label();
|
||||
tbLogin = new TextBox();
|
||||
tbPassword = new TextBox();
|
||||
label2 = new Label();
|
||||
btnEntry = new Button();
|
||||
SuspendLayout();
|
||||
//
|
||||
// label1
|
||||
//
|
||||
label1.AutoSize = true;
|
||||
label1.Font = new Font("Segoe UI", 12F, FontStyle.Bold);
|
||||
label1.Location = new Point(12, 23);
|
||||
label1.Name = "label1";
|
||||
label1.Size = new Size(63, 21);
|
||||
label1.TabIndex = 0;
|
||||
label1.Text = "Логин:";
|
||||
//
|
||||
// tbLogin
|
||||
//
|
||||
tbLogin.Font = new Font("Segoe UI", 12F, FontStyle.Bold);
|
||||
tbLogin.Location = new Point(99, 20);
|
||||
tbLogin.MaxLength = 20;
|
||||
tbLogin.Name = "tbLogin";
|
||||
tbLogin.Size = new Size(131, 29);
|
||||
tbLogin.TabIndex = 1;
|
||||
tbLogin.Text = "Иванов Н.В.";
|
||||
tbLogin.KeyDown += RegistrationForm_KeyDown;
|
||||
//
|
||||
// tbPassword
|
||||
//
|
||||
tbPassword.Font = new Font("Segoe UI", 12F, FontStyle.Bold);
|
||||
tbPassword.Location = new Point(98, 61);
|
||||
tbPassword.MaxLength = 20;
|
||||
tbPassword.Name = "tbPassword";
|
||||
tbPassword.Size = new Size(131, 29);
|
||||
tbPassword.TabIndex = 3;
|
||||
tbPassword.Text = "Иванов123";
|
||||
tbPassword.UseSystemPasswordChar = true;
|
||||
tbPassword.KeyDown += RegistrationForm_KeyDown;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
label2.AutoSize = true;
|
||||
label2.Font = new Font("Segoe UI", 12F, FontStyle.Bold);
|
||||
label2.Location = new Point(11, 64);
|
||||
label2.Name = "label2";
|
||||
label2.Size = new Size(74, 21);
|
||||
label2.TabIndex = 2;
|
||||
label2.Text = "Пароль:";
|
||||
//
|
||||
// btnEntry
|
||||
//
|
||||
btnEntry.BackColor = Color.LightBlue;
|
||||
btnEntry.FlatStyle = FlatStyle.Flat;
|
||||
btnEntry.Font = new Font("Segoe UI", 12F);
|
||||
btnEntry.Location = new Point(54, 104);
|
||||
btnEntry.Name = "btnEntry";
|
||||
btnEntry.Size = new Size(131, 31);
|
||||
btnEntry.TabIndex = 4;
|
||||
btnEntry.Text = "ВВОД";
|
||||
btnEntry.UseVisualStyleBackColor = false;
|
||||
btnEntry.Click += btnEntry_Click;
|
||||
//
|
||||
// LoginForm
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(243, 147);
|
||||
Controls.Add(btnEntry);
|
||||
Controls.Add(tbPassword);
|
||||
Controls.Add(label2);
|
||||
Controls.Add(tbLogin);
|
||||
Controls.Add(label1);
|
||||
FormBorderStyle = FormBorderStyle.FixedToolWindow;
|
||||
Name = "LoginForm";
|
||||
StartPosition = FormStartPosition.CenterScreen;
|
||||
Text = "Авторизация пользователя";
|
||||
KeyDown += RegistrationForm_KeyDown;
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private Label label1;
|
||||
private TextBox tbLogin;
|
||||
private TextBox tbPassword;
|
||||
private Label label2;
|
||||
private Button btnEntry;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
//using Register_office.View.MenuV;
|
||||
using Register_office.ViewModel.LoginVM;
|
||||
using Npgsql;
|
||||
using Register_office.View.MenuV;
|
||||
|
||||
namespace Register_office.View.LoginV
|
||||
{
|
||||
internal partial class LoginForm : Form
|
||||
{
|
||||
private readonly LoginViewModel _viewModel;
|
||||
|
||||
public LoginForm()
|
||||
{
|
||||
_viewModel = new();
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Входит в систему
|
||||
/// </summary>
|
||||
private void btnEntry_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Проверяем логин и пароль
|
||||
int personId = _viewModel.CheckEnter(tbLogin.Text, tbPassword.Text);
|
||||
_viewModel.General.DoctorId = _viewModel.GetDoctorId(personId);
|
||||
|
||||
Hide();
|
||||
OnlyMenuForm launchForm = new();
|
||||
launchForm.ShowDialog();
|
||||
|
||||
Close();
|
||||
}
|
||||
catch (NpgsqlException ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message.Split(':').Skip(1).FirstOrDefault()?.Trim(),
|
||||
"Ошибка ввода данных", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// При нажатии enter - производит событие входа в систему
|
||||
/// </summary>
|
||||
private void RegistrationForm_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.KeyCode == Keys.Enter)
|
||||
{
|
||||
btnEntry.PerformClick();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -0,0 +1,219 @@
|
||||
using Register_office.View;
|
||||
|
||||
namespace Register_office.View.TypesV
|
||||
{
|
||||
partial class DiseaseForm
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
components = new System.ComponentModel.Container();
|
||||
splitContainer1 = new SplitContainer();
|
||||
label2 = new Label();
|
||||
tbCodeICB = new TextBox();
|
||||
btnAdd = new Button();
|
||||
btnDelete = new Button();
|
||||
btnUpdate = new Button();
|
||||
label1 = new Label();
|
||||
tbName = new TextBox();
|
||||
dgv = new DataGridView();
|
||||
cmsMedicineProductCost = new ContextMenuStrip(components);
|
||||
cmsMedicineProduct = new ContextMenuStrip(components);
|
||||
((System.ComponentModel.ISupportInitialize)splitContainer1).BeginInit();
|
||||
splitContainer1.Panel1.SuspendLayout();
|
||||
splitContainer1.Panel2.SuspendLayout();
|
||||
splitContainer1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)dgv).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// splitContainer1
|
||||
//
|
||||
splitContainer1.Dock = DockStyle.Fill;
|
||||
splitContainer1.FixedPanel = FixedPanel.Panel1;
|
||||
splitContainer1.Location = new Point(0, 0);
|
||||
splitContainer1.Name = "splitContainer1";
|
||||
splitContainer1.Orientation = Orientation.Horizontal;
|
||||
//
|
||||
// splitContainer1.Panel1
|
||||
//
|
||||
splitContainer1.Panel1.Controls.Add(label2);
|
||||
splitContainer1.Panel1.Controls.Add(tbCodeICB);
|
||||
splitContainer1.Panel1.Controls.Add(btnAdd);
|
||||
splitContainer1.Panel1.Controls.Add(btnDelete);
|
||||
splitContainer1.Panel1.Controls.Add(btnUpdate);
|
||||
splitContainer1.Panel1.Controls.Add(label1);
|
||||
splitContainer1.Panel1.Controls.Add(tbName);
|
||||
//
|
||||
// splitContainer1.Panel2
|
||||
//
|
||||
splitContainer1.Panel2.Controls.Add(dgv);
|
||||
splitContainer1.Size = new Size(800, 647);
|
||||
splitContainer1.SplitterDistance = 120;
|
||||
splitContainer1.SplitterWidth = 5;
|
||||
splitContainer1.TabIndex = 0;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
label2.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
label2.AutoSize = true;
|
||||
label2.Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label2.Location = new Point(276, 9);
|
||||
label2.Name = "label2";
|
||||
label2.Size = new Size(62, 17);
|
||||
label2.TabIndex = 10;
|
||||
label2.Text = "Код МКБ";
|
||||
//
|
||||
// tbCodeICB
|
||||
//
|
||||
tbCodeICB.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
tbCodeICB.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
tbCodeICB.Location = new Point(276, 32);
|
||||
tbCodeICB.Name = "tbCodeICB";
|
||||
tbCodeICB.Size = new Size(125, 27);
|
||||
tbCodeICB.TabIndex = 9;
|
||||
//
|
||||
// btnAdd
|
||||
//
|
||||
btnAdd.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
btnAdd.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnAdd.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnAdd.Location = new Point(458, 72);
|
||||
btnAdd.Name = "btnAdd";
|
||||
btnAdd.Size = new Size(330, 33);
|
||||
btnAdd.TabIndex = 3;
|
||||
btnAdd.Text = "Добавить";
|
||||
btnAdd.UseVisualStyleBackColor = true;
|
||||
btnAdd.Click += btnAdd_Click;
|
||||
//
|
||||
// btnDelete
|
||||
//
|
||||
btnDelete.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
btnDelete.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnDelete.Enabled = false;
|
||||
btnDelete.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnDelete.Location = new Point(626, 33);
|
||||
btnDelete.Name = "btnDelete";
|
||||
btnDelete.Size = new Size(162, 33);
|
||||
btnDelete.TabIndex = 4;
|
||||
btnDelete.Text = "Удалить";
|
||||
btnDelete.UseVisualStyleBackColor = true;
|
||||
btnDelete.Click += btnDelete_Click;
|
||||
//
|
||||
// btnUpdate
|
||||
//
|
||||
btnUpdate.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
btnUpdate.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnUpdate.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnUpdate.Location = new Point(458, 32);
|
||||
btnUpdate.Name = "btnUpdate";
|
||||
btnUpdate.Size = new Size(162, 33);
|
||||
btnUpdate.TabIndex = 1;
|
||||
btnUpdate.Text = "Изменить";
|
||||
btnUpdate.UseVisualStyleBackColor = true;
|
||||
btnUpdate.Click += btnUpdate_Click;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
label1.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
label1.AutoSize = true;
|
||||
label1.Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label1.Location = new Point(12, 10);
|
||||
label1.Name = "label1";
|
||||
label1.Size = new Size(65, 17);
|
||||
label1.TabIndex = 1;
|
||||
label1.Text = "Название";
|
||||
//
|
||||
// tbName
|
||||
//
|
||||
tbName.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
tbName.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
tbName.Location = new Point(12, 33);
|
||||
tbName.Name = "tbName";
|
||||
tbName.Size = new Size(242, 27);
|
||||
tbName.TabIndex = 0;
|
||||
//
|
||||
// dgv
|
||||
//
|
||||
dgv.AllowUserToAddRows = false;
|
||||
dgv.AllowUserToDeleteRows = false;
|
||||
dgv.AllowUserToOrderColumns = true;
|
||||
dgv.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableWithoutHeaderText;
|
||||
dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dgv.Dock = DockStyle.Fill;
|
||||
dgv.Location = new Point(0, 0);
|
||||
dgv.MultiSelect = false;
|
||||
dgv.Name = "dgv";
|
||||
dgv.ReadOnly = true;
|
||||
dgv.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dgv.Size = new Size(800, 522);
|
||||
dgv.TabIndex = 8;
|
||||
dgv.SelectionChanged += dgv_SelectionChanged;
|
||||
//
|
||||
// cmsMedicineProductCost
|
||||
//
|
||||
cmsMedicineProductCost.Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
cmsMedicineProductCost.Name = "cmsMedicineProductCost";
|
||||
cmsMedicineProductCost.Size = new Size(61, 4);
|
||||
//
|
||||
// cmsMedicineProduct
|
||||
//
|
||||
cmsMedicineProduct.Name = "contextMenuStrip1";
|
||||
cmsMedicineProduct.Size = new Size(61, 4);
|
||||
//
|
||||
// DiseaseForm
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 17F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(800, 647);
|
||||
Controls.Add(splitContainer1);
|
||||
Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
FormBorderStyle = FormBorderStyle.FixedSingle;
|
||||
Name = "DiseaseForm";
|
||||
Text = "Справочник";
|
||||
splitContainer1.Panel1.ResumeLayout(false);
|
||||
splitContainer1.Panel1.PerformLayout();
|
||||
splitContainer1.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)splitContainer1).EndInit();
|
||||
splitContainer1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)dgv).EndInit();
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private SplitContainer splitContainer1;
|
||||
private DataGridView dgv;
|
||||
private TextBox tbName;
|
||||
private Label label1;
|
||||
private Button btnUpdate;
|
||||
private Button btnDelete;
|
||||
private Button btnAdd;
|
||||
private ContextMenuStrip cmsMedicineProduct;
|
||||
private ContextMenuStrip cmsMedicineProductCost;
|
||||
private Label label2;
|
||||
private TextBox tbCodeICB;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
using Microsoft.EntityFrameworkCore.ChangeTracking.Internal;
|
||||
using Register_office.Model;
|
||||
using Register_office.ViewModel;
|
||||
using System.Data;
|
||||
|
||||
namespace Register_office.View.TypesV
|
||||
{
|
||||
public partial class DiseaseForm : Form
|
||||
{
|
||||
private TypeViewModel _viewModel;
|
||||
private Disease? _selectedType;
|
||||
private string _columnIdName = "DiseaseId";
|
||||
|
||||
public DiseaseForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
Text = "Справочник заболеваний";
|
||||
TopMost = true;
|
||||
_viewModel = new();
|
||||
_viewModel.ConfigureSettingsDGV<Disease>(dgv);
|
||||
UpdateDgv();
|
||||
UpdateElements();
|
||||
}
|
||||
|
||||
private void UpdateElements(string name = "", string codeIcb = "", bool enableButtons = false)
|
||||
{
|
||||
tbName.Text = name;
|
||||
tbCodeICB.Text = codeIcb;
|
||||
btnDelete.Enabled = btnUpdate.Enabled = enableButtons;
|
||||
}
|
||||
|
||||
private void UpdateDgv()
|
||||
{
|
||||
_viewModel.SetDefaultDataSource<Disease>(dgv);
|
||||
}
|
||||
|
||||
private void dgv_SelectionChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (dgv.SelectedRows.Count != 0 && !dgv.CurrentRow.IsNewRow)
|
||||
{
|
||||
DataGridViewRow selectedRow = dgv.SelectedRows[0];
|
||||
int id = int.Parse(selectedRow.Cells[_columnIdName].Value.ToString() ?? "");
|
||||
_selectedType = _viewModel.General.Context.Diseases.Where(x => x.DiseaseId == id).FirstOrDefault();
|
||||
if (_selectedType != null)
|
||||
UpdateElements(_selectedType.Name, _selectedType.IcdCode, true);
|
||||
}
|
||||
}
|
||||
|
||||
private void btnUpdate_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (_selectedType != null)
|
||||
{
|
||||
_selectedType.Name = tbName.Text;
|
||||
_selectedType.IcdCode = tbCodeICB.Text;
|
||||
_viewModel.General.Context.SaveChanges();
|
||||
UpdateElements();
|
||||
UpdateDgv();
|
||||
}
|
||||
}
|
||||
|
||||
private void btnDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (_selectedType != null)
|
||||
{
|
||||
_viewModel.DeleteType(_selectedType);
|
||||
UpdateElements();
|
||||
UpdateDgv();
|
||||
}
|
||||
}
|
||||
|
||||
private void btnAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
Disease d = new()
|
||||
{
|
||||
Name = tbName.Text,
|
||||
IcdCode = tbCodeICB.Text
|
||||
};
|
||||
_viewModel.AddType(d);
|
||||
UpdateElements();
|
||||
UpdateDgv();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="cmsMedicineProductCost.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>184, 17</value>
|
||||
</metadata>
|
||||
<metadata name="cmsMedicineProduct.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
+221
@@ -0,0 +1,221 @@
|
||||
using Register_office.View;
|
||||
|
||||
namespace Register_office.View.TypesV
|
||||
{
|
||||
partial class DiseaseSyndromeForm
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
components = new System.ComponentModel.Container();
|
||||
splitContainer1 = new SplitContainer();
|
||||
label3 = new Label();
|
||||
btnAdd = new Button();
|
||||
cbDisease = new ComboBox();
|
||||
btnDelete = new Button();
|
||||
label2 = new Label();
|
||||
cbSyndrome = new ComboBox();
|
||||
btnUpdate = new Button();
|
||||
dgv = new DataGridView();
|
||||
cmsMedicineProductCost = new ContextMenuStrip(components);
|
||||
cmsMedicineProduct = new ContextMenuStrip(components);
|
||||
((System.ComponentModel.ISupportInitialize)splitContainer1).BeginInit();
|
||||
splitContainer1.Panel1.SuspendLayout();
|
||||
splitContainer1.Panel2.SuspendLayout();
|
||||
splitContainer1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)dgv).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// splitContainer1
|
||||
//
|
||||
splitContainer1.Dock = DockStyle.Fill;
|
||||
splitContainer1.FixedPanel = FixedPanel.Panel1;
|
||||
splitContainer1.Location = new Point(0, 0);
|
||||
splitContainer1.Name = "splitContainer1";
|
||||
splitContainer1.Orientation = Orientation.Horizontal;
|
||||
//
|
||||
// splitContainer1.Panel1
|
||||
//
|
||||
splitContainer1.Panel1.Controls.Add(label3);
|
||||
splitContainer1.Panel1.Controls.Add(btnAdd);
|
||||
splitContainer1.Panel1.Controls.Add(cbDisease);
|
||||
splitContainer1.Panel1.Controls.Add(btnDelete);
|
||||
splitContainer1.Panel1.Controls.Add(label2);
|
||||
splitContainer1.Panel1.Controls.Add(cbSyndrome);
|
||||
splitContainer1.Panel1.Controls.Add(btnUpdate);
|
||||
//
|
||||
// splitContainer1.Panel2
|
||||
//
|
||||
splitContainer1.Panel2.Controls.Add(dgv);
|
||||
splitContainer1.Size = new Size(800, 647);
|
||||
splitContainer1.SplitterDistance = 120;
|
||||
splitContainer1.SplitterWidth = 5;
|
||||
splitContainer1.TabIndex = 0;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
label3.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
label3.AutoSize = true;
|
||||
label3.Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label3.Location = new Point(232, 17);
|
||||
label3.Name = "label3";
|
||||
label3.Size = new Size(87, 17);
|
||||
label3.TabIndex = 14;
|
||||
label3.Text = "Заболевание";
|
||||
//
|
||||
// btnAdd
|
||||
//
|
||||
btnAdd.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
btnAdd.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnAdd.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnAdd.Location = new Point(458, 72);
|
||||
btnAdd.Name = "btnAdd";
|
||||
btnAdd.Size = new Size(330, 33);
|
||||
btnAdd.TabIndex = 3;
|
||||
btnAdd.Text = "Добавить";
|
||||
btnAdd.UseVisualStyleBackColor = true;
|
||||
btnAdd.Click += btnAdd_Click;
|
||||
//
|
||||
// cbDisease
|
||||
//
|
||||
cbDisease.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
cbDisease.FormattingEnabled = true;
|
||||
cbDisease.Items.AddRange(new object[] { "Физикальное", "Лабораторное", "Инструментальное" });
|
||||
cbDisease.Location = new Point(232, 37);
|
||||
cbDisease.Name = "cbDisease";
|
||||
cbDisease.Size = new Size(211, 25);
|
||||
cbDisease.TabIndex = 13;
|
||||
//
|
||||
// btnDelete
|
||||
//
|
||||
btnDelete.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
btnDelete.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnDelete.Enabled = false;
|
||||
btnDelete.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnDelete.Location = new Point(626, 33);
|
||||
btnDelete.Name = "btnDelete";
|
||||
btnDelete.Size = new Size(162, 33);
|
||||
btnDelete.TabIndex = 4;
|
||||
btnDelete.Text = "Удалить";
|
||||
btnDelete.UseVisualStyleBackColor = true;
|
||||
btnDelete.Click += btnDelete_Click;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
label2.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
label2.AutoSize = true;
|
||||
label2.Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label2.Location = new Point(12, 16);
|
||||
label2.Name = "label2";
|
||||
label2.Size = new Size(62, 17);
|
||||
label2.TabIndex = 12;
|
||||
label2.Text = "Синдром";
|
||||
//
|
||||
// cbSyndrome
|
||||
//
|
||||
cbSyndrome.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
cbSyndrome.FormattingEnabled = true;
|
||||
cbSyndrome.Items.AddRange(new object[] { "Физикальное", "Лабораторное", "Инструментальное" });
|
||||
cbSyndrome.Location = new Point(12, 37);
|
||||
cbSyndrome.Name = "cbSyndrome";
|
||||
cbSyndrome.Size = new Size(214, 25);
|
||||
cbSyndrome.TabIndex = 11;
|
||||
//
|
||||
// btnUpdate
|
||||
//
|
||||
btnUpdate.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
btnUpdate.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnUpdate.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnUpdate.Location = new Point(458, 32);
|
||||
btnUpdate.Name = "btnUpdate";
|
||||
btnUpdate.Size = new Size(162, 33);
|
||||
btnUpdate.TabIndex = 1;
|
||||
btnUpdate.Text = "Изменить";
|
||||
btnUpdate.UseVisualStyleBackColor = true;
|
||||
btnUpdate.Click += btnUpdate_Click;
|
||||
//
|
||||
// dgv
|
||||
//
|
||||
dgv.AllowUserToAddRows = false;
|
||||
dgv.AllowUserToDeleteRows = false;
|
||||
dgv.AllowUserToOrderColumns = true;
|
||||
dgv.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableWithoutHeaderText;
|
||||
dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dgv.Dock = DockStyle.Fill;
|
||||
dgv.Location = new Point(0, 0);
|
||||
dgv.MultiSelect = false;
|
||||
dgv.Name = "dgv";
|
||||
dgv.ReadOnly = true;
|
||||
dgv.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dgv.Size = new Size(800, 522);
|
||||
dgv.TabIndex = 8;
|
||||
dgv.SelectionChanged += dgv_SelectionChanged;
|
||||
//
|
||||
// cmsMedicineProductCost
|
||||
//
|
||||
cmsMedicineProductCost.Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
cmsMedicineProductCost.Name = "cmsMedicineProductCost";
|
||||
cmsMedicineProductCost.Size = new Size(61, 4);
|
||||
//
|
||||
// cmsMedicineProduct
|
||||
//
|
||||
cmsMedicineProduct.Name = "contextMenuStrip1";
|
||||
cmsMedicineProduct.Size = new Size(61, 4);
|
||||
//
|
||||
// DiseaseSyndromeForm
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 17F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(800, 647);
|
||||
Controls.Add(splitContainer1);
|
||||
Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
FormBorderStyle = FormBorderStyle.FixedSingle;
|
||||
Name = "DiseaseSyndromeForm";
|
||||
Text = "Лекарственные препараты";
|
||||
splitContainer1.Panel1.ResumeLayout(false);
|
||||
splitContainer1.Panel1.PerformLayout();
|
||||
splitContainer1.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)splitContainer1).EndInit();
|
||||
splitContainer1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)dgv).EndInit();
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private SplitContainer splitContainer1;
|
||||
private DataGridView dgv;
|
||||
private Button btnUpdate;
|
||||
private Button btnDelete;
|
||||
private Button btnAdd;
|
||||
private ContextMenuStrip cmsMedicineProduct;
|
||||
private ContextMenuStrip cmsMedicineProductCost;
|
||||
private Label label3;
|
||||
private ComboBox cbDisease;
|
||||
private Label label2;
|
||||
private ComboBox cbSyndrome;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
using Microsoft.EntityFrameworkCore.ChangeTracking.Internal;
|
||||
using Register_office.Model;
|
||||
using Register_office.ViewModel;
|
||||
using System.Data;
|
||||
|
||||
namespace Register_office.View.TypesV
|
||||
{
|
||||
public partial class DiseaseSyndromeForm : Form
|
||||
{
|
||||
private TypeViewModel _viewModel;
|
||||
private DiseaseSyndrome? _selectedType;
|
||||
private DiseaseSyndrome _temp;
|
||||
|
||||
public DiseaseSyndromeForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
TopMost = true;
|
||||
Text = "Справочник соответствий заболеваний и синдромов";
|
||||
_viewModel = new();
|
||||
_viewModel.ConfigureSettingsDGV<DiseaseSyndromeWrapper>(dgv);
|
||||
UpdateDgv();
|
||||
SetDataSourceToComboBoxes();
|
||||
UpdateElements();
|
||||
}
|
||||
|
||||
private void SetDataSourceToComboBoxes()
|
||||
{
|
||||
cbDisease.DataSource = _viewModel.General.Context.Diseases
|
||||
.Select(x => new ComboBoxItem { Name = x.Name, Id = x.DiseaseId })
|
||||
.OrderBy(cbi => cbi.Name).ToList();
|
||||
cbDisease.DisplayMember = "Name";
|
||||
cbDisease.ValueMember = "Id";
|
||||
|
||||
cbSyndrome.DataSource = _viewModel.General.Context.SyndromeTypes
|
||||
.Select(x => new ComboBoxItem { Name = x.Name, Id = x.SyndromeTypeId })
|
||||
.OrderBy(cbi => cbi.Name).ToList();
|
||||
cbSyndrome.DisplayMember = "Name";
|
||||
cbSyndrome.ValueMember = "Id";
|
||||
}
|
||||
|
||||
private void UpdateElements(int idDis = -1, int idSynd = -1, bool enableButtons = false)
|
||||
{
|
||||
cbDisease.SelectedValue = idDis;
|
||||
cbSyndrome.SelectedValue = idSynd;
|
||||
btnDelete.Enabled = btnUpdate.Enabled = enableButtons;
|
||||
}
|
||||
|
||||
private void UpdateDgv()
|
||||
{
|
||||
_viewModel.SetDefaultDataSource<DiseaseSyndrome>(dgv);
|
||||
}
|
||||
|
||||
private void dgv_SelectionChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (dgv.SelectedRows.Count != 0 && !dgv.CurrentRow.IsNewRow)
|
||||
{
|
||||
DataGridViewRow selectedRow = dgv.SelectedRows[0];
|
||||
int idDis = int.Parse(selectedRow.Cells["DiseaseId"].Value.ToString() ?? "");
|
||||
int idSynd = int.Parse(selectedRow.Cells["SyndromeId"].Value.ToString() ?? "");
|
||||
_selectedType = _viewModel.General.Context.DiseaseSyndromes
|
||||
.Where(x => x.DiseaseId == idDis && x.SyndromeId == idSynd).FirstOrDefault();
|
||||
if (_selectedType != null)
|
||||
UpdateElements(_selectedType.DiseaseId, _selectedType.SyndromeId, true);
|
||||
}
|
||||
}
|
||||
|
||||
private void btnUpdate_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (_selectedType != null)
|
||||
{
|
||||
_selectedType.DiseaseId = int.Parse(cbDisease.SelectedValue?.ToString() ?? "-1");
|
||||
_selectedType.SyndromeId = int.Parse(cbSyndrome.SelectedValue?.ToString() ?? "-1");
|
||||
_viewModel.General.Context.SaveChanges();
|
||||
UpdateElements();
|
||||
UpdateDgv();
|
||||
}
|
||||
}
|
||||
|
||||
private void btnDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (_selectedType != null)
|
||||
{
|
||||
_viewModel.DeleteType(_selectedType);
|
||||
UpdateElements();
|
||||
UpdateDgv();
|
||||
}
|
||||
}
|
||||
|
||||
private void btnAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
_temp = new()
|
||||
{
|
||||
DiseaseId = int.Parse(cbDisease.SelectedValue?.ToString() ?? "-1"),
|
||||
SyndromeId = int.Parse(cbSyndrome.SelectedValue?.ToString() ?? "-1")
|
||||
};
|
||||
_viewModel.AddType(_temp);
|
||||
UpdateElements();
|
||||
UpdateDgv();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="cmsMedicineProductCost.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>184, 17</value>
|
||||
</metadata>
|
||||
<metadata name="cmsMedicineProduct.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
+193
@@ -0,0 +1,193 @@
|
||||
using Register_office.View;
|
||||
|
||||
namespace Register_office.View.TypesV
|
||||
{
|
||||
partial class DrugIntakeMethodForm
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
components = new System.ComponentModel.Container();
|
||||
splitContainer1 = new SplitContainer();
|
||||
btnAdd = new Button();
|
||||
btnDelete = new Button();
|
||||
btnUpdate = new Button();
|
||||
label1 = new Label();
|
||||
tbName = new TextBox();
|
||||
dgv = new DataGridView();
|
||||
cmsMedicineProductCost = new ContextMenuStrip(components);
|
||||
cmsMedicineProduct = new ContextMenuStrip(components);
|
||||
((System.ComponentModel.ISupportInitialize)splitContainer1).BeginInit();
|
||||
splitContainer1.Panel1.SuspendLayout();
|
||||
splitContainer1.Panel2.SuspendLayout();
|
||||
splitContainer1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)dgv).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// splitContainer1
|
||||
//
|
||||
splitContainer1.Dock = DockStyle.Fill;
|
||||
splitContainer1.FixedPanel = FixedPanel.Panel1;
|
||||
splitContainer1.Location = new Point(0, 0);
|
||||
splitContainer1.Name = "splitContainer1";
|
||||
splitContainer1.Orientation = Orientation.Horizontal;
|
||||
//
|
||||
// splitContainer1.Panel1
|
||||
//
|
||||
splitContainer1.Panel1.Controls.Add(btnAdd);
|
||||
splitContainer1.Panel1.Controls.Add(btnDelete);
|
||||
splitContainer1.Panel1.Controls.Add(btnUpdate);
|
||||
splitContainer1.Panel1.Controls.Add(label1);
|
||||
splitContainer1.Panel1.Controls.Add(tbName);
|
||||
//
|
||||
// splitContainer1.Panel2
|
||||
//
|
||||
splitContainer1.Panel2.Controls.Add(dgv);
|
||||
splitContainer1.Size = new Size(800, 647);
|
||||
splitContainer1.SplitterDistance = 120;
|
||||
splitContainer1.SplitterWidth = 5;
|
||||
splitContainer1.TabIndex = 0;
|
||||
//
|
||||
// btnAdd
|
||||
//
|
||||
btnAdd.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
btnAdd.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnAdd.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnAdd.Location = new Point(458, 72);
|
||||
btnAdd.Name = "btnAdd";
|
||||
btnAdd.Size = new Size(330, 33);
|
||||
btnAdd.TabIndex = 3;
|
||||
btnAdd.Text = "Добавить";
|
||||
btnAdd.UseVisualStyleBackColor = true;
|
||||
btnAdd.Click += btnAdd_Click;
|
||||
//
|
||||
// btnDelete
|
||||
//
|
||||
btnDelete.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
btnDelete.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnDelete.Enabled = false;
|
||||
btnDelete.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnDelete.Location = new Point(626, 33);
|
||||
btnDelete.Name = "btnDelete";
|
||||
btnDelete.Size = new Size(162, 33);
|
||||
btnDelete.TabIndex = 4;
|
||||
btnDelete.Text = "Удалить";
|
||||
btnDelete.UseVisualStyleBackColor = true;
|
||||
btnDelete.Click += btnDelete_Click;
|
||||
//
|
||||
// btnUpdate
|
||||
//
|
||||
btnUpdate.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
btnUpdate.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnUpdate.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnUpdate.Location = new Point(458, 32);
|
||||
btnUpdate.Name = "btnUpdate";
|
||||
btnUpdate.Size = new Size(162, 33);
|
||||
btnUpdate.TabIndex = 1;
|
||||
btnUpdate.Text = "Изменить";
|
||||
btnUpdate.UseVisualStyleBackColor = true;
|
||||
btnUpdate.Click += btnUpdate_Click;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
label1.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
label1.AutoSize = true;
|
||||
label1.Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label1.Location = new Point(12, 10);
|
||||
label1.Name = "label1";
|
||||
label1.Size = new Size(65, 17);
|
||||
label1.TabIndex = 1;
|
||||
label1.Text = "Название";
|
||||
//
|
||||
// tbName
|
||||
//
|
||||
tbName.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
tbName.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
tbName.Location = new Point(12, 33);
|
||||
tbName.Name = "tbName";
|
||||
tbName.Size = new Size(242, 27);
|
||||
tbName.TabIndex = 0;
|
||||
//
|
||||
// dgv
|
||||
//
|
||||
dgv.AllowUserToAddRows = false;
|
||||
dgv.AllowUserToDeleteRows = false;
|
||||
dgv.AllowUserToOrderColumns = true;
|
||||
dgv.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableWithoutHeaderText;
|
||||
dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dgv.Dock = DockStyle.Fill;
|
||||
dgv.Location = new Point(0, 0);
|
||||
dgv.MultiSelect = false;
|
||||
dgv.Name = "dgv";
|
||||
dgv.ReadOnly = true;
|
||||
dgv.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dgv.Size = new Size(800, 522);
|
||||
dgv.TabIndex = 8;
|
||||
dgv.SelectionChanged += dgv_SelectionChanged;
|
||||
//
|
||||
// cmsMedicineProductCost
|
||||
//
|
||||
cmsMedicineProductCost.Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
cmsMedicineProductCost.Name = "cmsMedicineProductCost";
|
||||
cmsMedicineProductCost.Size = new Size(61, 4);
|
||||
//
|
||||
// cmsMedicineProduct
|
||||
//
|
||||
cmsMedicineProduct.Name = "contextMenuStrip1";
|
||||
cmsMedicineProduct.Size = new Size(61, 4);
|
||||
//
|
||||
// DrugIntakeMethodForm
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 17F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(800, 647);
|
||||
Controls.Add(splitContainer1);
|
||||
Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
FormBorderStyle = FormBorderStyle.FixedSingle;
|
||||
Name = "DrugIntakeMethodForm";
|
||||
Text = "Лекарственные препараты";
|
||||
splitContainer1.Panel1.ResumeLayout(false);
|
||||
splitContainer1.Panel1.PerformLayout();
|
||||
splitContainer1.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)splitContainer1).EndInit();
|
||||
splitContainer1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)dgv).EndInit();
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private SplitContainer splitContainer1;
|
||||
private DataGridView dgv;
|
||||
private TextBox tbName;
|
||||
private Label label1;
|
||||
private Button btnUpdate;
|
||||
private Button btnDelete;
|
||||
private Button btnAdd;
|
||||
private ContextMenuStrip cmsMedicineProduct;
|
||||
private ContextMenuStrip cmsMedicineProductCost;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
using Microsoft.EntityFrameworkCore.ChangeTracking.Internal;
|
||||
using Register_office.Model;
|
||||
using Register_office.ViewModel;
|
||||
using System.Data;
|
||||
|
||||
namespace Register_office.View.TypesV
|
||||
{
|
||||
public partial class DrugIntakeMethodForm : Form
|
||||
{
|
||||
private TypeViewModel _viewModel;
|
||||
private DrugIntakeMethod? _selectedType;
|
||||
private string _columnIdName = "DrugIntakeMethodId";
|
||||
public DrugIntakeMethodForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
TopMost = true;
|
||||
Text = "Справочник способов приема лекарств";
|
||||
_viewModel = new();
|
||||
_viewModel.ConfigureSettingsDGV<DrugIntakeMethod>(dgv);
|
||||
UpdateDgv();
|
||||
UpdateElements();
|
||||
}
|
||||
|
||||
private void UpdateElements(string name = "", bool enableButtons = false)
|
||||
{
|
||||
tbName.Text = name;
|
||||
btnDelete.Enabled = btnUpdate.Enabled = enableButtons;
|
||||
}
|
||||
|
||||
private void UpdateDgv()
|
||||
{
|
||||
_viewModel.SetDefaultDataSource<DrugIntakeMethod>(dgv);
|
||||
}
|
||||
|
||||
private void dgv_SelectionChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (dgv.SelectedRows.Count != 0 && !dgv.CurrentRow.IsNewRow)
|
||||
{
|
||||
DataGridViewRow selectedRow = dgv.SelectedRows[0];
|
||||
int id = int.Parse(selectedRow.Cells[_columnIdName].Value.ToString() ?? "");
|
||||
_selectedType = _viewModel.General.Context.DrugIntakeMethods.Where(x => x.DrugIntakeMethodId == id).FirstOrDefault();
|
||||
if (_selectedType != null)
|
||||
UpdateElements(_selectedType.Name, true);
|
||||
}
|
||||
}
|
||||
|
||||
private void btnUpdate_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (_selectedType != null)
|
||||
{
|
||||
_selectedType.Name = tbName.Text;
|
||||
_viewModel.General.Context.SaveChanges();
|
||||
UpdateElements();
|
||||
UpdateDgv();
|
||||
}
|
||||
}
|
||||
|
||||
private void btnDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (_selectedType != null)
|
||||
{
|
||||
_viewModel.DeleteType(_selectedType);
|
||||
UpdateElements();
|
||||
UpdateDgv();
|
||||
}
|
||||
}
|
||||
|
||||
private void btnAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
DrugIntakeMethod t = new()
|
||||
{
|
||||
Name = tbName.Text
|
||||
};
|
||||
_viewModel.AddType(t);
|
||||
UpdateElements();
|
||||
UpdateDgv();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="cmsMedicineProductCost.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>184, 17</value>
|
||||
</metadata>
|
||||
<metadata name="cmsMedicineProduct.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
@@ -0,0 +1,271 @@
|
||||
using Register_office.View;
|
||||
|
||||
namespace Register_office.View.TypesV
|
||||
{
|
||||
partial class DrugTypeForm
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
components = new System.ComponentModel.Container();
|
||||
splitContainer1 = new SplitContainer();
|
||||
btnAdd = new Button();
|
||||
btnDelete = new Button();
|
||||
btnUpdate = new Button();
|
||||
label1 = new Label();
|
||||
tbNameRu = new TextBox();
|
||||
dgv = new DataGridView();
|
||||
cmsMedicineProductCost = new ContextMenuStrip(components);
|
||||
cmsMedicineProduct = new ContextMenuStrip(components);
|
||||
label2 = new Label();
|
||||
tbNameEn = new TextBox();
|
||||
label3 = new Label();
|
||||
tbNameLa = new TextBox();
|
||||
label4 = new Label();
|
||||
tbBrand = new TextBox();
|
||||
((System.ComponentModel.ISupportInitialize)splitContainer1).BeginInit();
|
||||
splitContainer1.Panel1.SuspendLayout();
|
||||
splitContainer1.Panel2.SuspendLayout();
|
||||
splitContainer1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)dgv).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// splitContainer1
|
||||
//
|
||||
splitContainer1.Dock = DockStyle.Fill;
|
||||
splitContainer1.FixedPanel = FixedPanel.Panel1;
|
||||
splitContainer1.Location = new Point(0, 0);
|
||||
splitContainer1.Name = "splitContainer1";
|
||||
splitContainer1.Orientation = Orientation.Horizontal;
|
||||
//
|
||||
// splitContainer1.Panel1
|
||||
//
|
||||
splitContainer1.Panel1.Controls.Add(label4);
|
||||
splitContainer1.Panel1.Controls.Add(tbBrand);
|
||||
splitContainer1.Panel1.Controls.Add(label3);
|
||||
splitContainer1.Panel1.Controls.Add(tbNameLa);
|
||||
splitContainer1.Panel1.Controls.Add(label2);
|
||||
splitContainer1.Panel1.Controls.Add(tbNameEn);
|
||||
splitContainer1.Panel1.Controls.Add(btnAdd);
|
||||
splitContainer1.Panel1.Controls.Add(btnDelete);
|
||||
splitContainer1.Panel1.Controls.Add(btnUpdate);
|
||||
splitContainer1.Panel1.Controls.Add(label1);
|
||||
splitContainer1.Panel1.Controls.Add(tbNameRu);
|
||||
//
|
||||
// splitContainer1.Panel2
|
||||
//
|
||||
splitContainer1.Panel2.Controls.Add(dgv);
|
||||
splitContainer1.Size = new Size(800, 647);
|
||||
splitContainer1.SplitterDistance = 120;
|
||||
splitContainer1.SplitterWidth = 5;
|
||||
splitContainer1.TabIndex = 0;
|
||||
//
|
||||
// btnAdd
|
||||
//
|
||||
btnAdd.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
btnAdd.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnAdd.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnAdd.Location = new Point(458, 84);
|
||||
btnAdd.Name = "btnAdd";
|
||||
btnAdd.Size = new Size(330, 33);
|
||||
btnAdd.TabIndex = 3;
|
||||
btnAdd.Text = "Добавить";
|
||||
btnAdd.UseVisualStyleBackColor = true;
|
||||
btnAdd.Click += btnAdd_Click;
|
||||
//
|
||||
// btnDelete
|
||||
//
|
||||
btnDelete.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
btnDelete.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnDelete.Enabled = false;
|
||||
btnDelete.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnDelete.Location = new Point(626, 33);
|
||||
btnDelete.Name = "btnDelete";
|
||||
btnDelete.Size = new Size(162, 33);
|
||||
btnDelete.TabIndex = 4;
|
||||
btnDelete.Text = "Удалить";
|
||||
btnDelete.UseVisualStyleBackColor = true;
|
||||
btnDelete.Click += btnDelete_Click;
|
||||
//
|
||||
// btnUpdate
|
||||
//
|
||||
btnUpdate.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
btnUpdate.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnUpdate.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnUpdate.Location = new Point(458, 32);
|
||||
btnUpdate.Name = "btnUpdate";
|
||||
btnUpdate.Size = new Size(162, 33);
|
||||
btnUpdate.TabIndex = 1;
|
||||
btnUpdate.Text = "Изменить";
|
||||
btnUpdate.UseVisualStyleBackColor = true;
|
||||
btnUpdate.Click += btnUpdate_Click;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
label1.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
label1.AutoSize = true;
|
||||
label1.Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label1.Location = new Point(12, 10);
|
||||
label1.Name = "label1";
|
||||
label1.Size = new Size(91, 17);
|
||||
label1.TabIndex = 1;
|
||||
label1.Text = "Название (ру)";
|
||||
//
|
||||
// tbNameRu
|
||||
//
|
||||
tbNameRu.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
tbNameRu.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
tbNameRu.Location = new Point(12, 33);
|
||||
tbNameRu.Name = "tbNameRu";
|
||||
tbNameRu.Size = new Size(208, 27);
|
||||
tbNameRu.TabIndex = 0;
|
||||
//
|
||||
// dgv
|
||||
//
|
||||
dgv.AllowUserToAddRows = false;
|
||||
dgv.AllowUserToDeleteRows = false;
|
||||
dgv.AllowUserToOrderColumns = true;
|
||||
dgv.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableWithoutHeaderText;
|
||||
dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dgv.Dock = DockStyle.Fill;
|
||||
dgv.Location = new Point(0, 0);
|
||||
dgv.MultiSelect = false;
|
||||
dgv.Name = "dgv";
|
||||
dgv.ReadOnly = true;
|
||||
dgv.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dgv.Size = new Size(800, 522);
|
||||
dgv.TabIndex = 8;
|
||||
dgv.SelectionChanged += dgv_SelectionChanged;
|
||||
//
|
||||
// cmsMedicineProductCost
|
||||
//
|
||||
cmsMedicineProductCost.Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
cmsMedicineProductCost.Name = "cmsMedicineProductCost";
|
||||
cmsMedicineProductCost.Size = new Size(61, 4);
|
||||
//
|
||||
// cmsMedicineProduct
|
||||
//
|
||||
cmsMedicineProduct.Name = "contextMenuStrip1";
|
||||
cmsMedicineProduct.Size = new Size(61, 4);
|
||||
//
|
||||
// label2
|
||||
//
|
||||
label2.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
label2.AutoSize = true;
|
||||
label2.Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label2.Location = new Point(226, 9);
|
||||
label2.Name = "label2";
|
||||
label2.Size = new Size(103, 17);
|
||||
label2.TabIndex = 6;
|
||||
label2.Text = "Название (англ)";
|
||||
//
|
||||
// tbNameEn
|
||||
//
|
||||
tbNameEn.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
tbNameEn.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
tbNameEn.Location = new Point(226, 32);
|
||||
tbNameEn.Name = "tbNameEn";
|
||||
tbNameEn.Size = new Size(208, 27);
|
||||
tbNameEn.TabIndex = 5;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
label3.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
label3.AutoSize = true;
|
||||
label3.Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label3.Location = new Point(12, 67);
|
||||
label3.Name = "label3";
|
||||
label3.Size = new Size(96, 17);
|
||||
label3.TabIndex = 8;
|
||||
label3.Text = "Название (лат)";
|
||||
//
|
||||
// tbNameLa
|
||||
//
|
||||
tbNameLa.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
tbNameLa.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
tbNameLa.Location = new Point(12, 90);
|
||||
tbNameLa.Name = "tbNameLa";
|
||||
tbNameLa.Size = new Size(208, 27);
|
||||
tbNameLa.TabIndex = 7;
|
||||
//
|
||||
// label4
|
||||
//
|
||||
label4.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
label4.AutoSize = true;
|
||||
label4.Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label4.Location = new Point(226, 67);
|
||||
label4.Name = "label4";
|
||||
label4.Size = new Size(43, 17);
|
||||
label4.TabIndex = 10;
|
||||
label4.Text = "Брэнд";
|
||||
//
|
||||
// tbBrand
|
||||
//
|
||||
tbBrand.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
tbBrand.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
tbBrand.Location = new Point(226, 90);
|
||||
tbBrand.Name = "tbBrand";
|
||||
tbBrand.Size = new Size(208, 27);
|
||||
tbBrand.TabIndex = 9;
|
||||
//
|
||||
// DrugTypeForm
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 17F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(800, 647);
|
||||
Controls.Add(splitContainer1);
|
||||
Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
FormBorderStyle = FormBorderStyle.FixedSingle;
|
||||
Name = "DrugTypeForm";
|
||||
Text = "Лекарственные препараты";
|
||||
splitContainer1.Panel1.ResumeLayout(false);
|
||||
splitContainer1.Panel1.PerformLayout();
|
||||
splitContainer1.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)splitContainer1).EndInit();
|
||||
splitContainer1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)dgv).EndInit();
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private SplitContainer splitContainer1;
|
||||
private DataGridView dgv;
|
||||
private TextBox tbNameRu;
|
||||
private Label label1;
|
||||
private Button btnUpdate;
|
||||
private Button btnDelete;
|
||||
private Button btnAdd;
|
||||
private ContextMenuStrip cmsMedicineProduct;
|
||||
private ContextMenuStrip cmsMedicineProductCost;
|
||||
private Label label4;
|
||||
private TextBox tbBrand;
|
||||
private Label label3;
|
||||
private TextBox tbNameLa;
|
||||
private Label label2;
|
||||
private TextBox tbNameEn;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
using Microsoft.EntityFrameworkCore.ChangeTracking.Internal;
|
||||
using Register_office.Model;
|
||||
using Register_office.ViewModel;
|
||||
using System.Data;
|
||||
|
||||
namespace Register_office.View.TypesV
|
||||
{
|
||||
public partial class DrugTypeForm : Form
|
||||
{
|
||||
private TypeViewModel _viewModel;
|
||||
private DrugType? _selectedType;
|
||||
private string _columnIdName = "DrugTypeId";
|
||||
private DrugType _temp;
|
||||
|
||||
public DrugTypeForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
TopMost = true;
|
||||
Text = "Справочник лекарств";
|
||||
_viewModel = new();
|
||||
_viewModel.ConfigureSettingsDGV<DrugType>(dgv);
|
||||
UpdateDgv();
|
||||
UpdateElements();
|
||||
}
|
||||
|
||||
private void UpdateElements(string nameRu = "", string? nameEn = "",
|
||||
string? nameLa = "", string? brand = "", bool enableButtons = false)
|
||||
{
|
||||
tbNameRu.Text = nameRu;
|
||||
tbNameEn.Text = nameEn;
|
||||
tbNameLa.Text = nameLa;
|
||||
tbBrand.Text = brand;
|
||||
btnDelete.Enabled = btnUpdate.Enabled = enableButtons;
|
||||
}
|
||||
|
||||
private void UpdateDgv()
|
||||
{
|
||||
_viewModel.SetDefaultDataSource<DrugType>(dgv);
|
||||
}
|
||||
|
||||
private void dgv_SelectionChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (dgv.SelectedRows.Count != 0 && !dgv.CurrentRow.IsNewRow)
|
||||
{
|
||||
DataGridViewRow selectedRow = dgv.SelectedRows[0];
|
||||
int id = int.Parse(selectedRow.Cells[_columnIdName].Value.ToString() ?? "");
|
||||
_selectedType = _viewModel.General.Context.DrugTypes.Where(x => x.DrugTypeId == id).FirstOrDefault();
|
||||
if (_selectedType != null)
|
||||
UpdateElements(_selectedType.InternationalNameRu,
|
||||
_selectedType.InternationalNameEn, _selectedType.InternationalNameLa,
|
||||
_selectedType.BrandNameRu, true);
|
||||
}
|
||||
}
|
||||
|
||||
private void btnUpdate_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (_selectedType != null)
|
||||
{
|
||||
_selectedType.InternationalNameRu = tbNameRu.Text;
|
||||
_selectedType.InternationalNameEn = tbNameEn.Text.Trim() == "" ? null : tbNameEn.Text;
|
||||
_selectedType.InternationalNameLa = tbNameLa.Text.Trim() == "" ? null : tbNameLa.Text;
|
||||
_selectedType.BrandNameRu = tbBrand.Text.Trim() == "" ? null : tbBrand.Text;
|
||||
_viewModel.General.Context.SaveChanges();
|
||||
UpdateElements();
|
||||
UpdateDgv();
|
||||
}
|
||||
}
|
||||
|
||||
private void btnDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (_selectedType != null)
|
||||
{
|
||||
_viewModel.DeleteType(_selectedType);
|
||||
UpdateElements();
|
||||
UpdateDgv();
|
||||
}
|
||||
}
|
||||
|
||||
private void btnAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
_temp = new()
|
||||
{
|
||||
InternationalNameRu = tbNameRu.Text,
|
||||
InternationalNameEn = tbNameEn.Text.Trim() == "" ? null : tbNameEn.Text,
|
||||
InternationalNameLa = tbNameLa.Text.Trim() == "" ? null : tbNameLa.Text,
|
||||
BrandNameRu = tbBrand.Text.Trim() == "" ? null : tbBrand.Text
|
||||
};
|
||||
_viewModel.AddType(_temp);
|
||||
UpdateElements();
|
||||
UpdateDgv();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="cmsMedicineProductCost.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>184, 17</value>
|
||||
</metadata>
|
||||
<metadata name="cmsMedicineProduct.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
+220
@@ -0,0 +1,220 @@
|
||||
using Register_office.View;
|
||||
|
||||
namespace Register_office.View.TypesV
|
||||
{
|
||||
partial class ExaminationTypeForm
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
components = new System.ComponentModel.Container();
|
||||
splitContainer1 = new SplitContainer();
|
||||
label2 = new Label();
|
||||
cbCategory = new ComboBox();
|
||||
btnAdd = new Button();
|
||||
btnDelete = new Button();
|
||||
btnUpdate = new Button();
|
||||
label1 = new Label();
|
||||
tbName = new TextBox();
|
||||
dgv = new DataGridView();
|
||||
cmsMedicineProductCost = new ContextMenuStrip(components);
|
||||
cmsMedicineProduct = new ContextMenuStrip(components);
|
||||
((System.ComponentModel.ISupportInitialize)splitContainer1).BeginInit();
|
||||
splitContainer1.Panel1.SuspendLayout();
|
||||
splitContainer1.Panel2.SuspendLayout();
|
||||
splitContainer1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)dgv).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// splitContainer1
|
||||
//
|
||||
splitContainer1.Dock = DockStyle.Fill;
|
||||
splitContainer1.FixedPanel = FixedPanel.Panel1;
|
||||
splitContainer1.Location = new Point(0, 0);
|
||||
splitContainer1.Name = "splitContainer1";
|
||||
splitContainer1.Orientation = Orientation.Horizontal;
|
||||
//
|
||||
// splitContainer1.Panel1
|
||||
//
|
||||
splitContainer1.Panel1.Controls.Add(label2);
|
||||
splitContainer1.Panel1.Controls.Add(cbCategory);
|
||||
splitContainer1.Panel1.Controls.Add(btnAdd);
|
||||
splitContainer1.Panel1.Controls.Add(btnDelete);
|
||||
splitContainer1.Panel1.Controls.Add(btnUpdate);
|
||||
splitContainer1.Panel1.Controls.Add(label1);
|
||||
splitContainer1.Panel1.Controls.Add(tbName);
|
||||
//
|
||||
// splitContainer1.Panel2
|
||||
//
|
||||
splitContainer1.Panel2.Controls.Add(dgv);
|
||||
splitContainer1.Size = new Size(800, 647);
|
||||
splitContainer1.SplitterDistance = 120;
|
||||
splitContainer1.SplitterWidth = 5;
|
||||
splitContainer1.TabIndex = 0;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
label2.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
label2.AutoSize = true;
|
||||
label2.Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label2.Location = new Point(260, 13);
|
||||
label2.Name = "label2";
|
||||
label2.Size = new Size(70, 17);
|
||||
label2.TabIndex = 6;
|
||||
label2.Text = "Категория";
|
||||
//
|
||||
// cbCategory
|
||||
//
|
||||
cbCategory.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
cbCategory.FormattingEnabled = true;
|
||||
cbCategory.Items.AddRange(new object[] { "Физикальное", "Лабораторное", "Инструментальное" });
|
||||
cbCategory.Location = new Point(260, 34);
|
||||
cbCategory.Name = "cbCategory";
|
||||
cbCategory.Size = new Size(192, 25);
|
||||
cbCategory.TabIndex = 5;
|
||||
//
|
||||
// btnAdd
|
||||
//
|
||||
btnAdd.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
btnAdd.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnAdd.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnAdd.Location = new Point(458, 72);
|
||||
btnAdd.Name = "btnAdd";
|
||||
btnAdd.Size = new Size(330, 33);
|
||||
btnAdd.TabIndex = 3;
|
||||
btnAdd.Text = "Добавить";
|
||||
btnAdd.UseVisualStyleBackColor = true;
|
||||
btnAdd.Click += btnAdd_Click;
|
||||
//
|
||||
// btnDelete
|
||||
//
|
||||
btnDelete.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
btnDelete.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnDelete.Enabled = false;
|
||||
btnDelete.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnDelete.Location = new Point(626, 33);
|
||||
btnDelete.Name = "btnDelete";
|
||||
btnDelete.Size = new Size(162, 33);
|
||||
btnDelete.TabIndex = 4;
|
||||
btnDelete.Text = "Удалить";
|
||||
btnDelete.UseVisualStyleBackColor = true;
|
||||
btnDelete.Click += btnDelete_Click;
|
||||
//
|
||||
// btnUpdate
|
||||
//
|
||||
btnUpdate.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
btnUpdate.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnUpdate.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnUpdate.Location = new Point(458, 32);
|
||||
btnUpdate.Name = "btnUpdate";
|
||||
btnUpdate.Size = new Size(162, 33);
|
||||
btnUpdate.TabIndex = 1;
|
||||
btnUpdate.Text = "Изменить";
|
||||
btnUpdate.UseVisualStyleBackColor = true;
|
||||
btnUpdate.Click += btnUpdate_Click;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
label1.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
label1.AutoSize = true;
|
||||
label1.Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label1.Location = new Point(12, 10);
|
||||
label1.Name = "label1";
|
||||
label1.Size = new Size(65, 17);
|
||||
label1.TabIndex = 1;
|
||||
label1.Text = "Название";
|
||||
//
|
||||
// tbName
|
||||
//
|
||||
tbName.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
tbName.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
tbName.Location = new Point(12, 33);
|
||||
tbName.Name = "tbName";
|
||||
tbName.Size = new Size(242, 27);
|
||||
tbName.TabIndex = 0;
|
||||
//
|
||||
// dgv
|
||||
//
|
||||
dgv.AllowUserToAddRows = false;
|
||||
dgv.AllowUserToDeleteRows = false;
|
||||
dgv.AllowUserToOrderColumns = true;
|
||||
dgv.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableWithoutHeaderText;
|
||||
dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dgv.Dock = DockStyle.Fill;
|
||||
dgv.Location = new Point(0, 0);
|
||||
dgv.MultiSelect = false;
|
||||
dgv.Name = "dgv";
|
||||
dgv.ReadOnly = true;
|
||||
dgv.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dgv.Size = new Size(800, 522);
|
||||
dgv.TabIndex = 8;
|
||||
dgv.SelectionChanged += dgv_SelectionChanged;
|
||||
//
|
||||
// cmsMedicineProductCost
|
||||
//
|
||||
cmsMedicineProductCost.Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
cmsMedicineProductCost.Name = "cmsMedicineProductCost";
|
||||
cmsMedicineProductCost.Size = new Size(61, 4);
|
||||
//
|
||||
// cmsMedicineProduct
|
||||
//
|
||||
cmsMedicineProduct.Name = "contextMenuStrip1";
|
||||
cmsMedicineProduct.Size = new Size(61, 4);
|
||||
//
|
||||
// ExaminationTypeForm
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 17F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(800, 647);
|
||||
Controls.Add(splitContainer1);
|
||||
Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
FormBorderStyle = FormBorderStyle.FixedSingle;
|
||||
Name = "ExaminationTypeForm";
|
||||
Text = "Лекарственные препараты";
|
||||
splitContainer1.Panel1.ResumeLayout(false);
|
||||
splitContainer1.Panel1.PerformLayout();
|
||||
splitContainer1.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)splitContainer1).EndInit();
|
||||
splitContainer1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)dgv).EndInit();
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private SplitContainer splitContainer1;
|
||||
private DataGridView dgv;
|
||||
private TextBox tbName;
|
||||
private Label label1;
|
||||
private Button btnUpdate;
|
||||
private Button btnDelete;
|
||||
private Button btnAdd;
|
||||
private ContextMenuStrip cmsMedicineProduct;
|
||||
private ContextMenuStrip cmsMedicineProductCost;
|
||||
private Label label2;
|
||||
private ComboBox cbCategory;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
using Microsoft.EntityFrameworkCore.ChangeTracking.Internal;
|
||||
using Register_office.Model;
|
||||
using Register_office.ViewModel;
|
||||
using System.Data;
|
||||
|
||||
namespace Register_office.View.TypesV
|
||||
{
|
||||
public partial class ExaminationTypeForm : Form
|
||||
{
|
||||
private TypeViewModel _viewModel;
|
||||
private ExaminationType? _selectedType;
|
||||
private string _columnIdName = "ExaminationTypeId";
|
||||
private ExaminationType _temp;
|
||||
|
||||
public ExaminationTypeForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
TopMost = true;
|
||||
Text = "Справочник обследований";
|
||||
_viewModel = new();
|
||||
_viewModel.ConfigureSettingsDGV<ExaminationType>(dgv);
|
||||
UpdateDgv();
|
||||
UpdateElements();
|
||||
}
|
||||
|
||||
private void UpdateElements(string txt1 = "", string txt2 = "", bool enableButtons = false)
|
||||
{
|
||||
tbName.Text = txt1;
|
||||
cbCategory.Text = txt2;
|
||||
btnDelete.Enabled = btnUpdate.Enabled = enableButtons;
|
||||
}
|
||||
|
||||
private void UpdateDgv()
|
||||
{
|
||||
_viewModel.SetDefaultDataSource<ExaminationType>(dgv);
|
||||
}
|
||||
|
||||
private void dgv_SelectionChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (dgv.SelectedRows.Count != 0 && !dgv.CurrentRow.IsNewRow)
|
||||
{
|
||||
DataGridViewRow selectedRow = dgv.SelectedRows[0];
|
||||
int id = int.Parse(selectedRow.Cells[_columnIdName].Value.ToString() ?? "");
|
||||
_selectedType = _viewModel.General.Context.ExaminationTypes.Where(x => x.ExaminationTypeId == id).FirstOrDefault();
|
||||
if (_selectedType != null)
|
||||
UpdateElements(_selectedType.Name, _selectedType.Category, true);
|
||||
}
|
||||
}
|
||||
|
||||
private void btnUpdate_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (_selectedType != null)
|
||||
{
|
||||
_selectedType.Name = tbName.Text;
|
||||
_selectedType.Category = cbCategory.Text;
|
||||
_viewModel.General.Context.SaveChanges();
|
||||
UpdateElements();
|
||||
UpdateDgv();
|
||||
}
|
||||
}
|
||||
|
||||
private void btnDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (_selectedType != null)
|
||||
{
|
||||
_viewModel.DeleteType(_selectedType);
|
||||
UpdateElements();
|
||||
UpdateDgv();
|
||||
}
|
||||
}
|
||||
|
||||
private void btnAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
_temp = new()
|
||||
{
|
||||
Name = tbName.Text,
|
||||
Category = cbCategory.Text
|
||||
};
|
||||
_viewModel.AddType(_temp);
|
||||
UpdateElements();
|
||||
UpdateDgv();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="cmsMedicineProductCost.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>184, 17</value>
|
||||
</metadata>
|
||||
<metadata name="cmsMedicineProduct.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
@@ -0,0 +1,193 @@
|
||||
using Register_office.View;
|
||||
|
||||
namespace Register_office.View.TypesV
|
||||
{
|
||||
partial class ProcedureTypeForm
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
components = new System.ComponentModel.Container();
|
||||
splitContainer1 = new SplitContainer();
|
||||
btnAdd = new Button();
|
||||
btnDelete = new Button();
|
||||
btnUpdate = new Button();
|
||||
label1 = new Label();
|
||||
tbName = new TextBox();
|
||||
dgv = new DataGridView();
|
||||
cmsMedicineProductCost = new ContextMenuStrip(components);
|
||||
cmsMedicineProduct = new ContextMenuStrip(components);
|
||||
((System.ComponentModel.ISupportInitialize)splitContainer1).BeginInit();
|
||||
splitContainer1.Panel1.SuspendLayout();
|
||||
splitContainer1.Panel2.SuspendLayout();
|
||||
splitContainer1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)dgv).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// splitContainer1
|
||||
//
|
||||
splitContainer1.Dock = DockStyle.Fill;
|
||||
splitContainer1.FixedPanel = FixedPanel.Panel1;
|
||||
splitContainer1.Location = new Point(0, 0);
|
||||
splitContainer1.Name = "splitContainer1";
|
||||
splitContainer1.Orientation = Orientation.Horizontal;
|
||||
//
|
||||
// splitContainer1.Panel1
|
||||
//
|
||||
splitContainer1.Panel1.Controls.Add(btnAdd);
|
||||
splitContainer1.Panel1.Controls.Add(btnDelete);
|
||||
splitContainer1.Panel1.Controls.Add(btnUpdate);
|
||||
splitContainer1.Panel1.Controls.Add(label1);
|
||||
splitContainer1.Panel1.Controls.Add(tbName);
|
||||
//
|
||||
// splitContainer1.Panel2
|
||||
//
|
||||
splitContainer1.Panel2.Controls.Add(dgv);
|
||||
splitContainer1.Size = new Size(800, 647);
|
||||
splitContainer1.SplitterDistance = 120;
|
||||
splitContainer1.SplitterWidth = 5;
|
||||
splitContainer1.TabIndex = 0;
|
||||
//
|
||||
// btnAdd
|
||||
//
|
||||
btnAdd.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
btnAdd.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnAdd.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnAdd.Location = new Point(458, 72);
|
||||
btnAdd.Name = "btnAdd";
|
||||
btnAdd.Size = new Size(330, 33);
|
||||
btnAdd.TabIndex = 3;
|
||||
btnAdd.Text = "Добавить";
|
||||
btnAdd.UseVisualStyleBackColor = true;
|
||||
btnAdd.Click += btnAdd_Click;
|
||||
//
|
||||
// btnDelete
|
||||
//
|
||||
btnDelete.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
btnDelete.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnDelete.Enabled = false;
|
||||
btnDelete.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnDelete.Location = new Point(626, 33);
|
||||
btnDelete.Name = "btnDelete";
|
||||
btnDelete.Size = new Size(162, 33);
|
||||
btnDelete.TabIndex = 4;
|
||||
btnDelete.Text = "Удалить";
|
||||
btnDelete.UseVisualStyleBackColor = true;
|
||||
btnDelete.Click += btnDelete_Click;
|
||||
//
|
||||
// btnUpdate
|
||||
//
|
||||
btnUpdate.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
btnUpdate.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnUpdate.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnUpdate.Location = new Point(458, 32);
|
||||
btnUpdate.Name = "btnUpdate";
|
||||
btnUpdate.Size = new Size(162, 33);
|
||||
btnUpdate.TabIndex = 1;
|
||||
btnUpdate.Text = "Изменить";
|
||||
btnUpdate.UseVisualStyleBackColor = true;
|
||||
btnUpdate.Click += btnUpdate_Click;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
label1.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
label1.AutoSize = true;
|
||||
label1.Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label1.Location = new Point(12, 10);
|
||||
label1.Name = "label1";
|
||||
label1.Size = new Size(65, 17);
|
||||
label1.TabIndex = 1;
|
||||
label1.Text = "Название";
|
||||
//
|
||||
// tbName
|
||||
//
|
||||
tbName.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
tbName.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
tbName.Location = new Point(12, 33);
|
||||
tbName.Name = "tbName";
|
||||
tbName.Size = new Size(242, 27);
|
||||
tbName.TabIndex = 0;
|
||||
//
|
||||
// dgv
|
||||
//
|
||||
dgv.AllowUserToAddRows = false;
|
||||
dgv.AllowUserToDeleteRows = false;
|
||||
dgv.AllowUserToOrderColumns = true;
|
||||
dgv.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableWithoutHeaderText;
|
||||
dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dgv.Dock = DockStyle.Fill;
|
||||
dgv.Location = new Point(0, 0);
|
||||
dgv.MultiSelect = false;
|
||||
dgv.Name = "dgv";
|
||||
dgv.ReadOnly = true;
|
||||
dgv.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dgv.Size = new Size(800, 522);
|
||||
dgv.TabIndex = 8;
|
||||
dgv.SelectionChanged += dgv_SelectionChanged;
|
||||
//
|
||||
// cmsMedicineProductCost
|
||||
//
|
||||
cmsMedicineProductCost.Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
cmsMedicineProductCost.Name = "cmsMedicineProductCost";
|
||||
cmsMedicineProductCost.Size = new Size(61, 4);
|
||||
//
|
||||
// cmsMedicineProduct
|
||||
//
|
||||
cmsMedicineProduct.Name = "contextMenuStrip1";
|
||||
cmsMedicineProduct.Size = new Size(61, 4);
|
||||
//
|
||||
// DrugIntakeMethodForm
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 17F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(800, 647);
|
||||
Controls.Add(splitContainer1);
|
||||
Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
FormBorderStyle = FormBorderStyle.FixedSingle;
|
||||
Name = "DrugIntakeMethodForm";
|
||||
Text = "Лекарственные препараты";
|
||||
splitContainer1.Panel1.ResumeLayout(false);
|
||||
splitContainer1.Panel1.PerformLayout();
|
||||
splitContainer1.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)splitContainer1).EndInit();
|
||||
splitContainer1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)dgv).EndInit();
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private SplitContainer splitContainer1;
|
||||
private DataGridView dgv;
|
||||
private TextBox tbName;
|
||||
private Label label1;
|
||||
private Button btnUpdate;
|
||||
private Button btnDelete;
|
||||
private Button btnAdd;
|
||||
private ContextMenuStrip cmsMedicineProduct;
|
||||
private ContextMenuStrip cmsMedicineProductCost;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
using Microsoft.EntityFrameworkCore.ChangeTracking.Internal;
|
||||
using Register_office.Model;
|
||||
using Register_office.ViewModel;
|
||||
using System.Data;
|
||||
|
||||
namespace Register_office.View.TypesV
|
||||
{
|
||||
public partial class ProcedureTypeForm : Form
|
||||
{
|
||||
private TypeViewModel _viewModel;
|
||||
private ProcedureType? _selectedType;
|
||||
private string _columnIdName = "ProcedureTypeId";
|
||||
private ProcedureType _temp;
|
||||
|
||||
public ProcedureTypeForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
TopMost = true;
|
||||
Text = "Справочник процедур";
|
||||
_viewModel = new();
|
||||
_viewModel.ConfigureSettingsDGV<ProcedureType>(dgv);
|
||||
UpdateDgv();
|
||||
UpdateElements();
|
||||
}
|
||||
|
||||
private void UpdateElements(string name = "", bool enableButtons = false)
|
||||
{
|
||||
tbName.Text = name;
|
||||
btnDelete.Enabled = btnUpdate.Enabled = enableButtons;
|
||||
}
|
||||
|
||||
private void UpdateDgv()
|
||||
{
|
||||
_viewModel.SetDefaultDataSource<ProcedureType>(dgv);
|
||||
}
|
||||
|
||||
private void dgv_SelectionChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (dgv.SelectedRows.Count != 0 && !dgv.CurrentRow.IsNewRow)
|
||||
{
|
||||
DataGridViewRow selectedRow = dgv.SelectedRows[0];
|
||||
int id = int.Parse(selectedRow.Cells[_columnIdName].Value.ToString() ?? "");
|
||||
_selectedType = _viewModel.General.Context.ProcedureTypes.Where(x => x.ProcedureTypeId == id).FirstOrDefault();
|
||||
if (_selectedType != null)
|
||||
UpdateElements(_selectedType.Name, true);
|
||||
}
|
||||
}
|
||||
|
||||
private void btnUpdate_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (_selectedType != null)
|
||||
{
|
||||
_selectedType.Name = tbName.Text;
|
||||
_viewModel.General.Context.SaveChanges();
|
||||
UpdateElements();
|
||||
UpdateDgv();
|
||||
}
|
||||
}
|
||||
|
||||
private void btnDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (_selectedType != null)
|
||||
{
|
||||
_viewModel.DeleteType(_selectedType);
|
||||
UpdateElements();
|
||||
UpdateDgv();
|
||||
}
|
||||
}
|
||||
|
||||
private void btnAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
_temp = new()
|
||||
{
|
||||
Name = tbName.Text
|
||||
};
|
||||
_viewModel.AddType(_temp);
|
||||
UpdateElements();
|
||||
UpdateDgv();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="cmsMedicineProductCost.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>184, 17</value>
|
||||
</metadata>
|
||||
<metadata name="cmsMedicineProduct.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
@@ -0,0 +1,291 @@
|
||||
using Register_office.View;
|
||||
|
||||
namespace Register_office.View.TypesV
|
||||
{
|
||||
partial class ReferenceValueForm
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
components = new System.ComponentModel.Container();
|
||||
splitContainer1 = new SplitContainer();
|
||||
btnOpen = new Button();
|
||||
label5 = new Label();
|
||||
label4 = new Label();
|
||||
nudAgeMax = new NumericUpDown();
|
||||
nudAgeMin = new NumericUpDown();
|
||||
label3 = new Label();
|
||||
cbGender = new ComboBox();
|
||||
label2 = new Label();
|
||||
cbExamination = new ComboBox();
|
||||
btnAdd = new Button();
|
||||
btnDelete = new Button();
|
||||
btnUpdate = new Button();
|
||||
dgv = new DataGridView();
|
||||
cmsMedicineProductCost = new ContextMenuStrip(components);
|
||||
cmsMedicineProduct = new ContextMenuStrip(components);
|
||||
((System.ComponentModel.ISupportInitialize)splitContainer1).BeginInit();
|
||||
splitContainer1.Panel1.SuspendLayout();
|
||||
splitContainer1.Panel2.SuspendLayout();
|
||||
splitContainer1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)nudAgeMax).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)nudAgeMin).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)dgv).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// splitContainer1
|
||||
//
|
||||
splitContainer1.Dock = DockStyle.Fill;
|
||||
splitContainer1.FixedPanel = FixedPanel.Panel1;
|
||||
splitContainer1.Location = new Point(0, 0);
|
||||
splitContainer1.Name = "splitContainer1";
|
||||
splitContainer1.Orientation = Orientation.Horizontal;
|
||||
//
|
||||
// splitContainer1.Panel1
|
||||
//
|
||||
splitContainer1.Panel1.Controls.Add(btnOpen);
|
||||
splitContainer1.Panel1.Controls.Add(label5);
|
||||
splitContainer1.Panel1.Controls.Add(label4);
|
||||
splitContainer1.Panel1.Controls.Add(nudAgeMax);
|
||||
splitContainer1.Panel1.Controls.Add(nudAgeMin);
|
||||
splitContainer1.Panel1.Controls.Add(label3);
|
||||
splitContainer1.Panel1.Controls.Add(cbGender);
|
||||
splitContainer1.Panel1.Controls.Add(label2);
|
||||
splitContainer1.Panel1.Controls.Add(cbExamination);
|
||||
splitContainer1.Panel1.Controls.Add(btnAdd);
|
||||
splitContainer1.Panel1.Controls.Add(btnDelete);
|
||||
splitContainer1.Panel1.Controls.Add(btnUpdate);
|
||||
//
|
||||
// splitContainer1.Panel2
|
||||
//
|
||||
splitContainer1.Panel2.Controls.Add(dgv);
|
||||
splitContainer1.Size = new Size(800, 647);
|
||||
splitContainer1.SplitterDistance = 120;
|
||||
splitContainer1.SplitterWidth = 5;
|
||||
splitContainer1.TabIndex = 0;
|
||||
//
|
||||
// btnOpen
|
||||
//
|
||||
btnOpen.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
btnOpen.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnOpen.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnOpen.Location = new Point(260, 78);
|
||||
btnOpen.Name = "btnOpen";
|
||||
btnOpen.Size = new Size(192, 33);
|
||||
btnOpen.TabIndex = 15;
|
||||
btnOpen.Text = "Открыть подробности";
|
||||
btnOpen.UseVisualStyleBackColor = true;
|
||||
btnOpen.Click += btnOpen_Click;
|
||||
//
|
||||
// label5
|
||||
//
|
||||
label5.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
label5.AutoSize = true;
|
||||
label5.Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label5.Location = new Point(142, 63);
|
||||
label5.Name = "label5";
|
||||
label5.Size = new Size(93, 17);
|
||||
label5.TabIndex = 14;
|
||||
label5.Text = "Макс. возраст";
|
||||
//
|
||||
// label4
|
||||
//
|
||||
label4.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
label4.AutoSize = true;
|
||||
label4.Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label4.Location = new Point(21, 63);
|
||||
label4.Name = "label4";
|
||||
label4.Size = new Size(88, 17);
|
||||
label4.TabIndex = 13;
|
||||
label4.Text = "Мин. возраст";
|
||||
//
|
||||
// nudAgeMax
|
||||
//
|
||||
nudAgeMax.Location = new Point(142, 83);
|
||||
nudAgeMax.Minimum = new decimal(new int[] { 1, 0, 0, int.MinValue });
|
||||
nudAgeMax.Name = "nudAgeMax";
|
||||
nudAgeMax.Size = new Size(96, 25);
|
||||
nudAgeMax.TabIndex = 12;
|
||||
//
|
||||
// nudAgeMin
|
||||
//
|
||||
nudAgeMin.Location = new Point(21, 83);
|
||||
nudAgeMin.Minimum = new decimal(new int[] { 1, 0, 0, int.MinValue });
|
||||
nudAgeMin.Name = "nudAgeMin";
|
||||
nudAgeMin.Size = new Size(96, 25);
|
||||
nudAgeMin.TabIndex = 11;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
label3.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
label3.AutoSize = true;
|
||||
label3.Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label3.Location = new Point(260, 14);
|
||||
label3.Name = "label3";
|
||||
label3.Size = new Size(32, 17);
|
||||
label3.TabIndex = 10;
|
||||
label3.Text = "Пол";
|
||||
//
|
||||
// cbGender
|
||||
//
|
||||
cbGender.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
cbGender.FormattingEnabled = true;
|
||||
cbGender.Items.AddRange(new object[] { "Физикальное", "Лабораторное", "Инструментальное" });
|
||||
cbGender.Location = new Point(260, 35);
|
||||
cbGender.Name = "cbGender";
|
||||
cbGender.Size = new Size(192, 25);
|
||||
cbGender.TabIndex = 9;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
label2.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
label2.AutoSize = true;
|
||||
label2.Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label2.Location = new Point(21, 14);
|
||||
label2.Name = "label2";
|
||||
label2.Size = new Size(96, 17);
|
||||
label2.TabIndex = 8;
|
||||
label2.Text = "Обследование";
|
||||
//
|
||||
// cbExamination
|
||||
//
|
||||
cbExamination.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
cbExamination.FormattingEnabled = true;
|
||||
cbExamination.Items.AddRange(new object[] { "Физикальное", "Лабораторное", "Инструментальное" });
|
||||
cbExamination.Location = new Point(21, 35);
|
||||
cbExamination.Name = "cbExamination";
|
||||
cbExamination.Size = new Size(214, 25);
|
||||
cbExamination.TabIndex = 7;
|
||||
//
|
||||
// btnAdd
|
||||
//
|
||||
btnAdd.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
btnAdd.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnAdd.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnAdd.Location = new Point(458, 78);
|
||||
btnAdd.Name = "btnAdd";
|
||||
btnAdd.Size = new Size(330, 33);
|
||||
btnAdd.TabIndex = 3;
|
||||
btnAdd.Text = "Добавить";
|
||||
btnAdd.UseVisualStyleBackColor = true;
|
||||
btnAdd.Click += btnAdd_Click;
|
||||
//
|
||||
// btnDelete
|
||||
//
|
||||
btnDelete.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
btnDelete.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnDelete.Enabled = false;
|
||||
btnDelete.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnDelete.Location = new Point(626, 33);
|
||||
btnDelete.Name = "btnDelete";
|
||||
btnDelete.Size = new Size(162, 33);
|
||||
btnDelete.TabIndex = 4;
|
||||
btnDelete.Text = "Удалить";
|
||||
btnDelete.UseVisualStyleBackColor = true;
|
||||
btnDelete.Click += btnDelete_Click;
|
||||
//
|
||||
// btnUpdate
|
||||
//
|
||||
btnUpdate.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
btnUpdate.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnUpdate.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnUpdate.Location = new Point(458, 33);
|
||||
btnUpdate.Name = "btnUpdate";
|
||||
btnUpdate.Size = new Size(162, 33);
|
||||
btnUpdate.TabIndex = 1;
|
||||
btnUpdate.Text = "Изменить";
|
||||
btnUpdate.UseVisualStyleBackColor = true;
|
||||
btnUpdate.Click += btnUpdate_Click;
|
||||
//
|
||||
// dgv
|
||||
//
|
||||
dgv.AllowUserToAddRows = false;
|
||||
dgv.AllowUserToDeleteRows = false;
|
||||
dgv.AllowUserToOrderColumns = true;
|
||||
dgv.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableWithoutHeaderText;
|
||||
dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dgv.Dock = DockStyle.Fill;
|
||||
dgv.Location = new Point(0, 0);
|
||||
dgv.MultiSelect = false;
|
||||
dgv.Name = "dgv";
|
||||
dgv.ReadOnly = true;
|
||||
dgv.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dgv.Size = new Size(800, 522);
|
||||
dgv.TabIndex = 8;
|
||||
dgv.SelectionChanged += dgv_SelectionChanged;
|
||||
//
|
||||
// cmsMedicineProductCost
|
||||
//
|
||||
cmsMedicineProductCost.Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
cmsMedicineProductCost.Name = "cmsMedicineProductCost";
|
||||
cmsMedicineProductCost.Size = new Size(61, 4);
|
||||
//
|
||||
// cmsMedicineProduct
|
||||
//
|
||||
cmsMedicineProduct.Name = "contextMenuStrip1";
|
||||
cmsMedicineProduct.Size = new Size(61, 4);
|
||||
//
|
||||
// ReferenceValueForm
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 17F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(800, 647);
|
||||
Controls.Add(splitContainer1);
|
||||
Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
FormBorderStyle = FormBorderStyle.FixedSingle;
|
||||
Name = "ReferenceValueForm";
|
||||
Text = "Лекарственные препараты";
|
||||
splitContainer1.Panel1.ResumeLayout(false);
|
||||
splitContainer1.Panel1.PerformLayout();
|
||||
splitContainer1.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)splitContainer1).EndInit();
|
||||
splitContainer1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)nudAgeMax).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)nudAgeMin).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)dgv).EndInit();
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private SplitContainer splitContainer1;
|
||||
private DataGridView dgv;
|
||||
private Button btnUpdate;
|
||||
private Button btnDelete;
|
||||
private Button btnAdd;
|
||||
private ContextMenuStrip cmsMedicineProduct;
|
||||
private ContextMenuStrip cmsMedicineProductCost;
|
||||
private Label label2;
|
||||
private ComboBox cbExamination;
|
||||
private Label label3;
|
||||
private ComboBox cbGender;
|
||||
private Label label5;
|
||||
private Label label4;
|
||||
private NumericUpDown nudAgeMax;
|
||||
private NumericUpDown nudAgeMin;
|
||||
private Button btnOpen;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
using Microsoft.EntityFrameworkCore.ChangeTracking.Internal;
|
||||
using Register_office.Model;
|
||||
using Register_office.ViewModel;
|
||||
using System.Data;
|
||||
|
||||
namespace Register_office.View.TypesV
|
||||
{
|
||||
public partial class ReferenceValueForm : Form
|
||||
{
|
||||
private TypeViewModel _viewModel;
|
||||
private ReferenceValue? _selectedType;
|
||||
private string _columnIdName = "ReferenceValueId";
|
||||
private ReferenceValue _temp;
|
||||
|
||||
public ReferenceValueForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
TopMost = true;
|
||||
Text = "Справочник нормалей обследований";
|
||||
_viewModel = new();
|
||||
_viewModel.ConfigureSettingsDGV<ReferenceValueWrapper>(dgv);
|
||||
UpdateDgv();
|
||||
UpdateElements();
|
||||
SetDataSourceToComboBoxes();
|
||||
}
|
||||
|
||||
private void SetDataSourceToComboBoxes()
|
||||
{
|
||||
cbExamination.DataSource = _viewModel.General.Context.ExaminationTypes
|
||||
.Select(x => new ComboBoxItem { Name = x.Name, Id = x.ExaminationTypeId })
|
||||
.OrderBy(cbi => cbi.Name).ToList();
|
||||
cbExamination.DisplayMember = "Name";
|
||||
cbExamination.ValueMember = "Id";
|
||||
|
||||
cbGender.DataSource = new string[] { "Мужчина", "Женщина" };
|
||||
}
|
||||
|
||||
private void UpdateElements(int examination = -1, string gender = "",
|
||||
int? ageMin = null, int? ageMax = null, bool enableButtons = false)
|
||||
{
|
||||
cbExamination.SelectedValue = examination;
|
||||
cbGender.Text = gender;
|
||||
nudAgeMin.Value = ageMin ?? -1;
|
||||
nudAgeMax.Value = ageMax ?? -1;
|
||||
btnDelete.Enabled = btnUpdate.Enabled = btnOpen.Enabled = enableButtons;
|
||||
}
|
||||
|
||||
private void UpdateDgv()
|
||||
{
|
||||
_viewModel.SetDefaultDataSource<ReferenceValue>(dgv);
|
||||
}
|
||||
|
||||
private void dgv_SelectionChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (dgv.SelectedRows.Count != 0 && !dgv.CurrentRow.IsNewRow)
|
||||
{
|
||||
DataGridViewRow selectedRow = dgv.SelectedRows[0];
|
||||
int id = int.Parse(selectedRow.Cells[_columnIdName].Value.ToString() ?? "");
|
||||
_selectedType = _viewModel.General.Context.ReferenceValues.Where(x => x.ReferenceValueId == id).FirstOrDefault();
|
||||
if (_selectedType != null)
|
||||
UpdateElements(_selectedType.ExaminationTypeId, _selectedType.Gender,
|
||||
_selectedType.AgeMin, _selectedType.AgeMax, true);
|
||||
}
|
||||
}
|
||||
|
||||
private void btnUpdate_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (_selectedType != null)
|
||||
{
|
||||
_selectedType.ExaminationTypeId = int.Parse(cbExamination.SelectedValue?.ToString() ?? "1");
|
||||
_selectedType.Gender = cbGender.Text;
|
||||
_selectedType.AgeMin = nudAgeMin.Value == -1 ? null : (int)nudAgeMin.Value;
|
||||
_selectedType.AgeMax = nudAgeMax.Value == -1 ? null : (int)nudAgeMax.Value;
|
||||
_viewModel.General.Context.SaveChanges();
|
||||
UpdateElements();
|
||||
UpdateDgv();
|
||||
}
|
||||
}
|
||||
|
||||
private void btnDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (_selectedType != null)
|
||||
{
|
||||
_viewModel.DeleteType(_selectedType);
|
||||
UpdateElements();
|
||||
UpdateDgv();
|
||||
}
|
||||
}
|
||||
|
||||
private void btnAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
_temp = new()
|
||||
{
|
||||
ExaminationTypeId = int.Parse(cbExamination.SelectedValue?.ToString() ?? "1"),
|
||||
Gender = cbGender.Text,
|
||||
AgeMin = nudAgeMin.Value == -1 ? null : (int)nudAgeMin.Value,
|
||||
AgeMax = nudAgeMax.Value == -1 ? null : (int)nudAgeMax.Value,
|
||||
};
|
||||
_viewModel.AddType(_temp);
|
||||
UpdateElements();
|
||||
UpdateDgv();
|
||||
}
|
||||
|
||||
private void btnOpen_Click(object sender, EventArgs e)
|
||||
{
|
||||
ReferenceValueQNForm f = new(_selectedType.ReferenceValueId);
|
||||
f.ShowDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="cmsMedicineProductCost.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>184, 17</value>
|
||||
</metadata>
|
||||
<metadata name="cmsMedicineProduct.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
+214
@@ -0,0 +1,214 @@
|
||||
namespace Register_office.View.TypesV
|
||||
{
|
||||
partial class ReferenceValueQNForm
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
nudMinValue = new NumericUpDown();
|
||||
label4 = new Label();
|
||||
label1 = new Label();
|
||||
nudMaxValue = new NumericUpDown();
|
||||
rtbDescriptionTrue = new RichTextBox();
|
||||
label2 = new Label();
|
||||
label3 = new Label();
|
||||
rtbDescriptionFalse = new RichTextBox();
|
||||
btnCancel = new Button();
|
||||
btnSave = new Button();
|
||||
label5 = new Label();
|
||||
cbUnit = new ComboBox();
|
||||
((System.ComponentModel.ISupportInitialize)nudMinValue).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)nudMaxValue).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// nudMinValue
|
||||
//
|
||||
nudMinValue.DecimalPlaces = 2;
|
||||
nudMinValue.Increment = new decimal(new int[] { 1, 0, 0, 65536 });
|
||||
nudMinValue.Location = new Point(12, 29);
|
||||
nudMinValue.Minimum = new decimal(new int[] { 1, 0, 0, int.MinValue });
|
||||
nudMinValue.Name = "nudMinValue";
|
||||
nudMinValue.Size = new Size(120, 25);
|
||||
nudMinValue.TabIndex = 0;
|
||||
nudMinValue.Value = new decimal(new int[] { 1, 0, 0, int.MinValue });
|
||||
//
|
||||
// label4
|
||||
//
|
||||
label4.AutoSize = true;
|
||||
label4.Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label4.Location = new Point(12, 9);
|
||||
label4.Name = "label4";
|
||||
label4.Size = new Size(96, 17);
|
||||
label4.TabIndex = 14;
|
||||
label4.Text = "Мин. значение";
|
||||
//
|
||||
// label1
|
||||
//
|
||||
label1.AutoSize = true;
|
||||
label1.Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label1.Location = new Point(153, 9);
|
||||
label1.Name = "label1";
|
||||
label1.Size = new Size(101, 17);
|
||||
label1.TabIndex = 16;
|
||||
label1.Text = "Макс. значение";
|
||||
//
|
||||
// nudMaxValue
|
||||
//
|
||||
nudMaxValue.DecimalPlaces = 2;
|
||||
nudMaxValue.Increment = new decimal(new int[] { 1, 0, 0, 65536 });
|
||||
nudMaxValue.Location = new Point(153, 29);
|
||||
nudMaxValue.Minimum = new decimal(new int[] { 1, 0, 0, int.MinValue });
|
||||
nudMaxValue.Name = "nudMaxValue";
|
||||
nudMaxValue.Size = new Size(120, 25);
|
||||
nudMaxValue.TabIndex = 15;
|
||||
nudMaxValue.Value = new decimal(new int[] { 1, 0, 0, int.MinValue });
|
||||
//
|
||||
// rtbDescriptionTrue
|
||||
//
|
||||
rtbDescriptionTrue.Location = new Point(12, 87);
|
||||
rtbDescriptionTrue.Name = "rtbDescriptionTrue";
|
||||
rtbDescriptionTrue.Size = new Size(436, 122);
|
||||
rtbDescriptionTrue.TabIndex = 17;
|
||||
rtbDescriptionTrue.Text = "";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
label2.AutoSize = true;
|
||||
label2.Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label2.Location = new Point(12, 67);
|
||||
label2.Name = "label2";
|
||||
label2.Size = new Size(119, 17);
|
||||
label2.TabIndex = 18;
|
||||
label2.Text = "Описание наличия";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
label3.AutoSize = true;
|
||||
label3.Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label3.Location = new Point(12, 222);
|
||||
label3.Name = "label3";
|
||||
label3.Size = new Size(132, 17);
|
||||
label3.TabIndex = 20;
|
||||
label3.Text = "Описание отсутствия";
|
||||
//
|
||||
// rtbDescriptionFalse
|
||||
//
|
||||
rtbDescriptionFalse.Location = new Point(12, 242);
|
||||
rtbDescriptionFalse.Name = "rtbDescriptionFalse";
|
||||
rtbDescriptionFalse.Size = new Size(436, 122);
|
||||
rtbDescriptionFalse.TabIndex = 19;
|
||||
rtbDescriptionFalse.Text = "";
|
||||
//
|
||||
// btnCancel
|
||||
//
|
||||
btnCancel.Anchor = AnchorStyles.Bottom;
|
||||
btnCancel.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnCancel.DialogResult = DialogResult.Cancel;
|
||||
btnCancel.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnCancel.Location = new Point(286, 373);
|
||||
btnCancel.Name = "btnCancel";
|
||||
btnCancel.Size = new Size(162, 33);
|
||||
btnCancel.TabIndex = 22;
|
||||
btnCancel.Text = "Отмена";
|
||||
btnCancel.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// btnSave
|
||||
//
|
||||
btnSave.Anchor = AnchorStyles.Bottom;
|
||||
btnSave.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnSave.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnSave.Location = new Point(12, 373);
|
||||
btnSave.Name = "btnSave";
|
||||
btnSave.Size = new Size(162, 33);
|
||||
btnSave.TabIndex = 21;
|
||||
btnSave.Text = "Сохранить";
|
||||
btnSave.UseVisualStyleBackColor = true;
|
||||
btnSave.Click += btnSave_Click;
|
||||
//
|
||||
// label5
|
||||
//
|
||||
label5.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
label5.AutoSize = true;
|
||||
label5.Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label5.Location = new Point(286, 8);
|
||||
label5.Name = "label5";
|
||||
label5.Size = new Size(126, 17);
|
||||
label5.TabIndex = 24;
|
||||
label5.Text = "Единица измерения";
|
||||
//
|
||||
// cbUnit
|
||||
//
|
||||
cbUnit.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
cbUnit.FormattingEnabled = true;
|
||||
cbUnit.Items.AddRange(new object[] { "Физикальное", "Лабораторное", "Инструментальное" });
|
||||
cbUnit.Location = new Point(286, 28);
|
||||
cbUnit.Name = "cbUnit";
|
||||
cbUnit.Size = new Size(162, 25);
|
||||
cbUnit.TabIndex = 23;
|
||||
//
|
||||
// ReferenceValueQNForm
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 17F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(460, 418);
|
||||
Controls.Add(label5);
|
||||
Controls.Add(cbUnit);
|
||||
Controls.Add(btnCancel);
|
||||
Controls.Add(btnSave);
|
||||
Controls.Add(label3);
|
||||
Controls.Add(rtbDescriptionFalse);
|
||||
Controls.Add(label2);
|
||||
Controls.Add(rtbDescriptionTrue);
|
||||
Controls.Add(label1);
|
||||
Controls.Add(nudMaxValue);
|
||||
Controls.Add(label4);
|
||||
Controls.Add(nudMinValue);
|
||||
Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
FormBorderStyle = FormBorderStyle.FixedToolWindow;
|
||||
Name = "ReferenceValueQNForm";
|
||||
Text = "Справочник нормалей для числовых и качественных обследований";
|
||||
((System.ComponentModel.ISupportInitialize)nudMinValue).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)nudMaxValue).EndInit();
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private NumericUpDown nudMinValue;
|
||||
private Label label4;
|
||||
private Label label1;
|
||||
private NumericUpDown nudMaxValue;
|
||||
private RichTextBox rtbDescriptionTrue;
|
||||
private Label label2;
|
||||
private Label label3;
|
||||
private RichTextBox rtbDescriptionFalse;
|
||||
private Button btnCancel;
|
||||
private Button btnSave;
|
||||
private Label label5;
|
||||
private ComboBox cbUnit;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
using Register_office.Model;
|
||||
using Register_office.ViewModel;
|
||||
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 Register_office.View.TypesV
|
||||
{
|
||||
public partial class ReferenceValueQNForm : Form
|
||||
{
|
||||
private TypeViewModel _viewModel;
|
||||
private int _referenceValueId;
|
||||
private ReferenceNumericValue? _referenceNumericValue;
|
||||
private ReferenceQualitativeValue? _referenceQualitativeValue;
|
||||
|
||||
public ReferenceValueQNForm(int referenceValueId)
|
||||
{
|
||||
InitializeComponent();
|
||||
TopMost = true;
|
||||
_viewModel = new();
|
||||
_referenceValueId = referenceValueId;
|
||||
_referenceNumericValue = _viewModel.General.Context.ReferenceNumericValues
|
||||
.Where(x => x.ReferenceValueId == _referenceValueId).FirstOrDefault();
|
||||
_referenceQualitativeValue = _viewModel.General.Context.ReferenceQualitativeValues
|
||||
.Where(x => x.ReferenceValueId == _referenceValueId).FirstOrDefault();
|
||||
SetDataSourceToComboBoxes();
|
||||
GetReferenceValues();
|
||||
}
|
||||
|
||||
private void SetDataSourceToComboBoxes()
|
||||
{
|
||||
cbUnit.DataSource = _viewModel.General.Context.Units
|
||||
.Select(x => new ComboBoxItem { Name = x.Name, Id = x.UnitId })
|
||||
.OrderBy(cbi => cbi.Name).ToList();
|
||||
cbUnit.DisplayMember = "Name";
|
||||
cbUnit.ValueMember = "Id";
|
||||
cbUnit.SelectedValue = -1;
|
||||
}
|
||||
|
||||
private void GetReferenceValues()
|
||||
{
|
||||
if (_referenceNumericValue != null)
|
||||
{
|
||||
nudMinValue.Value = _referenceNumericValue.MinValue ?? -1;
|
||||
nudMaxValue.Value = _referenceNumericValue.MaxValue ?? -1;
|
||||
cbUnit.SelectedValue = _referenceNumericValue.UnitId;
|
||||
}
|
||||
|
||||
if (_referenceQualitativeValue != null)
|
||||
{
|
||||
rtbDescriptionFalse.Text = _referenceQualitativeValue.DescriptionFalse;
|
||||
rtbDescriptionTrue.Text = _referenceQualitativeValue.DescriptionTrue;
|
||||
}
|
||||
}
|
||||
|
||||
private void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
if ((nudMinValue.Value >= 0 || nudMaxValue.Value >= 0) && cbUnit.Text != "")
|
||||
{
|
||||
if (_referenceNumericValue == null)
|
||||
{
|
||||
_referenceNumericValue = new()
|
||||
{
|
||||
ReferenceValueId = _referenceValueId,
|
||||
MinValue = nudMinValue.Value < 0 ? null : (int)nudMinValue.Value,
|
||||
MaxValue = nudMaxValue.Value < 0 ? null : (int)nudMaxValue.Value,
|
||||
UnitId = int.Parse(cbUnit.SelectedValue?.ToString() ?? "1")
|
||||
};
|
||||
_viewModel.AddType(_referenceNumericValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
_referenceNumericValue.ReferenceValueId = _referenceValueId;
|
||||
_referenceNumericValue.MinValue = nudMinValue.Value < 0 ? null : (int)nudMinValue.Value;
|
||||
_referenceNumericValue.MaxValue = nudMaxValue.Value < 0 ? null : (int)nudMaxValue.Value;
|
||||
_referenceNumericValue.UnitId = int.Parse(cbUnit.SelectedValue?.ToString() ?? "1");
|
||||
_viewModel.General.Context.SaveChanges();
|
||||
}
|
||||
}
|
||||
|
||||
if (rtbDescriptionFalse.Text.Trim() != "" && rtbDescriptionTrue.Text.Trim() != "")
|
||||
{
|
||||
if (_referenceQualitativeValue == null)
|
||||
{
|
||||
_referenceQualitativeValue = new()
|
||||
{
|
||||
ReferenceValueId = _referenceValueId,
|
||||
DescriptionFalse = rtbDescriptionFalse.Text,
|
||||
DescriptionTrue = rtbDescriptionTrue.Text
|
||||
};
|
||||
_viewModel.AddType(_referenceQualitativeValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
_referenceQualitativeValue.ReferenceValueId = _referenceValueId;
|
||||
_referenceQualitativeValue.DescriptionFalse = rtbDescriptionFalse.Text;
|
||||
_referenceQualitativeValue.DescriptionTrue = rtbDescriptionTrue.Text;
|
||||
_viewModel.General.Context.SaveChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
+221
@@ -0,0 +1,221 @@
|
||||
using Register_office.View;
|
||||
|
||||
namespace Register_office.View.TypesV
|
||||
{
|
||||
partial class SyndromeExaminationTypeForm
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
components = new System.ComponentModel.Container();
|
||||
splitContainer1 = new SplitContainer();
|
||||
btnAdd = new Button();
|
||||
btnDelete = new Button();
|
||||
btnUpdate = new Button();
|
||||
dgv = new DataGridView();
|
||||
cmsMedicineProductCost = new ContextMenuStrip(components);
|
||||
cmsMedicineProduct = new ContextMenuStrip(components);
|
||||
label3 = new Label();
|
||||
cbExamination = new ComboBox();
|
||||
label2 = new Label();
|
||||
cbSyndrome = new ComboBox();
|
||||
((System.ComponentModel.ISupportInitialize)splitContainer1).BeginInit();
|
||||
splitContainer1.Panel1.SuspendLayout();
|
||||
splitContainer1.Panel2.SuspendLayout();
|
||||
splitContainer1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)dgv).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// splitContainer1
|
||||
//
|
||||
splitContainer1.Dock = DockStyle.Fill;
|
||||
splitContainer1.FixedPanel = FixedPanel.Panel1;
|
||||
splitContainer1.Location = new Point(0, 0);
|
||||
splitContainer1.Name = "splitContainer1";
|
||||
splitContainer1.Orientation = Orientation.Horizontal;
|
||||
//
|
||||
// splitContainer1.Panel1
|
||||
//
|
||||
splitContainer1.Panel1.Controls.Add(label3);
|
||||
splitContainer1.Panel1.Controls.Add(btnAdd);
|
||||
splitContainer1.Panel1.Controls.Add(cbExamination);
|
||||
splitContainer1.Panel1.Controls.Add(btnDelete);
|
||||
splitContainer1.Panel1.Controls.Add(label2);
|
||||
splitContainer1.Panel1.Controls.Add(cbSyndrome);
|
||||
splitContainer1.Panel1.Controls.Add(btnUpdate);
|
||||
//
|
||||
// splitContainer1.Panel2
|
||||
//
|
||||
splitContainer1.Panel2.Controls.Add(dgv);
|
||||
splitContainer1.Size = new Size(800, 647);
|
||||
splitContainer1.SplitterDistance = 120;
|
||||
splitContainer1.SplitterWidth = 5;
|
||||
splitContainer1.TabIndex = 0;
|
||||
//
|
||||
// btnAdd
|
||||
//
|
||||
btnAdd.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
btnAdd.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnAdd.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnAdd.Location = new Point(458, 72);
|
||||
btnAdd.Name = "btnAdd";
|
||||
btnAdd.Size = new Size(330, 33);
|
||||
btnAdd.TabIndex = 3;
|
||||
btnAdd.Text = "Добавить";
|
||||
btnAdd.UseVisualStyleBackColor = true;
|
||||
btnAdd.Click += btnAdd_Click;
|
||||
//
|
||||
// btnDelete
|
||||
//
|
||||
btnDelete.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
btnDelete.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnDelete.Enabled = false;
|
||||
btnDelete.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnDelete.Location = new Point(626, 33);
|
||||
btnDelete.Name = "btnDelete";
|
||||
btnDelete.Size = new Size(162, 33);
|
||||
btnDelete.TabIndex = 4;
|
||||
btnDelete.Text = "Удалить";
|
||||
btnDelete.UseVisualStyleBackColor = true;
|
||||
btnDelete.Click += btnDelete_Click;
|
||||
//
|
||||
// btnUpdate
|
||||
//
|
||||
btnUpdate.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
btnUpdate.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnUpdate.Font = new Font("Segoe UI", 11.25F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
btnUpdate.Location = new Point(458, 32);
|
||||
btnUpdate.Name = "btnUpdate";
|
||||
btnUpdate.Size = new Size(162, 33);
|
||||
btnUpdate.TabIndex = 1;
|
||||
btnUpdate.Text = "Изменить";
|
||||
btnUpdate.UseVisualStyleBackColor = true;
|
||||
btnUpdate.Click += btnUpdate_Click;
|
||||
//
|
||||
// dgv
|
||||
//
|
||||
dgv.AllowUserToAddRows = false;
|
||||
dgv.AllowUserToDeleteRows = false;
|
||||
dgv.AllowUserToOrderColumns = true;
|
||||
dgv.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableWithoutHeaderText;
|
||||
dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dgv.Dock = DockStyle.Fill;
|
||||
dgv.Location = new Point(0, 0);
|
||||
dgv.MultiSelect = false;
|
||||
dgv.Name = "dgv";
|
||||
dgv.ReadOnly = true;
|
||||
dgv.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dgv.Size = new Size(800, 522);
|
||||
dgv.TabIndex = 8;
|
||||
dgv.SelectionChanged += dgv_SelectionChanged;
|
||||
//
|
||||
// cmsMedicineProductCost
|
||||
//
|
||||
cmsMedicineProductCost.Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
cmsMedicineProductCost.Name = "cmsMedicineProductCost";
|
||||
cmsMedicineProductCost.Size = new Size(61, 4);
|
||||
//
|
||||
// cmsMedicineProduct
|
||||
//
|
||||
cmsMedicineProduct.Name = "contextMenuStrip1";
|
||||
cmsMedicineProduct.Size = new Size(61, 4);
|
||||
//
|
||||
// label3
|
||||
//
|
||||
label3.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
label3.AutoSize = true;
|
||||
label3.Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label3.Location = new Point(232, 17);
|
||||
label3.Name = "label3";
|
||||
label3.Size = new Size(96, 17);
|
||||
label3.TabIndex = 14;
|
||||
label3.Text = "Обследование";
|
||||
//
|
||||
// cbExamination
|
||||
//
|
||||
cbExamination.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
cbExamination.FormattingEnabled = true;
|
||||
cbExamination.Items.AddRange(new object[] { "Физикальное", "Лабораторное", "Инструментальное" });
|
||||
cbExamination.Location = new Point(232, 37);
|
||||
cbExamination.Name = "cbExamination";
|
||||
cbExamination.Size = new Size(211, 25);
|
||||
cbExamination.TabIndex = 13;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
label2.Anchor = AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
label2.AutoSize = true;
|
||||
label2.Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
label2.Location = new Point(12, 16);
|
||||
label2.Name = "label2";
|
||||
label2.Size = new Size(62, 17);
|
||||
label2.TabIndex = 12;
|
||||
label2.Text = "Синдром";
|
||||
//
|
||||
// cbSyndrome
|
||||
//
|
||||
cbSyndrome.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
cbSyndrome.FormattingEnabled = true;
|
||||
cbSyndrome.Items.AddRange(new object[] { "Физикальное", "Лабораторное", "Инструментальное" });
|
||||
cbSyndrome.Location = new Point(12, 37);
|
||||
cbSyndrome.Name = "cbSyndrome";
|
||||
cbSyndrome.Size = new Size(214, 25);
|
||||
cbSyndrome.TabIndex = 11;
|
||||
//
|
||||
// SyndromeExaminationTypeForm
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 17F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(800, 647);
|
||||
Controls.Add(splitContainer1);
|
||||
Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 204);
|
||||
FormBorderStyle = FormBorderStyle.FixedSingle;
|
||||
Name = "SyndromeExaminationTypeForm";
|
||||
Text = "Лекарственные препараты";
|
||||
splitContainer1.Panel1.ResumeLayout(false);
|
||||
splitContainer1.Panel1.PerformLayout();
|
||||
splitContainer1.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)splitContainer1).EndInit();
|
||||
splitContainer1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)dgv).EndInit();
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private SplitContainer splitContainer1;
|
||||
private DataGridView dgv;
|
||||
private Button btnUpdate;
|
||||
private Button btnDelete;
|
||||
private Button btnAdd;
|
||||
private ContextMenuStrip cmsMedicineProduct;
|
||||
private ContextMenuStrip cmsMedicineProductCost;
|
||||
private Label label3;
|
||||
private ComboBox cbExamination;
|
||||
private Label label2;
|
||||
private ComboBox cbSyndrome;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
using Microsoft.EntityFrameworkCore.ChangeTracking.Internal;
|
||||
using Register_office.Model;
|
||||
using Register_office.ViewModel;
|
||||
using System.Data;
|
||||
|
||||
namespace Register_office.View.TypesV
|
||||
{
|
||||
public partial class SyndromeExaminationTypeForm : Form
|
||||
{
|
||||
private TypeViewModel _viewModel;
|
||||
private SyndromeExaminationType? _selectedType;
|
||||
private SyndromeExaminationType _temp;
|
||||
|
||||
public SyndromeExaminationTypeForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
TopMost = true;
|
||||
Text = "Справочник соответствий синдромов и обследований";
|
||||
_viewModel = new();
|
||||
_viewModel.ConfigureSettingsDGV<SyndromeExaminationTypeWrapper>(dgv);
|
||||
UpdateDgv();
|
||||
SetDataSourceToComboBoxes();
|
||||
UpdateElements();
|
||||
}
|
||||
|
||||
private void SetDataSourceToComboBoxes()
|
||||
{
|
||||
cbExamination.DataSource = _viewModel.General.Context.ExaminationTypes
|
||||
.Select(x => new ComboBoxItem { Name = x.Name, Id = x.ExaminationTypeId })
|
||||
.OrderBy(cbi => cbi.Name).ToList();
|
||||
cbExamination.DisplayMember = "Name";
|
||||
cbExamination.ValueMember = "Id";
|
||||
|
||||
cbSyndrome.DataSource = _viewModel.General.Context.SyndromeTypes
|
||||
.Select(x => new ComboBoxItem { Name = x.Name, Id = x.SyndromeTypeId })
|
||||
.OrderBy(cbi => cbi.Name).ToList();
|
||||
cbSyndrome.DisplayMember = "Name";
|
||||
cbSyndrome.ValueMember = "Id";
|
||||
}
|
||||
|
||||
private void UpdateElements(int idExam = -1, int idSynd = -1, bool enableButtons = false)
|
||||
{
|
||||
cbExamination.SelectedValue = idExam;
|
||||
cbSyndrome.SelectedValue = idSynd;
|
||||
btnDelete.Enabled = btnUpdate.Enabled = enableButtons;
|
||||
}
|
||||
|
||||
private void UpdateDgv()
|
||||
{
|
||||
_viewModel.SetDefaultDataSource<SyndromeExaminationType>(dgv);
|
||||
}
|
||||
|
||||
private void dgv_SelectionChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (dgv.SelectedRows.Count != 0 && !dgv.CurrentRow.IsNewRow)
|
||||
{
|
||||
DataGridViewRow selectedRow = dgv.SelectedRows[0];
|
||||
int idExam = int.Parse(selectedRow.Cells["ExaminationTypeId"].Value.ToString() ?? "");
|
||||
int idSynd = int.Parse(selectedRow.Cells["SyndromeId"].Value.ToString() ?? "");
|
||||
_selectedType = _viewModel.General.Context.SyndromeExaminationTypes
|
||||
.Where(x => x.ExaminationTypeId == idExam && x.SyndromeId == idSynd).FirstOrDefault();
|
||||
if (_selectedType != null)
|
||||
UpdateElements(_selectedType.ExaminationTypeId, _selectedType.SyndromeId, true);
|
||||
}
|
||||
}
|
||||
|
||||
private void btnUpdate_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (_selectedType != null)
|
||||
{
|
||||
_selectedType.ExaminationTypeId = int.Parse(cbExamination.SelectedValue?.ToString() ?? "-1");
|
||||
_selectedType.SyndromeId = int.Parse(cbSyndrome.SelectedValue?.ToString() ?? "-1");
|
||||
_viewModel.General.Context.SaveChanges();
|
||||
UpdateElements();
|
||||
UpdateDgv();
|
||||
}
|
||||
}
|
||||
|
||||
private void btnDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (_selectedType != null)
|
||||
{
|
||||
_viewModel.DeleteType(_selectedType);
|
||||
UpdateElements();
|
||||
UpdateDgv();
|
||||
}
|
||||
}
|
||||
|
||||
private void btnAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
_temp = new()
|
||||
{
|
||||
ExaminationTypeId = int.Parse(cbExamination.SelectedValue?.ToString() ?? "-1"),
|
||||
SyndromeId = int.Parse(cbSyndrome.SelectedValue?.ToString() ?? "-1")
|
||||
};
|
||||
_viewModel.AddType(_temp);
|
||||
UpdateElements();
|
||||
UpdateDgv();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="cmsMedicineProductCost.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>184, 17</value>
|
||||
</metadata>
|
||||
<metadata name="cmsMedicineProduct.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user