Добавление DataModels и начало заполнения контрактов

This commit is contained in:
Екатерина Рогашова 2023-04-04 09:51:08 +04:00
parent 7331ca11ed
commit 1cfa8dc507
37 changed files with 673 additions and 0 deletions

7
Hospital/Class1.cs Normal file
View File

@ -0,0 +1,7 @@
namespace Hospital
{
public class Class1
{
}
}

9
Hospital/Hospital.csproj Normal file
View File

@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

43
Hospital/Hospital.sln Normal file
View File

@ -0,0 +1,43 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.3.32825.248
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HospitalContracts", "..\HospitalContracts\HospitalContracts.csproj", "{852D330A-F5B2-4ADE-A27B-A58F9CAAE379}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HospitalDataModels", "..\HospitalDataModels\HospitalDataModels.csproj", "{D5C93D6A-22C6-4B67-B76C-6FC183D46513}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HospitalDataBaseImplements", "..\HospitalDataBaseImplements\HospitalDataBaseImplements.csproj", "{2B6A087F-E3CA-439E-9FC8-954575466B8B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HospitalView", "..\HospitalView\HospitalView.csproj", "{7CBB7FFE-03C3-4F80-9A30-C1825E2C7340}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{852D330A-F5B2-4ADE-A27B-A58F9CAAE379}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{852D330A-F5B2-4ADE-A27B-A58F9CAAE379}.Debug|Any CPU.Build.0 = Debug|Any CPU
{852D330A-F5B2-4ADE-A27B-A58F9CAAE379}.Release|Any CPU.ActiveCfg = Release|Any CPU
{852D330A-F5B2-4ADE-A27B-A58F9CAAE379}.Release|Any CPU.Build.0 = Release|Any CPU
{D5C93D6A-22C6-4B67-B76C-6FC183D46513}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D5C93D6A-22C6-4B67-B76C-6FC183D46513}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D5C93D6A-22C6-4B67-B76C-6FC183D46513}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D5C93D6A-22C6-4B67-B76C-6FC183D46513}.Release|Any CPU.Build.0 = Release|Any CPU
{2B6A087F-E3CA-439E-9FC8-954575466B8B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2B6A087F-E3CA-439E-9FC8-954575466B8B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2B6A087F-E3CA-439E-9FC8-954575466B8B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2B6A087F-E3CA-439E-9FC8-954575466B8B}.Release|Any CPU.Build.0 = Release|Any CPU
{7CBB7FFE-03C3-4F80-9A30-C1825E2C7340}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7CBB7FFE-03C3-4F80-9A30-C1825E2C7340}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7CBB7FFE-03C3-4F80-9A30-C1825E2C7340}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7CBB7FFE-03C3-4F80-9A30-C1825E2C7340}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9B904E8C-42AE-49A1-8B82-064C15007A35}
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,22 @@
using HospitalDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.BindingModels
{
public class IllnessBindingModel
{
public int Id { get; set; }
public string IllnessName { get; set; } = string.Empty;
public string Form { get; set; } = string.Empty;
public Dictionary<int, (ISymptomsModel, int)> IllnessSymptoms
{
get;
set;
} = new();
}
}

View File

