diff --git a/PWAPPv2/App.xaml.cs b/PWAPPv2/App.xaml.cs index 1f66738..7e80dca 100644 --- a/PWAPPv2/App.xaml.cs +++ b/PWAPPv2/App.xaml.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Configuration; -using System.Data; -using System.Linq; -using System.Threading.Tasks; -using System.Windows; +using System.Windows; namespace PWAPPv2 { @@ -16,7 +10,7 @@ namespace PWAPPv2 public static string[] Args; void app_Startup(object sender, StartupEventArgs e) { - if(e.Args.Length > 0) + if (e.Args.Length > 0) { Args = e.Args; } diff --git a/PWAPPv2/MainWindow.xaml.cs b/PWAPPv2/MainWindow.xaml.cs index 2e7c7ce..6b8c9e0 100644 --- a/PWAPPv2/MainWindow.xaml.cs +++ b/PWAPPv2/MainWindow.xaml.cs @@ -1,19 +1,9 @@ -using System; +using Microsoft.Win32; +using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; -using System.IO; -using Microsoft.Win32; /** * TODO: @@ -49,7 +39,7 @@ namespace PWAPPv2 { args = App.Args; } - catch(Exception) + catch (Exception) { } images = new List(); @@ -122,15 +112,15 @@ namespace PWAPPv2 { TypeBox.GetSelectedID(); } - catch(Source.DataObjects.ReferralTypeDefaultException) + catch (Source.DataObjects.ReferralTypeDefaultException) { } - catch(Source.DataObjects.InvalidReferralTypeException) + catch (Source.DataObjects.InvalidReferralTypeException) { } - catch(NullReferenceException) + catch (NullReferenceException) { } @@ -141,12 +131,12 @@ namespace PWAPPv2 { this.Close(); } - + //OK Button private void Button_Click_1(object sender, RoutedEventArgs e) { Source.DataObjects.Referral referral; - if(images.Count == 0) + if (images.Count == 0) { referral = new Source.DataObjects.Referral(apiCreds, patient, (Source.DataObjects.ReferralTypeBox)TypeBox, @@ -167,9 +157,9 @@ namespace PWAPPv2 { string referralString = referral.ToJsonString(); string result = apiConnection.SendPostRequestAsync("api/PWMakeReferral", referralString); - if(images.Count > 0) + if (images.Count > 0) { - foreach(Source.DataObjects.PWImage im in images) + foreach (Source.DataObjects.PWImage im in images) { Source.DataObjects.Attachment att = new Source.DataObjects.Attachment(apiCreds, im, result); string json = att.ToJsonString(); @@ -183,7 +173,7 @@ namespace PWAPPv2 } this.Close(); } - catch(Source.DataObjects.Referral.InvalidReferalDataException) + catch (Source.DataObjects.Referral.InvalidReferalDataException) { } @@ -197,7 +187,7 @@ namespace PWAPPv2 openFileDialog.Filter = "Image files (*.jpg,*.jpeg)|*.jpg;*.jpeg"; openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures); - if(openFileDialog.ShowDialog() == true) + if (openFileDialog.ShowDialog() == true) { foreach (string filename in openFileDialog.FileNames) { @@ -205,7 +195,7 @@ namespace PWAPPv2 { images.Add(new Source.DataObjects.PWImage(filename)); } - catch(NullReferenceException) + catch (NullReferenceException) { images = new List(); images.Add(new Source.DataObjects.PWImage(filename)); @@ -222,7 +212,7 @@ namespace PWAPPv2 ImageList.Items.Add(CreateImageGridItem(image)); } } - catch(NullReferenceException) + catch (NullReferenceException) { } } @@ -230,7 +220,7 @@ namespace PWAPPv2 private void Button_Click_3(object sender, RoutedEventArgs e) { int index = ImageList.SelectedIndex; - if(index == -1) + if (index == -1) { return; } diff --git a/PWAPPv2/PWAPPv2.csproj b/PWAPPv2/PWAPPv2.csproj index 5f2858b..c100bc5 100644 --- a/PWAPPv2/PWAPPv2.csproj +++ b/PWAPPv2/PWAPPv2.csproj @@ -210,7 +210,6 @@ MSBuild:Compile Designer - diff --git a/PWAPPv2/Properties/AssemblyInfo.cs b/PWAPPv2/Properties/AssemblyInfo.cs index aef6f17..2318293 100644 --- a/PWAPPv2/Properties/AssemblyInfo.cs +++ b/PWAPPv2/Properties/AssemblyInfo.cs @@ -1,6 +1,4 @@ using System.Reflection; -using System.Resources; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Windows; diff --git a/PWAPPv2/PwImage.cs b/PWAPPv2/PwImage.cs deleted file mode 100644 index 6b5f444..0000000 --- a/PWAPPv2/PwImage.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace PWAPPv2 -{ - internal class PwImage - { - } -} \ No newline at end of file diff --git a/PWAPPv2/Source/API/APIConfig.cs b/PWAPPv2/Source/API/APIConfig.cs index 6d6eb52..6c11bce 100644 --- a/PWAPPv2/Source/API/APIConfig.cs +++ b/PWAPPv2/Source/API/APIConfig.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Xml; namespace PWAPPv2.Source @@ -21,12 +17,12 @@ namespace PWAPPv2.Source { cfgDoc.Load(path); } - catch(XmlException) + catch (XmlException) { Console.WriteLine("An error has occured parsing the config file."); return; } - catch(System.IO.FileNotFoundException) + catch (System.IO.FileNotFoundException) { Console.WriteLine("Config file could not be found!"); return; diff --git a/PWAPPv2/Source/API/APIConnection.cs b/PWAPPv2/Source/API/APIConnection.cs index 2efb4e5..fe6038c 100644 --- a/PWAPPv2/Source/API/APIConnection.cs +++ b/PWAPPv2/Source/API/APIConnection.cs @@ -1,13 +1,9 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.IO; using System.Net; using System.Net.Http; using System.Net.Http.Headers; -using System.IO; -using Newtonsoft.Json; +using System.Text; namespace PWAPPv2.Source.API { @@ -82,7 +78,7 @@ namespace PWAPPv2.Source.API text = sr.ReadToEnd(); } } - catch(WebException wex) + catch (WebException wex) { text = new StreamReader(wex.Response.GetResponseStream()).ReadToEnd(); } @@ -100,7 +96,7 @@ namespace PWAPPv2.Source.API var response = client.PostAsync(apiUri, contetnt).Result; - if(response.IsSuccessStatusCode) + if (response.IsSuccessStatusCode) { return response.Content.ReadAsStringAsync().Result; } diff --git a/PWAPPv2/Source/API/APIRequestBuilder.cs b/PWAPPv2/Source/API/APIRequestBuilder.cs index 48da6aa..692c885 100644 --- a/PWAPPv2/Source/API/APIRequestBuilder.cs +++ b/PWAPPv2/Source/API/APIRequestBuilder.cs @@ -1,11 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Xml; -using System.Xml.Serialization; -using Newtonsoft.Json; +using Newtonsoft.Json; +using System; namespace PWAPPv2.Source.API { diff --git a/PWAPPv2/Source/DataObjects/APICredentials.cs b/PWAPPv2/Source/DataObjects/APICredentials.cs index c90a014..5df1277 100644 --- a/PWAPPv2/Source/DataObjects/APICredentials.cs +++ b/PWAPPv2/Source/DataObjects/APICredentials.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace PWAPPv2.Source.DataObjects +namespace PWAPPv2.Source.DataObjects { class APICredentials { diff --git a/PWAPPv2/Source/DataObjects/Attachment.cs b/PWAPPv2/Source/DataObjects/Attachment.cs index 2ef9eec..3c516c7 100644 --- a/PWAPPv2/Source/DataObjects/Attachment.cs +++ b/PWAPPv2/Source/DataObjects/Attachment.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace PWAPPv2.Source.DataObjects +namespace PWAPPv2.Source.DataObjects { class Attachment { diff --git a/PWAPPv2/Source/DataObjects/ComboBoxData.cs b/PWAPPv2/Source/DataObjects/ComboBoxData.cs index 70f7736..f424081 100644 --- a/PWAPPv2/Source/DataObjects/ComboBoxData.cs +++ b/PWAPPv2/Source/DataObjects/ComboBoxData.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; +using System.Windows.Controls; namespace PWAPPv2.Source.DataObjects { diff --git a/PWAPPv2/Source/DataObjects/Exceptions.cs b/PWAPPv2/Source/DataObjects/Exceptions.cs index cf5bb7b..f2bf798 100644 --- a/PWAPPv2/Source/DataObjects/Exceptions.cs +++ b/PWAPPv2/Source/DataObjects/Exceptions.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace PWAPPv2.Source.DataObjects { diff --git a/PWAPPv2/Source/DataObjects/NumValList.cs b/PWAPPv2/Source/DataObjects/NumValList.cs index d63cf08..8211398 100644 --- a/PWAPPv2/Source/DataObjects/NumValList.cs +++ b/PWAPPv2/Source/DataObjects/NumValList.cs @@ -1,8 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace PWAPPv2.Source.DataObjects { @@ -18,11 +15,11 @@ namespace PWAPPv2.Source.DataObjects public NumValList(string Content, char Delim) { string[] split = Content.Split(Delim); - if((split.Length % 2) != 0) + if ((split.Length % 2) != 0) { throw new UnevenValuesException(); } - for(int i = 0; i < split.Length; i++) + for (int i = 0; i < split.Length; i++) { this.Add(int.Parse(split[i]), split[i + 1]); i++; diff --git a/PWAPPv2/Source/DataObjects/NumValPair.cs b/PWAPPv2/Source/DataObjects/NumValPair.cs index f6bc7bd..5628a32 100644 --- a/PWAPPv2/Source/DataObjects/NumValPair.cs +++ b/PWAPPv2/Source/DataObjects/NumValPair.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace PWAPPv2.Source.DataObjects +namespace PWAPPv2.Source.DataObjects { class NumValPair { diff --git a/PWAPPv2/Source/DataObjects/PWImage.cs b/PWAPPv2/Source/DataObjects/PWImage.cs index 30ad628..2f5ce19 100644 --- a/PWAPPv2/Source/DataObjects/PWImage.cs +++ b/PWAPPv2/Source/DataObjects/PWImage.cs @@ -1,12 +1,7 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Media.Imaging; -using System.Windows.Media; using System.Drawing; using System.IO; +using System.Windows.Media.Imaging; namespace PWAPPv2.Source.DataObjects { diff --git a/PWAPPv2/Source/DataObjects/ReferFromBox.cs b/PWAPPv2/Source/DataObjects/ReferFromBox.cs index b0128ff..742472c 100644 --- a/PWAPPv2/Source/DataObjects/ReferFromBox.cs +++ b/PWAPPv2/Source/DataObjects/ReferFromBox.cs @@ -1,9 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; using System.Windows.Controls; namespace PWAPPv2.Source.DataObjects diff --git a/PWAPPv2/Source/DataObjects/ReferToBox.cs b/PWAPPv2/Source/DataObjects/ReferToBox.cs index 73c8d37..5267970 100644 --- a/PWAPPv2/Source/DataObjects/ReferToBox.cs +++ b/PWAPPv2/Source/DataObjects/ReferToBox.cs @@ -1,9 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; using System.Windows.Controls; namespace PWAPPv2.Source.DataObjects diff --git a/PWAPPv2/Source/DataObjects/Referral.cs b/PWAPPv2/Source/DataObjects/Referral.cs index 9a5458a..c361c74 100644 --- a/PWAPPv2/Source/DataObjects/Referral.cs +++ b/PWAPPv2/Source/DataObjects/Referral.cs @@ -1,11 +1,7 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Windows; using System.Windows.Controls; using System.Windows.Documents; -using System.Windows; namespace PWAPPv2.Source.DataObjects { @@ -40,7 +36,7 @@ namespace PWAPPv2.Source.DataObjects string RemarksText = new TextRange(RemarksBox.Document.ContentStart, RemarksBox.Document.ContentEnd).Text; int contact = 0; - if(ContactBox.IsChecked == true) + if (ContactBox.IsChecked == true) { contact = 1; } @@ -76,11 +72,11 @@ namespace PWAPPv2.Source.DataObjects { MessageBox.Show("Please select a referral type"); } - catch(Source.DataObjects.ReferToDefaultException) + catch (Source.DataObjects.ReferToDefaultException) { MessageBox.Show("Please select a refer to"); } - catch(Source.DataObjects.ReferFromDefaultException) + catch (Source.DataObjects.ReferFromDefaultException) { MessageBox.Show("Please select a refer from"); } diff --git a/PWAPPv2/Source/DataObjects/ReferralTypeBox.cs b/PWAPPv2/Source/DataObjects/ReferralTypeBox.cs index 4d5b410..14635d4 100644 --- a/PWAPPv2/Source/DataObjects/ReferralTypeBox.cs +++ b/PWAPPv2/Source/DataObjects/ReferralTypeBox.cs @@ -1,9 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; using System.Windows.Controls; namespace PWAPPv2.Source.DataObjects @@ -28,7 +24,7 @@ namespace PWAPPv2.Source.DataObjects TypeID.Add(id); } - catch(Exception) + catch (Exception) { throw new DataInvalidException(); } @@ -36,7 +32,7 @@ namespace PWAPPv2.Source.DataObjects } - foreach(string name in TypeName) + foreach (string name in TypeName) { Add(name); } @@ -52,9 +48,9 @@ namespace PWAPPv2.Source.DataObjects { throw new ReferralTypeDefaultException(); } - for(int i = 0; i < TypeName.Count; i++) + for (int i = 0; i < TypeName.Count; i++) { - if(TypeName[i] == Selected) + if (TypeName[i] == Selected) { return TypeID[i]; } diff --git a/PWAPPv2/Source/Database/DatabaseConfig.cs b/PWAPPv2/Source/Database/DatabaseConfig.cs index 971b1a7..789b76e 100644 --- a/PWAPPv2/Source/Database/DatabaseConfig.cs +++ b/PWAPPv2/Source/Database/DatabaseConfig.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Xml; namespace PWAPPv2.Source.Database @@ -22,12 +18,12 @@ namespace PWAPPv2.Source.Database { cfg.Load(path); } - catch(XmlException) + catch (XmlException) { Console.WriteLine("An error has occured parsing the config file."); return; } - catch(System.IO.FileNotFoundException) + catch (System.IO.FileNotFoundException) { Console.WriteLine("Config file could not be found!"); } diff --git a/PWAPPv2/Source/Database/DatabaseConnection.cs b/PWAPPv2/Source/Database/DatabaseConnection.cs index 3d26098..c644ca7 100644 --- a/PWAPPv2/Source/Database/DatabaseConnection.cs +++ b/PWAPPv2/Source/Database/DatabaseConnection.cs @@ -1,10 +1,6 @@ -using System; +using MySqlConnector; +using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Microsoft.Data.SqlClient; -using MySqlConnector; namespace PWAPPv2.Source.Database { @@ -28,7 +24,7 @@ namespace PWAPPv2.Source.Database { Connection.Open(); } - catch(Exception) + catch (Exception) { throw new DatabaseConnectionException(); } @@ -99,7 +95,7 @@ namespace PWAPPv2.Source.Database { } - + class DatabaseConnectionException : Exception { } diff --git a/PWAPPv2/Source/Patient.cs b/PWAPPv2/Source/Patient.cs index c46a0da..30f9c4b 100644 --- a/PWAPPv2/Source/Patient.cs +++ b/PWAPPv2/Source/Patient.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Collections.Generic; namespace PWAPPv2.Source { diff --git a/PWAPPv2/Source/PatientGUIAdapter.cs b/PWAPPv2/Source/PatientGUIAdapter.cs index aa6e5cc..3cd9d14 100644 --- a/PWAPPv2/Source/PatientGUIAdapter.cs +++ b/PWAPPv2/Source/PatientGUIAdapter.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace PWAPPv2.Source +namespace PWAPPv2.Source { class PatientGUIAdapter {