diff --git a/.vs/HospitalServerManager/v15/.suo b/.vs/HospitalServerManager/v15/.suo new file mode 100644 index 0000000..64b0009 Binary files /dev/null and b/.vs/HospitalServerManager/v15/.suo differ diff --git a/.vs/HospitalServerManager/v15/Server/sqlite3/db.lock b/.vs/HospitalServerManager/v15/Server/sqlite3/db.lock new file mode 100644 index 0000000..e69de29 diff --git a/.vs/HospitalServerManager/v15/Server/sqlite3/storage.ide b/.vs/HospitalServerManager/v15/Server/sqlite3/storage.ide new file mode 100644 index 0000000..fa929e3 Binary files /dev/null and b/.vs/HospitalServerManager/v15/Server/sqlite3/storage.ide differ diff --git a/.vs/HospitalServerManager/v15/Server/sqlite3/storage.ide-shm b/.vs/HospitalServerManager/v15/Server/sqlite3/storage.ide-shm new file mode 100644 index 0000000..a21d0eb Binary files /dev/null and b/.vs/HospitalServerManager/v15/Server/sqlite3/storage.ide-shm differ diff --git a/.vs/HospitalServerManager/v15/Server/sqlite3/storage.ide-wal b/.vs/HospitalServerManager/v15/Server/sqlite3/storage.ide-wal new file mode 100644 index 0000000..68065ae Binary files /dev/null and b/.vs/HospitalServerManager/v15/Server/sqlite3/storage.ide-wal differ diff --git a/HospitalServerManager.csproj b/HospitalServerManager.csproj index 9a95f5f..79d3bfd 100644 --- a/HospitalServerManager.csproj +++ b/HospitalServerManager.csproj @@ -100,6 +100,7 @@ + @@ -109,14 +110,24 @@ + + + + + + DoctorsPage.xaml + MainFrameView.xaml PatientsPage.xaml + + RoomsPage.xaml + ColumnListView.xaml @@ -142,6 +153,10 @@ MSBuild:Compile Designer + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -150,6 +165,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -157,10 +176,9 @@ - 6.1.7 + 6.1.9 - 14.0 diff --git a/HospitalServerManager.csproj.user b/HospitalServerManager.csproj.user new file mode 100644 index 0000000..16f5013 --- /dev/null +++ b/HospitalServerManager.csproj.user @@ -0,0 +1,7 @@ + + + + 30F105C9-681E-420b-A277-7C086EAD8A4E + true + + \ No newline at end of file diff --git a/HospitalServerManager.sln b/HospitalServerManager.sln new file mode 100644 index 0000000..227fb08 --- /dev/null +++ b/HospitalServerManager.sln @@ -0,0 +1,43 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.168 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HospitalServerManager", "HospitalServerManager.csproj", "{26C1F966-632C-4EFE-B214-70E9F0917D10}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|ARM = Debug|ARM + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|ARM = Release|ARM + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {26C1F966-632C-4EFE-B214-70E9F0917D10}.Debug|ARM.ActiveCfg = Debug|ARM + {26C1F966-632C-4EFE-B214-70E9F0917D10}.Debug|ARM.Build.0 = Debug|ARM + {26C1F966-632C-4EFE-B214-70E9F0917D10}.Debug|ARM.Deploy.0 = Debug|ARM + {26C1F966-632C-4EFE-B214-70E9F0917D10}.Debug|x64.ActiveCfg = Debug|x64 + {26C1F966-632C-4EFE-B214-70E9F0917D10}.Debug|x64.Build.0 = Debug|x64 + {26C1F966-632C-4EFE-B214-70E9F0917D10}.Debug|x64.Deploy.0 = Debug|x64 + {26C1F966-632C-4EFE-B214-70E9F0917D10}.Debug|x86.ActiveCfg = Debug|x86 + {26C1F966-632C-4EFE-B214-70E9F0917D10}.Debug|x86.Build.0 = Debug|x86 + {26C1F966-632C-4EFE-B214-70E9F0917D10}.Debug|x86.Deploy.0 = Debug|x86 + {26C1F966-632C-4EFE-B214-70E9F0917D10}.Release|ARM.ActiveCfg = Release|ARM + {26C1F966-632C-4EFE-B214-70E9F0917D10}.Release|ARM.Build.0 = Release|ARM + {26C1F966-632C-4EFE-B214-70E9F0917D10}.Release|ARM.Deploy.0 = Release|ARM + {26C1F966-632C-4EFE-B214-70E9F0917D10}.Release|x64.ActiveCfg = Release|x64 + {26C1F966-632C-4EFE-B214-70E9F0917D10}.Release|x64.Build.0 = Release|x64 + {26C1F966-632C-4EFE-B214-70E9F0917D10}.Release|x64.Deploy.0 = Release|x64 + {26C1F966-632C-4EFE-B214-70E9F0917D10}.Release|x86.ActiveCfg = Release|x86 + {26C1F966-632C-4EFE-B214-70E9F0917D10}.Release|x86.Build.0 = Release|x86 + {26C1F966-632C-4EFE-B214-70E9F0917D10}.Release|x86.Deploy.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {0633FECF-757D-423E-973E-178F39545ED1} + EndGlobalSection +EndGlobal diff --git a/InterfacesAndEnums/Enums.cs b/InterfacesAndEnums/Enums.cs index 3ee2162..e3b2a28 100644 --- a/InterfacesAndEnums/Enums.cs +++ b/InterfacesAndEnums/Enums.cs @@ -73,4 +73,46 @@ namespace HospitalServerManager.InterfacesAndEnums [Description("M")] M, } + public enum SurgeryField + { + [Description("Ogólna")] + General, + [Description("Klatki piersiowej")] + Throatic, + [Description("Sercowo - naczyniowa")] + Cardioviscular, + [Description("Układu nerwowego")] + NervousSystem, + [Description("Urologia")] + Urology, + [Description("Szczękowo - twarzowa")] + Maxillofacial, + [Description("Urazowa")] + Accidential, + [Description("Inne")] + Other, + } + public enum SurgeryKind + { + [Description("Szycie")] + Stitching, + [Description("Resekcja")] + Resection, + [Description("Amputacja")] + Amputation, + [Description("Drenaż")] + Drainge, + [Description("Nastawianie złamań")] + Bonesetting, + [Description("Ingerencja wewnątrz klatki piersiowej")] + Throastic, + [Description("Operacja serca")] + Heart, + [Description("Operacja układu nerwowego")] + Nervous, + [Description("Przeszczep")] + Graft, + [Description("Inne")] + Other, + } } diff --git a/Model/Basic/Admission.cs b/Model/Basic/Admission.cs index 164e7f3..a48d5d9 100644 --- a/Model/Basic/Admission.cs +++ b/Model/Basic/Admission.cs @@ -6,7 +6,29 @@ using System.Threading.Tasks; namespace HospitalServerManager.Model.Basic { - class Admission + class Admission : SqlTable { + public DateTime AdmissionDate { get; protected set; } + public DateTime LeavingDate { get; protected set; } + public string PatientPESEL { get; protected set; } + public string DiagnosisSymbol { get; protected set; } + public int MainDoctor { get; protected set; } + public int? OperationID { get; protected set; } + public int RoomNumber { get; protected set; } + public bool IsPlanned { get; protected set; } + + protected Admission() : base() { } + public Admission(List listOfValues) + : base(listOfValues[0], "Id_przyjecia", new List()) + { + AdmissionDate = DateTime.Parse(listOfValues[1]); + LeavingDate = DateTime.Parse(listOfValues[2]); + PatientPESEL = listOfValues[3]; + DiagnosisSymbol = listOfValues[4]; + MainDoctor = int.Parse(listOfValues[5]); + OperationID = int.Parse(listOfValues[6]); + RoomNumber = int.Parse(listOfValues[7]); + IsPlanned = bool.Parse(listOfValues[8]); + } } } diff --git a/Model/Basic/Diagnosis.cs b/Model/Basic/Diagnosis.cs index 3dc9ac2..57b25b2 100644 --- a/Model/Basic/Diagnosis.cs +++ b/Model/Basic/Diagnosis.cs @@ -1,4 +1,5 @@ -using System; +using HospitalServerManager.InterfacesAndEnums; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -6,7 +7,19 @@ using System.Threading.Tasks; namespace HospitalServerManager.Model.Basic { - class Diagnosis + class Diagnosis : SqlTable { + public string Name { get; protected set; } + public SurgeryField FieldOfSurgery { get; protected set; } + public string Description { get; protected set; } + + protected Diagnosis() : base() {} + public Diagnosis(List listOfValues) + : base(listOfValues[0], "Symbol_ICD", new List()) + { + Name = listOfValues[1]; + FieldOfSurgery = listOfValues[2].GetEnumFromDescription(); + Description = listOfValues[3]; + } } } diff --git a/Model/Basic/Doctor.cs b/Model/Basic/Doctor.cs index 714fbeb..b9f1672 100644 --- a/Model/Basic/Doctor.cs +++ b/Model/Basic/Doctor.cs @@ -9,18 +9,12 @@ namespace HospitalServerManager.Model.Basic { class Doctor : SqlTable { - //public int DoctorId { get; protected set; } public string Name { get; protected set; } + public AcademicDegrees _AcademicDegree { get; set; } + public MedicalSpecializations _MedicalSpecialization { get; set; } public string Surname { get; protected set; } - private AcademicDegrees _AcademicDegree { get; set; } - public string AcademicDegree { get => _AcademicDegree.GetEnumDescription(); } - private MedicalSpecializations _MedicalSpecialization { get; set; } - public string MedicalSpecialization { get => _MedicalSpecialization.GetEnumDescription(); } public DateTime DateOfEmployment { get; protected set; } - private JobPositions _JobPosition { get; set; } - public string JobPosition { get => _JobPosition.GetEnumDescription(); } - - + public JobPositions _JobPosition { get; set; } protected Doctor() : base() { diff --git a/Model/Basic/Patient.cs b/Model/Basic/Patient.cs index d84bbaa..a0cad4a 100644 --- a/Model/Basic/Patient.cs +++ b/Model/Basic/Patient.cs @@ -9,26 +9,11 @@ namespace HospitalServerManager.Model.Basic { internal class Patient : SqlTable { - /*public override string PrimaryKeyNameToSql { get; protected set; } - public override string GetPrimaryKey => PeselNumber;*/ public string Surname { get; protected set; } public string Name { get; protected set; } public DateTime BirthDate { get; protected set; } - public PatientState _PatientState { get; protected set; } - /*public string PatientState - { - get - { - if (_PatientState.GetEnumDescription() == "NULL") - return string.Empty; - else - return _PatientState.GetEnumDescription(); - } - }*/ - public Sex _PatientSex { get; protected set; } - // public string PatientSex { get => _PatientSex.GetEnumDescription(); } - - + public PatientState PatientState { get; protected set; } + public Sex PatientSex { get; protected set; } protected Patient() : base() { @@ -42,8 +27,8 @@ namespace HospitalServerManager.Model.Basic Surname = surname; Name = name; BirthDate = birthDate; - _PatientState = patientState; - _PatientSex = patientSex; + PatientState = patientState; + PatientSex = patientSex; } /// /// List have to be in right order (pesel, surname, name, birth date, patient state, patient sex). @@ -59,8 +44,8 @@ namespace HospitalServerManager.Model.Basic Surname = listOfValues[1]; Name = listOfValues[2]; BirthDate = DateTime.Parse(listOfValues[3]); - _PatientState = listOfValues[4].GetEnumFromDescription(); - _PatientSex = (Sex)Enum.Parse(typeof(Sex), listOfValues[5]); + PatientState = listOfValues[4].GetEnumFromDescription(); + PatientSex = (Sex)Enum.Parse(typeof(Sex), listOfValues[5]); } } } diff --git a/Model/Basic/Room.cs b/Model/Basic/Room.cs index fa1cd5b..45a18f5 100644 --- a/Model/Basic/Room.cs +++ b/Model/Basic/Room.cs @@ -6,7 +6,18 @@ using System.Threading.Tasks; namespace HospitalServerManager.Model.Basic { - class Room + class Room : SqlTable { + public int PlacesNumber { get; protected set; } + public bool IsSpecialCare { get; protected set; } + + protected Room() : base() { } + public Room(List listOfValues) + : base(listOfValues[0], "Nr_sali", new List()) + { + if (int.TryParse(listOfValues[1], out int placesNumber)) + PlacesNumber = placesNumber; + IsSpecialCare = bool.Parse(listOfValues[2]); + } } } diff --git a/Model/Basic/Surgery.cs b/Model/Basic/Surgery.cs index 7d3435a..77e68db 100644 --- a/Model/Basic/Surgery.cs +++ b/Model/Basic/Surgery.cs @@ -1,4 +1,5 @@ -using System; +using HospitalServerManager.InterfacesAndEnums; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -6,7 +7,23 @@ using System.Threading.Tasks; namespace HospitalServerManager.Model.Basic { - class Surgery - { - } + class Surgery : SqlTable + { + public string SurgeryName { get; protected set; } + public TimeSpan AverageTime { get; protected set; } + public SurgeryKind KindOfSurgery { get; protected set; } + public decimal Cost { get; protected set; } + public int Refoundation { get; protected set; } + + protected Surgery() : base() { } + public Surgery(List listOfValues) + : base(listOfValues[0], "Id_operacji", new List()) + { + SurgeryName = listOfValues[1]; + AverageTime = TimeSpan.Parse(listOfValues[2]); + KindOfSurgery = listOfValues[3].GetEnumFromDescription(); + Cost = decimal.Parse(listOfValues[4]); + Refoundation = int.Parse(listOfValues[5]) > 100 ? 100 : int.Parse(listOfValues[5]); + } + } } diff --git a/Model/ModelRoster.cs b/Model/ModelRoster.cs index 1d1704a..050c787 100644 --- a/Model/ModelRoster.cs +++ b/Model/ModelRoster.cs @@ -15,17 +15,9 @@ namespace HospitalServerManager.Model //private Controllers.DatabaseReader DatabaseReader = new Controllers.DatabaseReader(); public ModelRoster() { - /* Read(); - _modelsList.Clear(); - _modelsList.AddRange(DatabaseReader.LastReadedModels);*/ + } - public async void Read() - { - /* await DatabaseReader.ReadDataFromDatabase(@"Data Source=MARCEL\SQLEXPRESS;Initial Catalog = DB_s439397; Integrated Security = true;", - "SELECT * FROM Pacjenci", typeof(Patient));*/ - - } public void AddRange(IEnumerable modelsList) { _modelsList.Clear(); diff --git a/View/DoctorsPage.xaml b/View/DoctorsPage.xaml new file mode 100644 index 0000000..cba096e --- /dev/null +++ b/View/DoctorsPage.xaml @@ -0,0 +1,174 @@ + + + + + + + + + + + + + + + + + + + + + + public sealed partial class MainFrameView : Page { + public MainFrameView() { this.InitializeComponent(); } private void AppBarButton_Click(object sender, RoutedEventArgs e) { - mainFrame.Navigate(typeof(PatientsPage)); + mainFrame.Navigate(typeof(PatientsPage), new HospitalServerManager.ViewModel.Controllers.DatabaseReader()); //Frame.Navigate(typeof(PatientsPage)); } } diff --git a/View/PatientsPage.xaml b/View/PatientsPage.xaml index 51fcf5a..dc41af8 100644 --- a/View/PatientsPage.xaml +++ b/View/PatientsPage.xaml @@ -8,11 +8,169 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" - Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> + Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Loaded="Page_Loaded"> - + + + + + + + + + + + + + + + + + +