@ -0,0 +1,17 @@
using HospitalDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.BindingModels
{
public class KurseBindingModel
{
public int Id { get; set; }
public string Duration { get; set; } = string.Empty;
public int CountInDay { get; set; }
public int MedicinesId { get; set; }
}
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.BindingModels
{
public class MedicinesBindingModel
{
public int Id { get; set; }
public string MedicineName { get; set; } = string.Empty;
public string Group { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.BindingModels
{
public class ProceduresBindingModel
{
public int Id { get; set; }
public string ProcedureName { get; set; } = string.Empty;
public string Type { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,29 @@
using HospitalDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.BindingModels
{
public class RecipesBindingModel
{
public int Id { get; set; }
public string Dose { get; set; } = string.Empty;
public DateTime Date { get; set; } = DateTime.Now;
public string ModeOfApplication { get; set; } = string.Empty;
public Dictionary<int, (IMedicinesModel, int)> MedicinesRecipe
{
get;
set;
} = new();
public Dictionary<int, (IProceduresModel, int)> ProceduresRecipe
{
get;
set;
} = new();
}
}

View File

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.BindingModels
{
public class SymptomsBindingModel
{
public int Id { get; set; }
public string SymptomName { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Folder Include="BusinessLogicsContracts\" />
<Folder Include="StoragesContracts\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\HospitalDataModels\HospitalDataModels.csproj" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.SearchModels
{
public class IllnessSearchModel
{
public int? Id { get; set; }
public string? IllnessName { get; set; }
}
}

View File

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.SearchModels
{
public class KurseSearchModel
{
public int? Id { get; set; }
public int? MedicinesId { get; set; }
}
}

View File

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.SearchModels
{
public class MedicinesSearchModel
{
public int? Id { get; set; }
public string? MedicinesName { get; set; }
}
}

View File

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.SearchModels
{
public class ProceduresSearchModel
{
public int? Id { get; set; }
public string? ProceduresName { get; set; }
}
}

View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.SearchModels
{
public class RecipesSearchModel
{
public int? Id { get; set; }
}
}

View File

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.SearchModels
{
public class SymptomsSearchModel
{
public int Id { get; set; }
public string? SymptomsName { get; set; }
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.ViewModels
{
internal class IllnessViewModel
{
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.ViewModels
{
internal class KurseViewModel
{
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.ViewModels
{
internal class MedicinesViewModel
{
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.ViewModels
{
internal class ProceduresViewModel
{
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.ViewModels
{
internal class RecipesViewModel
{
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalContracts.ViewModels
{
internal class SymptomsViewModel
{
}
}

View File

@ -0,0 +1,7 @@
namespace HospitalDataBaseImplements
{
public class Class1
{
}
}

View File

@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

13
HospitalDataModels/IId.cs Normal file
View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalDataModels
{
public interface IId
{
int Id { get; }
}
}

View File

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalDataModels.Models
{
public interface IIllnessModel : IId
{
string IllnessName { get; }
string Form { get; }
Dictionary<int, (ISymptomsModel, int)> IllnessSymptoms { get; }
Dictionary<int, (IKurseModel, int)> IllnessKurse { get; }
}
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalDataModels.Models
{
public interface IKurseModel: IId
{
string Duration { get; }
int CountInDay { get; }
int MedicinesId { get; }
}
}

View File

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalDataModels.Models
{
public interface IMedicinesModel: IId
{
string MedicineName { get; }
string Group { get; }
}
}

View File

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalDataModels.Models
{
public interface IProceduresModel: IId
{
string ProcedureName { get; }
string Type { get; }
}
}

View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalDataModels.Models
{
public interface IRecipesModel: IId
{
string Dose { get; }
DateTime Date { get; }
string ModeOfApplication { get; }
Dictionary<int, (IMedicinesModel, int)> MedicinesRecipe { get; }
Dictionary<int, (IProceduresModel, int)> ProceduresRecipe { get; }
}
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HospitalDataModels.Models
{
public interface ISymptomsModel: IId
{
string SymptomName { get; }
string Description { get; }
//Dictionary<int, IIllnessModel> IllnessSymptoms { get; }
}
}

39
HospitalView/Form1.Designer.cs generated Normal file
View File

@ -0,0 +1,39 @@
namespace HospitalView
{
partial class Form1
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Text = "Form1";
}
#endregion
}
}

10
HospitalView/Form1.cs Normal file
View File

@ -0,0 +1,10 @@
namespace HospitalView
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
}
}

120
HospitalView/Form1.resx Normal file
View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
</Project>

17
HospitalView/Program.cs Normal file
View File

@ -0,0 +1,17 @@
namespace HospitalView
{
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();
Application.Run(new Form1());
}
}
}