Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
205b3d8014 | ||
| f31302438d | |||
| 40f9db3ea4 | |||
| a48f232208 | |||
| 03e69393fc |
10
PWAPPv2.sln
10
PWAPPv2.sln
@@ -1,13 +1,11 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.7.34009.444
|
||||
VisualStudioVersion = 17.8.34330.188
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PWAPPv2", "PWAPPv2\PWAPPv2.csproj", "{45E26AF8-41D7-4308-A2C8-D55A0350DB47}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PWAppUpdater", "PWAppUpdater\PWAppUpdater.csproj", "{B84B314C-C17A-42A3-BCAE-038F48343F5A}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PWAppUpdaterForm", "PWAppUpdater2\PWAppUpdaterForm.csproj", "{093798DD-2EDD-4519-AAC6-9DFF0DE3C15A}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PWAppUpdaterForm", "PWAppUpdater2\PWAppUpdaterForm.csproj", "{093798DD-2EDD-4519-AAC6-9DFF0DE3C15A}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@@ -19,10 +17,6 @@ Global
|
||||
{45E26AF8-41D7-4308-A2C8-D55A0350DB47}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{45E26AF8-41D7-4308-A2C8-D55A0350DB47}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{45E26AF8-41D7-4308-A2C8-D55A0350DB47}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{B84B314C-C17A-42A3-BCAE-038F48343F5A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{B84B314C-C17A-42A3-BCAE-038F48343F5A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{B84B314C-C17A-42A3-BCAE-038F48343F5A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{B84B314C-C17A-42A3-BCAE-038F48343F5A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{093798DD-2EDD-4519-AAC6-9DFF0DE3C15A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{093798DD-2EDD-4519-AAC6-9DFF0DE3C15A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{093798DD-2EDD-4519-AAC6-9DFF0DE3C15A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
|
||||
@@ -15,15 +15,15 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-7.0.0.3" newVersion="7.0.0.3" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-8.0.0.1" newVersion="8.0.0.1" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.IdentityModel.Abstractions" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.24.0.0" newVersion="6.24.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-7.2.0.0" newVersion="7.2.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Identity.Client" publicKeyToken="0a613f4dd989e8ae" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.47.2.0" newVersion="4.47.2.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.58.1.0" newVersion="4.58.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
@@ -31,16 +31,72 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Bcl.AsyncInterfaces" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Text.Encodings.Web" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Security.Cryptography.ProtectedData" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Security.AccessControl" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Memory.Data" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Azure.Core" publicKeyToken="92742159e12e44c8" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.37.0.0" newVersion="1.37.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Identity.Client.Extensions.Msal" publicKeyToken="0a613f4dd989e8ae" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.58.1.0" newVersion="4.58.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Azure.Identity" publicKeyToken="92742159e12e44c8" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.10.4.0" newVersion="1.10.4.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.IdentityModel.Protocols.OpenIdConnect" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-7.2.0.0" newVersion="7.2.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.IdentityModel.Protocols" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-7.2.0.0" newVersion="7.2.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.IdentityModel.Tokens" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-7.2.0.0" newVersion="7.2.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.IdentityModel.Tokens.Jwt" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-7.2.0.0" newVersion="7.2.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.IdentityModel.JsonWebTokens" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-7.2.0.0" newVersion="7.2.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.IdentityModel.Logging" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-7.2.0.0" newVersion="7.2.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Extensions.Logging.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
@@ -81,7 +81,7 @@
|
||||
</GroupBox>
|
||||
<Button Content="Send" HorizontalAlignment="Left" Margin="383,476,0,0" VerticalAlignment="Top" Width="75" Grid.Column="1" Height="20" Click="Button_Click_1"/>
|
||||
<Button Content="Cancel" HorizontalAlignment="Left" Margin="303,476,0,0" VerticalAlignment="Top" Width="75" Grid.Column="1" Height="20" Click="Button_Click"/>
|
||||
<GroupBox Header="Images" HorizontalAlignment="Left" Height="281" Margin="1,190,0,0" VerticalAlignment="Top" Width="457" Grid.Column="1">
|
||||
<GroupBox Header="Attachments" HorizontalAlignment="Left" Height="281" Margin="1,190,0,0" VerticalAlignment="Top" Width="457" Grid.Column="1">
|
||||
<Grid HorizontalAlignment="Left" Height="258" VerticalAlignment="Top" Width="447" Margin="0,0,-2,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="4*"/>
|
||||
@@ -94,8 +94,8 @@
|
||||
<ColumnDefinition Width="80*"/>
|
||||
<ColumnDefinition Width="77*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button x:Name="AddImageButton" Content="Add Image" Grid.Column="2" HorizontalAlignment="Left" VerticalAlignment="Top" Width="75" Height="20" Click="Button_Click_2"/>
|
||||
<Button Content="Remove" Grid.Column="1" Margin="0,0,5,1" HorizontalAlignment="Right" Width="75" Click="Button_Click_3"/>
|
||||
<Button x:Name="AddImageButton" Content="Add Attachment" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center" Width="100" Height="20" Click="Button_Click_2" Grid.ColumnSpan="2" Margin="47,0,0,0"/>
|
||||
<Button Content="Remove" Margin="257,0,0,1" HorizontalAlignment="Left" Width="75" Click="Button_Click_3" Grid.ColumnSpan="2"/>
|
||||
</Grid>
|
||||
<ListBox x:Name="ImageList" HorizontalAlignment="Left" Height="234" Grid.Row="1" VerticalAlignment="Top" Width="447"/>
|
||||
</Grid>
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
using System;
|
||||
using PWAPPv2.Source;
|
||||
using PWAPPv2.Source.Attachments;
|
||||
using PWAPPv2.Source.Database;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Text.Json;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Forms;
|
||||
@@ -38,43 +42,59 @@ namespace PWAPPv2
|
||||
|
||||
Source.Patient patient;
|
||||
|
||||
List<Source.DataObjects.PWImage> images;
|
||||
List<Source.DataObjects.Attachment> attachments;
|
||||
|
||||
List<string> SupportedImageTypes = new List<string>();
|
||||
|
||||
|
||||
//string ConfigPath = "C:\\PWAPP\\Config\\Config.xml";
|
||||
|
||||
string ConfigPath;
|
||||
|
||||
FileHandler fileHandler;
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
SupportedImageTypes.Clear();
|
||||
SupportedImageTypes.Add(".jpeg");
|
||||
SupportedImageTypes.Add(".jpg");
|
||||
SupportedImageTypes.Add(".png");
|
||||
SupportedImageTypes.Add(".gif");
|
||||
SupportedImageTypes.Add(".bmp");
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
args = App.Args;
|
||||
if(args.Length == 0)
|
||||
{
|
||||
throw new NoArgumentsException();
|
||||
}
|
||||
}
|
||||
catch (NoArgumentsException)
|
||||
{
|
||||
System.Windows.MessageBox.Show("No Patient ID was selected.\nPlease select a patient and retry the referral.");
|
||||
return;
|
||||
}
|
||||
catch (Exception)
|
||||
{ }
|
||||
|
||||
ConfigPath = "C:\\PWAPP\\Config\\";
|
||||
try
|
||||
{
|
||||
//ConfigPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
|
||||
//ConfigPath = Path.Combine(ConfigPath, "PWAPP\\Config\\");
|
||||
|
||||
ConfigPath = "C:\\PWAPP\\Config\\";
|
||||
|
||||
practiceConfig = new Source.Config.Configuration(ConfigPath + "PracticeConfig.xml");
|
||||
universalConfig = new Source.Config.Configuration(ConfigPath + "UniversalConfig.xml");
|
||||
practiceConfig = new Source.Config.Configuration("C:\\PWAPP\\Config\\PracticeConfig.xml");
|
||||
universalConfig = new Source.Config.Configuration("C:\\PWAPP\\App\\Config\\UniversalConfig.xml");
|
||||
}
|
||||
catch
|
||||
(Exception)
|
||||
(Exception ex)
|
||||
{
|
||||
System.Windows.MessageBox.Show("An error has occured in the configurations files.");
|
||||
System.Windows.MessageBox.Show("An error has occured in the configurations files.\n(" + ex.Message + ")");
|
||||
}
|
||||
|
||||
pwapiConnection = new Source.API.PWApiConnection(practiceConfig, universalConfig);
|
||||
|
||||
try
|
||||
{
|
||||
if (pwapiConnection.CheckForUpdate() == true)
|
||||
/*if (pwapiConnection.CheckForUpdate() == true)
|
||||
{
|
||||
string message = "An update is available! Would you like to install it?";
|
||||
string title = "Update available!";
|
||||
@@ -89,15 +109,21 @@ namespace PWAPPv2
|
||||
p.StartInfo.UseShellExecute = false;
|
||||
p.StartInfo.RedirectStandardOutput = true;
|
||||
p.StartInfo.RedirectStandardError = true;
|
||||
p.StartInfo.Arguments = args[0];
|
||||
if(System.Environment.OSVersion.Version.Major >= 6)
|
||||
try
|
||||
{
|
||||
p.StartInfo.Arguments = args[0];
|
||||
}
|
||||
catch { }
|
||||
if (System.Environment.OSVersion.Version.Major >= 6)
|
||||
{
|
||||
p.StartInfo.Verb = "runas";
|
||||
}
|
||||
p.Start();
|
||||
Environment.Exit(0);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
pwapiConnection.Update(args);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
@@ -106,8 +132,7 @@ namespace PWAPPv2
|
||||
|
||||
try
|
||||
{
|
||||
images = new List<Source.DataObjects.PWImage>();
|
||||
|
||||
attachments = new List<Source.DataObjects.Attachment>();
|
||||
|
||||
Source.Database.DatabaseConnection dbcon = new Source.Database.DatabaseConnection(practiceConfig);
|
||||
|
||||
@@ -115,23 +140,33 @@ namespace PWAPPv2
|
||||
apiCreds = new Source.DataObjects.APICredentials(apiconfig);
|
||||
apiConnection = new Source.API.APIConnection(universalConfig.Get("PWBaseURI"), apiCreds);
|
||||
|
||||
fileHandler = new FileHandler(apiCreds);
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
PopulateComboBoxes();
|
||||
|
||||
patient = new Source.Patient();
|
||||
//patient = new Source.Patient();
|
||||
|
||||
patient.BuildFromDatabase(dbcon, args[0]);
|
||||
//patient.BuildFromDatabase(dbcon, args[0]);
|
||||
|
||||
patient = Patient.GetPatient(dbcon, args[0]);
|
||||
|
||||
this.DataContext = new Source.PatientGUIAdapter(patient);
|
||||
}
|
||||
catch (NullReferenceException)
|
||||
{
|
||||
|
||||
}
|
||||
catch (CouldNotOpenConnectionException)
|
||||
{
|
||||
System.Windows.MessageBox.Show("An problem occurred trying to connect to the OpenDental database.\nThe program will now exit.");
|
||||
Environment.Exit(-1);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.Windows.MessageBox.Show(e.Message);
|
||||
System.Windows.MessageBox.Show("An unknow error has occurred.\n" + e.Message);
|
||||
System.Environment.Exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -207,7 +242,8 @@ namespace PWAPPv2
|
||||
private void Button_Click_1(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Source.DataObjects.Referral referral;
|
||||
if (images.Count == 0)
|
||||
|
||||
if (fileHandler.Attachments.Count == 0)
|
||||
{
|
||||
referral = new Source.DataObjects.Referral(apiCreds, patient,
|
||||
(Source.DataObjects.ReferralTypeBox)TypeBox,
|
||||
@@ -224,19 +260,13 @@ namespace PWAPPv2
|
||||
fieldRemakrs, contact, true);
|
||||
}
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
string referralString = referral.ToJsonString();
|
||||
string result = pwapiConnection.SendReferral(referralString); //apiConnection.SendPostRequestAsync("api/PWMakeReferral", referralString);
|
||||
if (images.Count > 0)
|
||||
{
|
||||
foreach (Source.DataObjects.PWImage im in images)
|
||||
{
|
||||
Source.DataObjects.Attachment att = new Source.DataObjects.Attachment(apiCreds, im, result);
|
||||
string json = att.ToJsonString();
|
||||
apiConnection.SendPostRequestAsync("api/PWAttachment", json);
|
||||
}
|
||||
}
|
||||
string result = pwapiConnection.SendReferral(referralString);
|
||||
|
||||
fileHandler.SendFilesAsAttachments(apiConnection, result);
|
||||
|
||||
System.Windows.MessageBox.Show("Referral added successfully!");
|
||||
|
||||
@@ -251,34 +281,65 @@ namespace PWAPPv2
|
||||
//AddImage Button
|
||||
private void Button_Click_2(object sender, RoutedEventArgs e)
|
||||
{
|
||||
System.Windows.Forms.OpenFileDialog openFileDialog = new System.Windows.Forms.OpenFileDialog();
|
||||
openFileDialog.Multiselect = true;
|
||||
openFileDialog.Filter = "Image files (*.jpg,*.jpeg)|*.jpg;*.jpeg";
|
||||
openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures);
|
||||
/*//System.Windows.Forms.OpenFileDialog openFileDialog = new System.Windows.Forms.OpenFileDialog();
|
||||
//openFileDialog.Multiselect = true;
|
||||
//openFileDialog.Filter = "Attachment files (*.jpg,*.jpeg,*.pdf,*.png)|*.jpg;*.jpeg;*.pdf;*.png;";
|
||||
//openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures);
|
||||
|
||||
if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
|
||||
{
|
||||
foreach (string filename in openFileDialog.FileNames)
|
||||
{
|
||||
try
|
||||
{
|
||||
images.Add(new Source.DataObjects.PWImage(filename));
|
||||
}
|
||||
catch (NullReferenceException)
|
||||
{
|
||||
images = new List<Source.DataObjects.PWImage>();
|
||||
images.Add(new Source.DataObjects.PWImage(filename));
|
||||
}
|
||||
}
|
||||
//if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
|
||||
//{
|
||||
// foreach (string filename in openFileDialog.FileNames)
|
||||
// {
|
||||
// //if (Path.GetExtension(filename) == ".jpg" || Path.GetExtension(filename) == ".jpeg")
|
||||
// if(SupportedImageTypes.Contains(Path.GetExtension(filename)))
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// attachments.Add(new Source.DataObjects.Attachment(apiCreds, new Source.DataObjects.PWImage(filename)));
|
||||
// }
|
||||
// catch (NullReferenceException)
|
||||
// {
|
||||
|
||||
}
|
||||
// attachments = new List<Source.DataObjects.Attachment>
|
||||
// {
|
||||
// new Source.DataObjects.Attachment(apiCreds, new Source.DataObjects.PWImage(filename))
|
||||
// };
|
||||
// }
|
||||
// }
|
||||
// if (Path.GetExtension(filename) == ".pdf")
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// attachments.Add(new Source.DataObjects.Attachment(apiCreds, new Source.DataObjects.PWPdf(filename)));
|
||||
// }
|
||||
// catch (NullReferenceException)
|
||||
// {
|
||||
// attachments = new List<Source.DataObjects.Attachment>()
|
||||
// {
|
||||
// new Source.DataObjects.Attachment(apiCreds, new Source.DataObjects.PWPdf(filename))
|
||||
// };
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
//}*/
|
||||
|
||||
fileHandler.AddFile();
|
||||
|
||||
try
|
||||
{
|
||||
ImageList.Items.Clear();
|
||||
foreach (Source.DataObjects.PWImage image in images)
|
||||
|
||||
foreach (var attachment in fileHandler.Attachments)
|
||||
{
|
||||
ImageList.Items.Add(CreateImageGridItem(image));
|
||||
if (attachment.pdf != null)
|
||||
{
|
||||
ImageList.Items.Add(CreateImageGridItem(new Source.DataObjects.PWImage("C:\\PWAPP\\App\\App\\pdf.jpg"), attachment.pdf.path));
|
||||
}
|
||||
else
|
||||
{
|
||||
ImageList.Items.Add(CreateImageGridItem(attachment.image));
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (NullReferenceException)
|
||||
@@ -293,13 +354,22 @@ namespace PWAPPv2
|
||||
{
|
||||
return;
|
||||
}
|
||||
images.RemoveAt(index);
|
||||
|
||||
attachments.RemoveAt(index);
|
||||
try
|
||||
{
|
||||
ImageList.Items.Clear();
|
||||
foreach (Source.DataObjects.PWImage image in images)
|
||||
|
||||
foreach (var attachment in fileHandler.Attachments)
|
||||
{
|
||||
ImageList.Items.Add(CreateImageGridItem(image));
|
||||
if (attachment.pdf != null)
|
||||
{
|
||||
ImageList.Items.Add(CreateImageGridItem(new Source.DataObjects.PWImage("C:\\PWAPP\\App\\App\\pdf.jpg"), attachment.pdf.path));
|
||||
}
|
||||
else
|
||||
{
|
||||
ImageList.Items.Add(CreateImageGridItem(attachment.image));
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (NullReferenceException)
|
||||
@@ -338,5 +408,43 @@ namespace PWAPPv2
|
||||
return imageGrid;
|
||||
|
||||
}
|
||||
|
||||
public Grid CreateImageGridItem(Source.DataObjects.PWImage image, string path)
|
||||
{
|
||||
Grid imageGrid = new Grid();
|
||||
imageGrid.Width = 477;
|
||||
imageGrid.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
|
||||
imageGrid.VerticalAlignment = VerticalAlignment.Top;
|
||||
imageGrid.ShowGridLines = true;
|
||||
|
||||
ColumnDefinition imageColumn = new ColumnDefinition();
|
||||
imageColumn.Width = new GridLength(50);
|
||||
ColumnDefinition textColumn = new ColumnDefinition();
|
||||
textColumn.Width = new GridLength(427);
|
||||
|
||||
imageGrid.ColumnDefinitions.Add(imageColumn);
|
||||
imageGrid.ColumnDefinitions.Add(textColumn);
|
||||
|
||||
Image addedImage = new Image();
|
||||
addedImage.Source = image.GetBitmapImage();
|
||||
|
||||
TextBlock text = new TextBlock();
|
||||
text.Text = path;
|
||||
text.FontSize = 12;
|
||||
|
||||
|
||||
Grid.SetColumn(addedImage, 0);
|
||||
Grid.SetColumn(text, 1);
|
||||
|
||||
imageGrid.Children.Add(addedImage);
|
||||
imageGrid.Children.Add(text);
|
||||
return imageGrid;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public class NoArgumentsException : Exception
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,77 +37,90 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Azure.Core, Version=1.25.0.0, Culture=neutral, PublicKeyToken=92742159e12e44c8, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Azure.Core.1.25.0\lib\net461\Azure.Core.dll</HintPath>
|
||||
<Reference Include="Azure.Core, Version=1.37.0.0, Culture=neutral, PublicKeyToken=92742159e12e44c8, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Azure.Core.1.37.0\lib\net472\Azure.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Azure.Identity, Version=1.7.0.0, Culture=neutral, PublicKeyToken=92742159e12e44c8, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Azure.Identity.1.7.0\lib\netstandard2.0\Azure.Identity.dll</HintPath>
|
||||
<Reference Include="Azure.Identity, Version=1.10.4.0, Culture=neutral, PublicKeyToken=92742159e12e44c8, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Azure.Identity.1.10.4\lib\netstandard2.0\Azure.Identity.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.7.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
|
||||
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.8.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Data.SqlClient, Version=5.0.0.0, Culture=neutral, PublicKeyToken=23ec7fc2d6eaa4a5, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Data.SqlClient.5.1.1\lib\net462\Microsoft.Data.SqlClient.dll</HintPath>
|
||||
<HintPath>..\packages\Microsoft.Data.SqlClient.5.1.4\lib\net462\Microsoft.Data.SqlClient.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Identity.Client, Version=4.47.2.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Identity.Client.4.47.2\lib\net461\Microsoft.Identity.Client.dll</HintPath>
|
||||
<Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.8.0.0\lib\net462\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Identity.Client.Extensions.Msal, Version=2.19.3.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Identity.Client.Extensions.Msal.2.19.3\lib\net45\Microsoft.Identity.Client.Extensions.Msal.dll</HintPath>
|
||||
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.8.0.0\lib\net462\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.IdentityModel.Abstractions, Version=6.24.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.IdentityModel.Abstractions.6.24.0\lib\net472\Microsoft.IdentityModel.Abstractions.dll</HintPath>
|
||||
<Reference Include="Microsoft.Identity.Client, Version=4.58.1.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Identity.Client.4.58.1\lib\net462\Microsoft.Identity.Client.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.IdentityModel.JsonWebTokens, Version=6.24.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.IdentityModel.JsonWebTokens.6.24.0\lib\net472\Microsoft.IdentityModel.JsonWebTokens.dll</HintPath>
|
||||
<Reference Include="Microsoft.Identity.Client.Extensions.Msal, Version=4.58.1.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Identity.Client.Extensions.Msal.4.58.1\lib\netstandard2.0\Microsoft.Identity.Client.Extensions.Msal.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.IdentityModel.Logging, Version=6.24.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.IdentityModel.Logging.6.24.0\lib\net472\Microsoft.IdentityModel.Logging.dll</HintPath>
|
||||
<Reference Include="Microsoft.IdentityModel.Abstractions, Version=7.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.IdentityModel.Abstractions.7.2.0\lib\net472\Microsoft.IdentityModel.Abstractions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.IdentityModel.Protocols, Version=6.24.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.IdentityModel.Protocols.6.24.0\lib\net472\Microsoft.IdentityModel.Protocols.dll</HintPath>
|
||||
<Reference Include="Microsoft.IdentityModel.JsonWebTokens, Version=7.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.IdentityModel.JsonWebTokens.7.2.0\lib\net472\Microsoft.IdentityModel.JsonWebTokens.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect, Version=6.24.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.IdentityModel.Protocols.OpenIdConnect.6.24.0\lib\net472\Microsoft.IdentityModel.Protocols.OpenIdConnect.dll</HintPath>
|
||||
<Reference Include="Microsoft.IdentityModel.Logging, Version=7.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.IdentityModel.Logging.7.2.0\lib\net472\Microsoft.IdentityModel.Logging.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.IdentityModel.Tokens, Version=6.24.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.IdentityModel.Tokens.6.24.0\lib\net472\Microsoft.IdentityModel.Tokens.dll</HintPath>
|
||||
<Reference Include="Microsoft.IdentityModel.Protocols, Version=7.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.IdentityModel.Protocols.7.2.0\lib\net472\Microsoft.IdentityModel.Protocols.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect, Version=7.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.IdentityModel.Protocols.OpenIdConnect.7.2.0\lib\net472\Microsoft.IdentityModel.Protocols.OpenIdConnect.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.IdentityModel.Tokens, Version=7.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.IdentityModel.Tokens.7.2.0\lib\net472\Microsoft.IdentityModel.Tokens.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MySqlConnector, Version=2.0.0.0, Culture=neutral, PublicKeyToken=d33d3e53aa5f8c92, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MySqlConnector.2.2.7\lib\net471\MySqlConnector.dll</HintPath>
|
||||
<HintPath>..\packages\MySqlConnector.2.3.4\lib\net471\MySqlConnector.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json.Bson, Version=1.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.Bson.1.0.2\lib\net45\Newtonsoft.Json.Bson.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ComponentModel.Composition" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Configuration.ConfigurationManager, Version=6.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Configuration.ConfigurationManager.6.0.1\lib\net461\System.Configuration.ConfigurationManager.dll</HintPath>
|
||||
<Reference Include="System.Configuration.ConfigurationManager, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Configuration.ConfigurationManager.8.0.0\lib\net462\System.Configuration.ConfigurationManager.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Data.OracleClient" />
|
||||
<Reference Include="System.Diagnostics.DiagnosticSource, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Diagnostics.DiagnosticSource.6.0.0\lib\net461\System.Diagnostics.DiagnosticSource.dll</HintPath>
|
||||
<Reference Include="System.Diagnostics.DiagnosticSource, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Diagnostics.DiagnosticSource.8.0.0\lib\net462\System.Diagnostics.DiagnosticSource.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.DirectoryServices" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.IdentityModel" />
|
||||
<Reference Include="System.IdentityModel.Tokens.Jwt, Version=6.24.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.IdentityModel.Tokens.Jwt.6.24.0\lib\net472\System.IdentityModel.Tokens.Jwt.dll</HintPath>
|
||||
<Reference Include="System.IdentityModel.Tokens.Jwt, Version=7.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.IdentityModel.Tokens.Jwt.7.2.0\lib\net472\System.IdentityModel.Tokens.Jwt.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.IO, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.IO.4.3.0\lib\net462\System.IO.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.IO.FileSystem.AccessControl, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.IO.FileSystem.AccessControl.5.0.0\lib\net461\System.IO.FileSystem.AccessControl.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Memory.Data, Version=1.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Memory.Data.1.0.2\lib\net461\System.Memory.Data.dll</HintPath>
|
||||
<Reference Include="System.Memory.Data, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Memory.Data.8.0.0\lib\net462\System.Memory.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net" />
|
||||
<Reference Include="System.Net.Http, Version=4.1.1.3, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
@@ -118,11 +131,11 @@
|
||||
<Reference Include="System.Net.Http.Extensions, Version=2.2.29.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http.Formatting, Version=5.2.9.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.2.9\lib\net45\System.Net.Http.Formatting.dll</HintPath>
|
||||
<Reference Include="System.Net.Http.Formatting, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.6.0.0\lib\net45\System.Net.Http.Formatting.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http.Json, Version=7.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Net.Http.Json.7.0.1\lib\net462\System.Net.Http.Json.dll</HintPath>
|
||||
<Reference Include="System.Net.Http.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Net.Http.Json.8.0.0\lib\net462\System.Net.Http.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http.Primitives, Version=4.2.29.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Primitives.dll</HintPath>
|
||||
@@ -164,26 +177,26 @@
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Security.Cryptography.ProtectedData, Version=4.0.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Security.Cryptography.ProtectedData.4.7.0\lib\net461\System.Security.Cryptography.ProtectedData.dll</HintPath>
|
||||
<Reference Include="System.Security.Cryptography.ProtectedData, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Security.Cryptography.ProtectedData.8.0.0\lib\net462\System.Security.Cryptography.ProtectedData.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Security.Cryptography.X509Certificates, Version=4.1.1.2, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Security.Cryptography.X509Certificates.4.3.2\lib\net461\System.Security.Cryptography.X509Certificates.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Security.Permissions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Security.Permissions.6.0.0\lib\net461\System.Security.Permissions.dll</HintPath>
|
||||
<Reference Include="System.Security.Permissions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Security.Permissions.8.0.0\lib\net462\System.Security.Permissions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Security.Principal.Windows, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Security.Principal.Windows.5.0.0\lib\net461\System.Security.Principal.Windows.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ServiceProcess" />
|
||||
<Reference Include="System.Text.Encodings.Web, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Text.Encodings.Web.7.0.0\lib\net462\System.Text.Encodings.Web.dll</HintPath>
|
||||
<Reference Include="System.Text.Encodings.Web, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Text.Encodings.Web.8.0.0\lib\net462\System.Text.Encodings.Web.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Text.Json, Version=7.0.0.3, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Text.Json.7.0.3\lib\net462\System.Text.Json.dll</HintPath>
|
||||
<Reference Include="System.Text.Json, Version=8.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Text.Json.8.0.1\lib\net462\System.Text.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||
@@ -214,6 +227,11 @@
|
||||
<Compile Include="Source\API\APIConnection.cs" />
|
||||
<Compile Include="Source\API\APIRequestBuilder.cs" />
|
||||
<Compile Include="Source\API\PWApiConnection.cs" />
|
||||
<Compile Include="Source\Attachments\AttachmentFactory.cs" />
|
||||
<Compile Include="Source\Attachments\FileHandler.cs" />
|
||||
<Compile Include="Source\Attachments\PWAttachment.cs" />
|
||||
<Compile Include="Source\Attachments\PWBaseAttachment.cs" />
|
||||
<Compile Include="Source\Attachments\PWFileUpload.cs" />
|
||||
<Compile Include="Source\Config\Configuration.cs" />
|
||||
<Compile Include="Source\Database\DatabaseConfig.cs" />
|
||||
<Compile Include="Source\Database\DatabaseConnection.cs" />
|
||||
@@ -221,15 +239,17 @@
|
||||
<Compile Include="Source\DataObjects\Attachment.cs" />
|
||||
<Compile Include="Source\DataObjects\ComboBoxData.cs" />
|
||||
<Compile Include="Source\DataObjects\Exceptions.cs" />
|
||||
<Compile Include="Source\DataObjects\PWFile.cs" />
|
||||
<Compile Include="Source\DataObjects\PWImage.cs" />
|
||||
<Compile Include="Source\DataObjects\NumValList.cs" />
|
||||
<Compile Include="Source\DataObjects\NumValPair.cs" />
|
||||
<Compile Include="Source\DataObjects\PWPdf.cs" />
|
||||
<Compile Include="Source\DataObjects\ReferFromBox.cs" />
|
||||
<Compile Include="Source\DataObjects\Referral.cs" />
|
||||
<Compile Include="Source\DataObjects\ReferralTypeBox.cs" />
|
||||
<Compile Include="Source\DataObjects\ReferToBox.cs" />
|
||||
<Compile Include="Source\Patient.cs" />
|
||||
<Compile Include="Source\PatientGUIAdapter.cs" />
|
||||
<Compile Include="Source\DataObjects\Patient.cs" />
|
||||
<Compile Include="Source\DataObjects\PatientGUIAdapter.cs" />
|
||||
<Page Include="MainWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
@@ -280,7 +300,7 @@
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\Microsoft.Data.SqlClient.SNI.5.1.0\build\net462\Microsoft.Data.SqlClient.SNI.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Data.SqlClient.SNI.5.1.0\build\net462\Microsoft.Data.SqlClient.SNI.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\Microsoft.Data.SqlClient.SNI.5.1.1\build\net462\Microsoft.Data.SqlClient.SNI.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Data.SqlClient.SNI.5.1.1\build\net462\Microsoft.Data.SqlClient.SNI.targets'))" />
|
||||
</Target>
|
||||
<Import Project="..\packages\Microsoft.Data.SqlClient.SNI.5.1.0\build\net462\Microsoft.Data.SqlClient.SNI.targets" Condition="Exists('..\packages\Microsoft.Data.SqlClient.SNI.5.1.0\build\net462\Microsoft.Data.SqlClient.SNI.targets')" />
|
||||
<Import Project="..\packages\Microsoft.Data.SqlClient.SNI.5.1.1\build\net462\Microsoft.Data.SqlClient.SNI.targets" Condition="Exists('..\packages\Microsoft.Data.SqlClient.SNI.5.1.1\build\net462\Microsoft.Data.SqlClient.SNI.targets')" />
|
||||
</Project>
|
||||
@@ -27,6 +27,10 @@ namespace PWAPPv2.Source.API
|
||||
Client.BaseAddress = new Uri(BaseURL);
|
||||
Client.DefaultRequestHeaders.Accept.Add(
|
||||
new MediaTypeWithQualityHeaderValue("application/json"));
|
||||
Client.DefaultRequestHeaders.Add("UserID", Credentials.UserID);
|
||||
Client.DefaultRequestHeaders.Add("Password", Credentials.Password);
|
||||
Client.DefaultRequestHeaders.Add("PracticeID", Credentials.PracticeId);
|
||||
Client.DefaultRequestHeaders.Add("ApiID", Credentials.APIid);
|
||||
|
||||
}
|
||||
|
||||
@@ -94,20 +98,17 @@ namespace PWAPPv2.Source.API
|
||||
/// <exception cref="RequestFailedExcpetion"></exception>
|
||||
public string SendPostWithCredsInHeader(string apiUri, string PostData)
|
||||
{
|
||||
Client.DefaultRequestHeaders.Add("UserID", Credentials.UserID);
|
||||
Client.DefaultRequestHeaders.Add("Password", Credentials.Password);
|
||||
Client.DefaultRequestHeaders.Add("PracticeID", Credentials.PracticeId);
|
||||
Client.DefaultRequestHeaders.Add("ApiID", Credentials.APIid);
|
||||
|
||||
|
||||
StringContent content = new StringContent(PostData, Encoding.UTF8, "application/json");
|
||||
string conts = content.ToString();
|
||||
|
||||
var response = Client.PostAsync(apiUri, content).Result;
|
||||
|
||||
Client.DefaultRequestHeaders.Remove("UserID");
|
||||
Client.DefaultRequestHeaders.Remove("Password");
|
||||
Client.DefaultRequestHeaders.Remove("PraticeID");
|
||||
Client.DefaultRequestHeaders.Remove("ApiID");
|
||||
//Client.DefaultRequestHeaders.Remove("UserID");
|
||||
//Client.DefaultRequestHeaders.Remove("Password");
|
||||
//Client.DefaultRequestHeaders.Remove("PraticeID");
|
||||
//Client.DefaultRequestHeaders.Remove("ApiID");
|
||||
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
using PWAPPv2.Source.DataObjects;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace PWAPPv2.Source.API
|
||||
{
|
||||
@@ -57,6 +59,45 @@ namespace PWAPPv2.Source.API
|
||||
return false;
|
||||
}
|
||||
|
||||
public void Update(string[] args)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (CheckForUpdate() == true)
|
||||
{
|
||||
string message = "An update is available! Would you like to install it?";
|
||||
string title = "Update available!";
|
||||
MessageBoxButtons buttons = MessageBoxButtons.YesNo;
|
||||
DialogResult result = System.Windows.Forms.MessageBox.Show(message, title, buttons);
|
||||
if (result == System.Windows.Forms.DialogResult.Yes)
|
||||
{
|
||||
//System.Windows.MessageBox.Show("HAHA NO UPDATE FOR YOU!");
|
||||
Process p = new Process();
|
||||
p.StartInfo.FileName = "C:\\PWAPP\\Updater\\PWAppUpdaterForm.exe";
|
||||
p.StartInfo.WindowStyle = ProcessWindowStyle.Maximized;
|
||||
p.StartInfo.UseShellExecute = false;
|
||||
p.StartInfo.RedirectStandardOutput = true;
|
||||
p.StartInfo.RedirectStandardError = true;
|
||||
try
|
||||
{
|
||||
p.StartInfo.Arguments = args[0];
|
||||
}
|
||||
catch { }
|
||||
if (System.Environment.OSVersion.Version.Major >= 6)
|
||||
{
|
||||
p.StartInfo.Verb = "runas";
|
||||
}
|
||||
p.Start();
|
||||
Environment.Exit(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw new UpdateException();
|
||||
}
|
||||
}
|
||||
|
||||
public string GetReferalTypes()
|
||||
{
|
||||
return ReferTypesConnection.SendPostWithCredsInHeader("", "");
|
||||
@@ -78,4 +119,6 @@ namespace PWAPPv2.Source.API
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class UpdateException : Exception { }
|
||||
}
|
||||
|
||||
78
PWAPPv2/Source/Attachments/AttachmentFactory.cs
Normal file
78
PWAPPv2/Source/Attachments/AttachmentFactory.cs
Normal file
@@ -0,0 +1,78 @@
|
||||
using Microsoft.Identity.Client;
|
||||
using PWAPPv2.Source.DataObjects;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PWAPPv2.Source.Attachments
|
||||
{
|
||||
public class AttachmentFactory
|
||||
{
|
||||
public static PWAttachment BuildAttachment(APICredentials credentials, string token, PWImage image)
|
||||
{
|
||||
PWAttachment attachment = new PWAttachment();
|
||||
attachment.UserID = credentials.UserID;
|
||||
attachment.Password = credentials.Password;
|
||||
attachment.PracticeId = credentials.PracticeId;
|
||||
attachment.APIid = credentials.APIid;
|
||||
attachment.UserNum = "API";
|
||||
attachment.AttToken = token.Replace("\"", "");
|
||||
attachment.ThumbExists = "1";
|
||||
attachment.ZoomExists = "1";
|
||||
attachment.FileDate = "";
|
||||
attachment.FileName = image.ShortFileName();
|
||||
attachment.FileType = image.FileType;
|
||||
attachment.Base64FileContents = image.GetBase64String();
|
||||
attachment.Base64ThumbContents = image.GetBase64ThumbString();
|
||||
attachment.Base64ZoomContents = image.GetBase64ZoomString();
|
||||
return attachment;
|
||||
}
|
||||
|
||||
public static PWAttachment BuildAttachment(APICredentials credentials, string token, PWPdf pdf)
|
||||
{
|
||||
PWAttachment attachment = new PWAttachment();
|
||||
attachment.UserID = credentials.UserID;
|
||||
attachment.Password = credentials.Password;
|
||||
attachment.PracticeId = credentials.PracticeId;
|
||||
attachment.APIid = credentials.APIid;
|
||||
attachment.UserNum = "API";
|
||||
attachment.AttToken = token.Replace("\"", "");
|
||||
attachment.ThumbExists = "0";
|
||||
attachment.ZoomExists = "0";
|
||||
attachment.FileDate = "";
|
||||
attachment.FileName = pdf.ShortFileName();
|
||||
attachment.FileType = "application/pdf";
|
||||
attachment.Base64FileContents = pdf.GetBase64String();
|
||||
attachment.Base64ThumbContents = "";
|
||||
attachment.Base64ZoomContents = "";
|
||||
return attachment;
|
||||
|
||||
}
|
||||
|
||||
public static PWBaseAttachment BuildBaseAttachment(string token, PWImage image)
|
||||
{
|
||||
PWBaseAttachment attachment = new PWBaseAttachment();
|
||||
attachment.AttToken = token.Replace("\"", "");
|
||||
attachment.ThumbExists = true;
|
||||
attachment.ZoomExists = true;
|
||||
attachment.FileDate = "";
|
||||
attachment.FileName = image.ShortFileName();
|
||||
attachment.FileType = image.FileType;
|
||||
return attachment;
|
||||
}
|
||||
|
||||
public static PWBaseAttachment BuildBaseAttachment(string token, PWPdf pdf)
|
||||
{
|
||||
PWBaseAttachment attachment = new PWBaseAttachment();
|
||||
attachment.AttToken = token.Replace("\"", "");
|
||||
attachment.ThumbExists = false;
|
||||
attachment.ZoomExists = true;
|
||||
attachment.FileDate = "";
|
||||
attachment.FileName = pdf.ShortFileName();
|
||||
attachment.FileType = "application/pdf";
|
||||
return attachment;
|
||||
}
|
||||
}
|
||||
}
|
||||
12
PWAPPv2/Source/Attachments/AttachmentResponse.cs
Normal file
12
PWAPPv2/Source/Attachments/AttachmentResponse.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PWAPPv2.Source.Attachments
|
||||
{
|
||||
public class AttachmentResponse
|
||||
{
|
||||
}
|
||||
}
|
||||
164
PWAPPv2/Source/Attachments/FileHandler.cs
Normal file
164
PWAPPv2/Source/Attachments/FileHandler.cs
Normal file
@@ -0,0 +1,164 @@
|
||||
using PWAPPv2.Source.API;
|
||||
using PWAPPv2.Source.DataObjects;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net.Mail;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace PWAPPv2.Source.Attachments
|
||||
{
|
||||
public class FileHandler
|
||||
{
|
||||
|
||||
public List<string> SupportedImageTypes;
|
||||
public List<string> SupportedVideoTypes;
|
||||
public List<string> SupportedDocumentTypes;
|
||||
|
||||
public List<Source.DataObjects.Attachment> Attachments;
|
||||
|
||||
private APICredentials credentials;
|
||||
|
||||
private string filterString;
|
||||
|
||||
public FileHandler(APICredentials apiCredentials)
|
||||
{
|
||||
credentials = apiCredentials;
|
||||
SupportedImageTypes = new List<string>();
|
||||
SupportedVideoTypes = new List<string>();
|
||||
SupportedDocumentTypes = new List<string>();
|
||||
|
||||
SupportedImageTypes.Clear();
|
||||
SupportedImageTypes.Add(".jpeg");
|
||||
SupportedImageTypes.Add(".jpg");
|
||||
SupportedImageTypes.Add(".png");
|
||||
SupportedImageTypes.Add(".tiff");
|
||||
SupportedImageTypes.Add(".tif");
|
||||
SupportedImageTypes.Add(".gif");
|
||||
SupportedImageTypes.Add(".bmp");
|
||||
|
||||
SupportedDocumentTypes.Clear();
|
||||
SupportedDocumentTypes.Add(".pdf");
|
||||
|
||||
Attachments = new List<Source.DataObjects.Attachment>();
|
||||
|
||||
filterString = "Attachment files (";
|
||||
string filter = "|";
|
||||
foreach (string imageType in SupportedImageTypes)
|
||||
{
|
||||
filterString += "*" + imageType + ",";
|
||||
filter += "*" + imageType + ";";
|
||||
}
|
||||
foreach (string videoType in SupportedVideoTypes)
|
||||
{
|
||||
filterString += "*" + videoType + ",";
|
||||
filter += "*" + videoType + ";";
|
||||
}
|
||||
foreach (string documentType in SupportedDocumentTypes)
|
||||
{
|
||||
filterString += "*" + documentType + ",";
|
||||
filter += "*" + documentType + ";";
|
||||
}
|
||||
filterString = filterString.Remove(filterString.Length - 1, 1);
|
||||
filterString += ")" + filter;
|
||||
|
||||
}
|
||||
|
||||
public void AddFile()
|
||||
{
|
||||
OpenFileDialog openFileDialog = new OpenFileDialog();
|
||||
openFileDialog.Multiselect = true;
|
||||
|
||||
|
||||
openFileDialog.Filter = filterString;
|
||||
openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures);
|
||||
|
||||
if (openFileDialog.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
foreach (string filename in openFileDialog.FileNames)
|
||||
{
|
||||
if(SupportedImageTypes.Contains(Path.GetExtension(filename)))
|
||||
{
|
||||
try
|
||||
{
|
||||
Attachments.Add(new DataObjects.Attachment(credentials, new DataObjects.PWImage(filename)));
|
||||
}
|
||||
catch (NullReferenceException)
|
||||
{ }
|
||||
}
|
||||
if(SupportedDocumentTypes.Contains(Path.GetExtension(filename)))
|
||||
{
|
||||
try
|
||||
{
|
||||
Attachments.Add(new Source.DataObjects.Attachment(credentials, new Source.DataObjects.PWPdf(filename)));
|
||||
}
|
||||
catch(NullReferenceException) { }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void SendFilesAsAttachments(APIConnection connection, string token)
|
||||
{
|
||||
if(Attachments.Count <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
foreach(DataObjects.Attachment attachment in Attachments)
|
||||
{
|
||||
//PWAttachment att = null;
|
||||
PWBaseAttachment ba = null;
|
||||
|
||||
List<PWFileUpload> fileUploads = new List<PWFileUpload>();
|
||||
|
||||
if (attachment.image != null)
|
||||
{
|
||||
//att = AttachmentFactory.BuildAttachment(credentials, token, attachment.image);
|
||||
ba = AttachmentFactory.BuildBaseAttachment(token, attachment.image);
|
||||
//fileUploads.Add(attachment.image.GetFileUploads(attachment.co))
|
||||
|
||||
string json = JsonSerializer.Serialize(ba);
|
||||
string contId = connection.SendPostWithCredsInHeader("api/PWAddAttachment", json);
|
||||
contId = contId.Replace("\"", "").Replace("\\n", "").Trim();
|
||||
fileUploads = attachment.image.GetFileUploads(token, contId);
|
||||
foreach(PWFileUpload file in fileUploads)
|
||||
{
|
||||
json = JsonSerializer.Serialize(file);
|
||||
connection.SendPostWithCredsInHeader("api/PWUploadFile", json);
|
||||
}
|
||||
}
|
||||
else if (attachment.pdf != null)
|
||||
{
|
||||
//att = AttachmentFactory.BuildAttachment(credentials, token, attachment.pdf);
|
||||
ba = AttachmentFactory.BuildBaseAttachment(token, attachment.pdf);
|
||||
|
||||
string json = JsonSerializer.Serialize(ba);
|
||||
string contId = connection.SendPostWithCredsInHeader("api/PWAddAttachment", json);
|
||||
fileUploads = attachment.pdf.GetFileUploads(token, contId);
|
||||
foreach (PWFileUpload file in fileUploads)
|
||||
{
|
||||
json = JsonSerializer.Serialize(file);
|
||||
connection.SendPostWithCredsInHeader("api/PWUploadFile", json);
|
||||
}
|
||||
}
|
||||
|
||||
//if (att == null)
|
||||
//{
|
||||
// throw new AttachmentTypeNotYetSupportedException();
|
||||
//}
|
||||
//string json = JsonSerializer.Serialize(att);
|
||||
//connection.SendPostWithCredsInHeader("api/PWAttachment", json);
|
||||
//json = JsonSerializer.Serialize(ba);
|
||||
//connection.SendPostWithCredsInHeader("api/PWAddAttachment", json);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class AttachmentTypeNotYetSupportedException : Exception { }
|
||||
}
|
||||
28
PWAPPv2/Source/Attachments/PWAttachment.cs
Normal file
28
PWAPPv2/Source/Attachments/PWAttachment.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PWAPPv2.Source.Attachments
|
||||
{
|
||||
public class PWAttachment
|
||||
{
|
||||
public string UserID { get; set; }
|
||||
public string Password { get; set; }
|
||||
public string PracticeId { get; set; }
|
||||
public string APIid { get; set; }
|
||||
public string UserNum { get; set; }
|
||||
public string AttToken { get; set; }
|
||||
public string FileName { get; set; }
|
||||
public string ThumbExists { get; set; }
|
||||
public string ZoomExists { get; set; }
|
||||
public string FileDate { get; set; }
|
||||
public string FileType { get; set; }
|
||||
public string Base64FileContents { get; set; }
|
||||
public string Base64ThumbContents { get; set; }
|
||||
public string Base64ZoomContents { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
19
PWAPPv2/Source/Attachments/PWBaseAttachment.cs
Normal file
19
PWAPPv2/Source/Attachments/PWBaseAttachment.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PWAPPv2.Source.Attachments
|
||||
{
|
||||
public class PWBaseAttachment
|
||||
{
|
||||
public string AttToken { get; set; }
|
||||
public string FileName { get; set; }
|
||||
public bool ThumbExists { get; set; }
|
||||
public bool ZoomExists { get; set; }
|
||||
public string FileDate { get; set; }
|
||||
public string FileType { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
16
PWAPPv2/Source/Attachments/PWFileUpload.cs
Normal file
16
PWAPPv2/Source/Attachments/PWFileUpload.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PWAPPv2.Source.Attachments
|
||||
{
|
||||
public class PWFileUpload
|
||||
{
|
||||
public string Base64Content { get; set; }
|
||||
public string AttToken { get; set; }
|
||||
public string ContentId { get; set; }
|
||||
public string Tag { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,34 +1,59 @@
|
||||
namespace PWAPPv2.Source.DataObjects
|
||||
{
|
||||
class Attachment
|
||||
public class Attachment
|
||||
{
|
||||
APICredentials Credentials;
|
||||
PWImage image;
|
||||
public PWImage image { get; set; }
|
||||
public PWPdf pdf { get; set; }
|
||||
public string Token;
|
||||
|
||||
string Token;
|
||||
private string fileType { get; set; }
|
||||
|
||||
|
||||
public Attachment(APICredentials credentials, PWImage pwImage, string token)
|
||||
public Attachment(APICredentials credentials, PWImage pwImage)
|
||||
{
|
||||
Credentials = credentials;
|
||||
image = pwImage;
|
||||
Token = token;
|
||||
//Token = token;
|
||||
pdf = null;
|
||||
fileType = "image/jpeg";
|
||||
}
|
||||
|
||||
public Attachment(APICredentials credentials, PWPdf pwPdf)
|
||||
{
|
||||
Credentials = credentials;
|
||||
pdf = pwPdf;
|
||||
image = null;
|
||||
fileType = "application/pdf";
|
||||
}
|
||||
|
||||
public string ToJsonString()
|
||||
{
|
||||
return "\"{" + Credentials.BuildJsonBodyContents() +
|
||||
",'UserNum':'API'," +
|
||||
"'AttToken':'" + Token.Replace("\"", "") + "'," +
|
||||
"'FileName':'" + image.ShortFileName() + "'," +
|
||||
"'ContentType':'_1'," +
|
||||
"'ThumbExists':'1'," +
|
||||
"'ZoomExists':'1'," +
|
||||
"'FileDate':''," +
|
||||
"'Base64FileContents':'" + image.GetBase64String() + "',\n" +
|
||||
"'Base64ThumbContents':'" + image.GetBase64ThumbString() + "',\n" +
|
||||
"'Base64ZoomContents':'" + image.GetBase64ZoomString() + "'}\"";
|
||||
if (image != null)
|
||||
{
|
||||
return "\"{" + Credentials.BuildJsonBodyContents() +
|
||||
",'UserNum':'API'," +
|
||||
"'AttToken':'" + Token.Replace("\"", "") + "'," +
|
||||
"'FileName':'" + image.ShortFileName() + "'," +
|
||||
"'ThumbExists':'1'," +
|
||||
"'ZoomExists':'1'," +
|
||||
"'FileDate':''," +
|
||||
"'FileType':'" + image.FileType + "'," +
|
||||
image.GetJsonContents() + "}\"";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "\"{" + Credentials.BuildJsonBodyContents() +
|
||||
",'UserNum':'API'," +
|
||||
"'AttToken':'" + Token.Replace("\"", "") + "'," +
|
||||
"'FileName':'" + pdf.ShortFileName() + "'," +
|
||||
"'ThumbExists':'0'," +
|
||||
"'ZoomExists':'0'," +
|
||||
"'FileDate':''," +
|
||||
"'FileType':'" + fileType + "'," +
|
||||
"'Base64FileContents':'" + pdf.GetBase64String() + "',\n" +
|
||||
"'Base64ThumbContents':'',\n" +
|
||||
"'Base64ZoomContents':''}\"";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
13
PWAPPv2/Source/DataObjects/PWFile.cs
Normal file
13
PWAPPv2/Source/DataObjects/PWFile.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PWAPPv2.Source.DataObjects
|
||||
{
|
||||
interface PWFile
|
||||
{
|
||||
List<Attachments.PWFileUpload> GetFileUploads(string attToken, string ContentId);
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,22 @@
|
||||
using System;
|
||||
using PWAPPv2.Source.Attachments;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
|
||||
namespace PWAPPv2.Source.DataObjects
|
||||
{
|
||||
public class PWImage
|
||||
public class PWImage : PWFile
|
||||
{
|
||||
|
||||
private string ImagePath;
|
||||
|
||||
private BitmapImage bitmap;
|
||||
|
||||
public string FileType { get; }
|
||||
|
||||
|
||||
//private Bitmap bmp;
|
||||
//private Bitmap thumb;
|
||||
@@ -26,6 +31,29 @@ namespace PWAPPv2.Source.DataObjects
|
||||
bitmap.DecodePixelWidth = 100;
|
||||
bitmap.EndInit();
|
||||
|
||||
string extension = Path.GetExtension(path).ToLower();
|
||||
|
||||
if (extension == ".jpeg" || extension == ".jpg")
|
||||
{
|
||||
FileType = "image/jpeg";
|
||||
}
|
||||
else if (extension == ".png")
|
||||
{
|
||||
FileType = "image/png";
|
||||
}
|
||||
else if (extension == ".tiff" || extension == ".tif")
|
||||
{
|
||||
FileType = "image/tiff";
|
||||
}
|
||||
else if(extension == ".gif")
|
||||
{
|
||||
FileType = "image/gif";
|
||||
}
|
||||
else if(extension == ".bmp")
|
||||
{
|
||||
FileType = "image/bmp";
|
||||
}
|
||||
|
||||
//bmp = (Bitmap)System.Drawing.Image.FromFile(ImagePath);
|
||||
//thumb = resize(bmp, 50, 50);
|
||||
//zoom = resize(bmp, bmp.Width, bmp.Height);
|
||||
@@ -96,5 +124,38 @@ namespace PWAPPv2.Source.DataObjects
|
||||
return ImagePath.Substring(ImagePath.LastIndexOf("\\") + 1);
|
||||
}
|
||||
|
||||
public string GetJsonContents()
|
||||
{
|
||||
string str = "'Base64FileContents':'" + GetBase64String() + "',\n" +
|
||||
"'Base64ThumbContents':'" + GetBase64ThumbString() + "',\n" +
|
||||
"'Base64ZoomContents':'" + GetBase64ZoomString() + "'\n";
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
public List<PWFileUpload> GetFileUploads(string attToken, string ContentId)
|
||||
{
|
||||
List<PWFileUpload> fileUploads = new List<PWFileUpload>();
|
||||
PWFileUpload baseImage = new PWFileUpload();
|
||||
baseImage.ContentId = ContentId;
|
||||
baseImage.Base64Content = GetBase64String();
|
||||
baseImage.AttToken = attToken;
|
||||
|
||||
PWFileUpload zoom = new PWFileUpload();
|
||||
zoom.Base64Content = GetBase64ZoomString();
|
||||
zoom.ContentId = ContentId;
|
||||
zoom.Tag = "_zoom";
|
||||
zoom.AttToken = attToken;
|
||||
|
||||
PWFileUpload thumb = new PWFileUpload();
|
||||
thumb.Base64Content= GetBase64ThumbString();
|
||||
thumb.ContentId = ContentId;
|
||||
thumb.Tag = "_th";
|
||||
thumb.AttToken = attToken;
|
||||
fileUploads.Add(baseImage);
|
||||
fileUploads.Add(zoom);
|
||||
fileUploads.Add(thumb);
|
||||
return fileUploads;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
43
PWAPPv2/Source/DataObjects/PWPdf.cs
Normal file
43
PWAPPv2/Source/DataObjects/PWPdf.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using PWAPPv2.Source.Attachments;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PWAPPv2.Source.DataObjects
|
||||
{
|
||||
public class PWPdf : PWFile
|
||||
{
|
||||
public string path;
|
||||
|
||||
|
||||
public PWPdf(string path)
|
||||
{
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
public string GetBase64String()
|
||||
{
|
||||
byte[] bytes = File.ReadAllBytes(path);
|
||||
return Convert.ToBase64String(bytes);
|
||||
}
|
||||
|
||||
public List<PWFileUpload> GetFileUploads(string attToken, string ContentId)
|
||||
{
|
||||
List<PWFileUpload> fileUploads = new List<PWFileUpload>();
|
||||
PWFileUpload file = new PWFileUpload();
|
||||
file.Base64Content = GetBase64String();
|
||||
file.ContentId = ContentId;
|
||||
file.AttToken = attToken;
|
||||
fileUploads.Add(file);
|
||||
return fileUploads;
|
||||
}
|
||||
|
||||
public string ShortFileName()
|
||||
{
|
||||
return path.Substring(path.LastIndexOf("\\") + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,13 @@ namespace PWAPPv2.Source
|
||||
public string Email;
|
||||
|
||||
|
||||
public static Patient GetPatient(Database.DatabaseConnection connection, string patNum)
|
||||
{
|
||||
Patient patient = new Patient();
|
||||
patient.BuildFromDatabase(connection, patNum);
|
||||
return patient;
|
||||
}
|
||||
|
||||
public void BuildFromDatabase(Database.DatabaseConnection databaseConnection, string patNum)
|
||||
{
|
||||
List<string> result = databaseConnection.QueryDatabase("SELECT PatNum, LName, FName, MiddleI, Gender, Birthdate," +
|
||||
@@ -1,33 +1,37 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Azure.Core" version="1.25.0" targetFramework="net472" />
|
||||
<package id="Azure.Identity" version="1.7.0" targetFramework="net472" />
|
||||
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.9" targetFramework="net472" />
|
||||
<package id="Azure.Core" version="1.37.0" targetFramework="net472" />
|
||||
<package id="Azure.Identity" version="1.10.4" targetFramework="net472" />
|
||||
<package id="Microsoft.AspNet.WebApi.Client" version="6.0.0" targetFramework="net472" />
|
||||
<package id="Microsoft.Bcl" version="1.1.10" targetFramework="net472" />
|
||||
<package id="Microsoft.Bcl.AsyncInterfaces" version="7.0.0" targetFramework="net472" />
|
||||
<package id="Microsoft.Bcl.AsyncInterfaces" version="8.0.0" targetFramework="net472" />
|
||||
<package id="Microsoft.Bcl.Build" version="1.0.21" targetFramework="net472" />
|
||||
<package id="Microsoft.Data.SqlClient" version="5.1.1" targetFramework="net472" />
|
||||
<package id="Microsoft.Data.SqlClient.SNI" version="5.1.0" targetFramework="net472" />
|
||||
<package id="Microsoft.Identity.Client" version="4.47.2" targetFramework="net472" />
|
||||
<package id="Microsoft.Identity.Client.Extensions.Msal" version="2.19.3" targetFramework="net472" />
|
||||
<package id="Microsoft.IdentityModel.Abstractions" version="6.24.0" targetFramework="net472" />
|
||||
<package id="Microsoft.IdentityModel.JsonWebTokens" version="6.24.0" targetFramework="net472" />
|
||||
<package id="Microsoft.IdentityModel.Logging" version="6.24.0" targetFramework="net472" />
|
||||
<package id="Microsoft.IdentityModel.Protocols" version="6.24.0" targetFramework="net472" />
|
||||
<package id="Microsoft.IdentityModel.Protocols.OpenIdConnect" version="6.24.0" targetFramework="net472" />
|
||||
<package id="Microsoft.IdentityModel.Tokens" version="6.24.0" targetFramework="net472" />
|
||||
<package id="Microsoft.Data.SqlClient" version="5.1.4" targetFramework="net472" />
|
||||
<package id="Microsoft.Data.SqlClient.SNI" version="5.1.1" targetFramework="net472" />
|
||||
<package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="8.0.0" targetFramework="net472" />
|
||||
<package id="Microsoft.Extensions.Logging.Abstractions" version="8.0.0" targetFramework="net472" />
|
||||
<package id="Microsoft.Identity.Client" version="4.58.1" targetFramework="net472" />
|
||||
<package id="Microsoft.Identity.Client.Extensions.Msal" version="4.58.1" targetFramework="net472" />
|
||||
<package id="Microsoft.IdentityModel.Abstractions" version="7.2.0" targetFramework="net472" />
|
||||
<package id="Microsoft.IdentityModel.JsonWebTokens" version="7.2.0" targetFramework="net472" />
|
||||
<package id="Microsoft.IdentityModel.Logging" version="7.2.0" targetFramework="net472" />
|
||||
<package id="Microsoft.IdentityModel.Protocols" version="7.2.0" targetFramework="net472" />
|
||||
<package id="Microsoft.IdentityModel.Protocols.OpenIdConnect" version="7.2.0" targetFramework="net472" />
|
||||
<package id="Microsoft.IdentityModel.Tokens" version="7.2.0" targetFramework="net472" />
|
||||
<package id="Microsoft.Net.Http" version="2.2.29" targetFramework="net472" />
|
||||
<package id="MySqlConnector" version="2.2.7" targetFramework="net472" />
|
||||
<package id="MySqlConnector" version="2.3.4" targetFramework="net472" />
|
||||
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net472" />
|
||||
<package id="Newtonsoft.Json.Bson" version="1.0.2" targetFramework="net472" />
|
||||
<package id="System.Buffers" version="4.5.1" targetFramework="net472" />
|
||||
<package id="System.Configuration.ConfigurationManager" version="6.0.1" targetFramework="net472" />
|
||||
<package id="System.Diagnostics.DiagnosticSource" version="6.0.0" targetFramework="net472" />
|
||||
<package id="System.IdentityModel.Tokens.Jwt" version="6.24.0" targetFramework="net472" />
|
||||
<package id="System.Configuration.ConfigurationManager" version="8.0.0" targetFramework="net472" />
|
||||
<package id="System.Diagnostics.DiagnosticSource" version="8.0.0" targetFramework="net472" />
|
||||
<package id="System.IdentityModel.Tokens.Jwt" version="7.2.0" targetFramework="net472" />
|
||||
<package id="System.IO" version="4.3.0" targetFramework="net472" />
|
||||
<package id="System.IO.FileSystem.AccessControl" version="5.0.0" targetFramework="net472" />
|
||||
<package id="System.Memory" version="4.5.5" targetFramework="net472" />
|
||||
<package id="System.Memory.Data" version="1.0.2" targetFramework="net472" />
|
||||
<package id="System.Memory.Data" version="8.0.0" targetFramework="net472" />
|
||||
<package id="System.Net.Http" version="4.3.4" targetFramework="net472" />
|
||||
<package id="System.Net.Http.Json" version="7.0.1" targetFramework="net472" />
|
||||
<package id="System.Net.Http.Json" version="8.0.0" targetFramework="net472" />
|
||||
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" />
|
||||
<package id="System.Runtime" version="4.3.1" targetFramework="net472" />
|
||||
<package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net472" />
|
||||
@@ -36,13 +40,13 @@
|
||||
<package id="System.Security.Cryptography.Algorithms" version="4.3.1" targetFramework="net472" />
|
||||
<package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net472" />
|
||||
<package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net472" />
|
||||
<package id="System.Security.Cryptography.ProtectedData" version="4.7.0" targetFramework="net472" />
|
||||
<package id="System.Security.Cryptography.ProtectedData" version="8.0.0" targetFramework="net472" />
|
||||
<package id="System.Security.Cryptography.X509Certificates" version="4.3.2" targetFramework="net472" />
|
||||
<package id="System.Security.Permissions" version="6.0.0" targetFramework="net472" />
|
||||
<package id="System.Security.Permissions" version="8.0.0" targetFramework="net472" />
|
||||
<package id="System.Security.Principal.Windows" version="5.0.0" targetFramework="net472" />
|
||||
<package id="System.Text.Encoding" version="4.3.0" targetFramework="net472" />
|
||||
<package id="System.Text.Encodings.Web" version="7.0.0" targetFramework="net472" />
|
||||
<package id="System.Text.Json" version="7.0.3" targetFramework="net472" />
|
||||
<package id="System.Text.Encodings.Web" version="8.0.0" targetFramework="net472" />
|
||||
<package id="System.Text.Json" version="8.0.1" targetFramework="net472" />
|
||||
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" />
|
||||
<package id="System.ValueTuple" version="4.5.0" targetFramework="net472" />
|
||||
</packages>
|
||||
@@ -20,6 +20,7 @@ namespace PWAppUpdater2
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
Directory.SetCurrentDirectory("C:\\PWAPP");
|
||||
label1.Text = "Updating.... Please wait.";
|
||||
label1.Update();
|
||||
progressBar1.Maximum = 8;
|
||||
@@ -27,7 +28,7 @@ namespace PWAppUpdater2
|
||||
button1.Enabled = false;
|
||||
try
|
||||
{
|
||||
PWAppUpdater.Updater.Update("C:\\PWAPP\\App\\", progressBar1, StepInfo, "C:\\PWAPP\\Temp\\");
|
||||
PWAppUpdater.Updater.Update("C:\\PWAPP\\App", progressBar1, StepInfo, "C:\\PWAPP\\Temp");
|
||||
}
|
||||
catch (NoAuthException)
|
||||
{
|
||||
|
||||
@@ -38,10 +38,6 @@ namespace PWAppUpdater
|
||||
progress.PerformStep();
|
||||
stepInfo.Text = "Removing old installation...";
|
||||
stepInfo.Update();
|
||||
if (Directory.Exists(installPath))
|
||||
{
|
||||
Directory.Delete(installPath, true);
|
||||
}
|
||||
progress.PerformStep();
|
||||
stepInfo.Text = "Creating new install directory...";
|
||||
stepInfo.Update();
|
||||
|
||||
Reference in New Issue
Block a user