diff --git a/ENI2/ENI2.csproj b/ENI2/ENI2.csproj
index e49f99d9..04a692c9 100644
--- a/ENI2/ENI2.csproj
+++ b/ENI2/ENI2.csproj
@@ -36,8 +36,8 @@
5.4.0.0
true
publish.html
- 2
- 7.2.7.2
+ 3
+ 7.2.7.3
false
true
true
diff --git a/ENI2/EditControls/ChangePasswordDialog.xaml b/ENI2/EditControls/ChangePasswordDialog.xaml
index 318e3a4b..0fc9a191 100644
--- a/ENI2/EditControls/ChangePasswordDialog.xaml
+++ b/ENI2/EditControls/ChangePasswordDialog.xaml
@@ -3,9 +3,10 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:enictrl="clr-namespace:ENI2.Controls"
+ xmlns:enictrl="clr-namespace:ENI2.Controls"
+ xmlns:p="clr-namespace:ENI2.Properties"
mc:Ignorable="d"
- Title="Change password" Height="215" Width="400" Loaded="EditWindowBase_Loaded" Background="AliceBlue">
+ Title="Change password" Height="243" Width="400" Loaded="EditWindowBase_Loaded" Background="AliceBlue">
@@ -13,6 +14,7 @@
+
@@ -20,14 +22,16 @@
-
-
-
+
+
+
-
+
+
+
diff --git a/ENI2/EditControls/ChangePasswordDialog.xaml.cs b/ENI2/EditControls/ChangePasswordDialog.xaml.cs
index 5912bb68..66f0a4a9 100644
--- a/ENI2/EditControls/ChangePasswordDialog.xaml.cs
+++ b/ENI2/EditControls/ChangePasswordDialog.xaml.cs
@@ -4,6 +4,7 @@
using bsmd.database;
using ENI2.Controls;
+using System;
using System.Windows;
using System.Windows.Controls;
@@ -36,43 +37,48 @@ namespace ENI2.EditControls
{
bool success = false;
string message = "";
- if(!textBoxOldPassword.Password.IsNullOrEmpty())
+ if (!textBoxOldPassword.Password.IsNullOrEmpty() || !textBoxNew1Password.Password.IsNullOrEmpty() || !textBoxNew2Password.Password.IsNullOrEmpty())
{
- if(CurrentUser.GetHash(textBoxOldPassword.Password).Equals(CurrentUser.PasswordHash))
+ if (!textBoxOldPassword.Password.IsNullOrEmpty())
{
- if(textBoxNew1Password.Password.IsNullOrEmpty() ||
- textBoxNew2Password.Password.IsNullOrEmpty() ||
- !textBoxNew1Password.Password.Equals(textBoxNew2Password.Password))
+ if (CurrentUser.GetHash(textBoxOldPassword.Password).Equals(CurrentUser.PasswordHash))
{
- message = "New passwords are empty or do not match";
- }
- else
- {
- if (textBoxOldPassword.Password.Equals(textBoxNew1Password.Password))
+ if (textBoxNew1Password.Password.IsNullOrEmpty() ||
+ textBoxNew2Password.Password.IsNullOrEmpty() ||
+ !textBoxNew1Password.Password.Equals(textBoxNew2Password.Password))
{
- message = "Old and new password are the same";
+ message = "New passwords are empty or do not match";
}
else
{
- CurrentUser.SetPassword(textBoxNew1Password.Password);
- DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(CurrentUser);
- success = true;
+ if (textBoxOldPassword.Password.Equals(textBoxNew1Password.Password))
+ {
+ message = "Old and new password are the same";
+ }
+ else
+ {
+ CurrentUser.SetPassword(textBoxNew1Password.Password);
+ success = true;
+ }
}
}
- }
+ else
+ {
+ message = "Old password is not correct";
+ }
+ }
else
{
- message = "Old password is not correct";
+ message = "Old password empty";
}
- }
- else
- {
- message = "Old password empty";
+ if (!success)
+ MessageBox.Show(message, "Changing password failed", MessageBoxButton.OK, MessageBoxImage.Error);
+ else
+ MessageBox.Show("Password successfully changed.", "Password changed", MessageBoxButton.OK, MessageBoxImage.Information);
}
- if (!success)
- MessageBox.Show(message, "Changing password failed", MessageBoxButton.OK, MessageBoxImage.Error);
- else
- MessageBox.Show("Password successfully changed.", "Password changed", MessageBoxButton.OK, MessageBoxImage.Information);
+ // user may have changed combobox default display value so we are saving anyway here
+ this.CurrentUser.ShipcallDisplayMode = (ReportingParty.ShipcallDisplayModeEnum)Enum.Parse(typeof(ReportingParty.ShipcallDisplayModeEnum), (string)this.comboBoxDefaultDisplay.SelectedValue);
+ DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(CurrentUser);
}
private void EditWindowBase_Loaded(object sender, RoutedEventArgs e)
@@ -82,6 +88,8 @@ namespace ENI2.EditControls
this.OkVisible = false;
var cancelButton = (Button)Template.FindName("buttonCancel", this);
cancelButton.Content = "Close";
+ this.comboBoxDefaultDisplay.ItemsSource = Util.EnumHelper.GetAllValuesAndDescription(typeof(ReportingParty.ShipcallDisplayModeEnum));
+ this.comboBoxDefaultDisplay.SelectedValue = this.CurrentUser.ShipcallDisplayMode;
}
#endregion
diff --git a/ENI2/EditControls/EditReportingPartyDialog.xaml b/ENI2/EditControls/EditReportingPartyDialog.xaml
index 86de7479..8b288bc5 100644
--- a/ENI2/EditControls/EditReportingPartyDialog.xaml
+++ b/ENI2/EditControls/EditReportingPartyDialog.xaml
@@ -48,7 +48,7 @@
-
+
@@ -69,7 +69,6 @@
-
diff --git a/ENI2/EditControls/EditReportingPartyDialog.xaml.cs b/ENI2/EditControls/EditReportingPartyDialog.xaml.cs
index 5ed5889d..decbd299 100644
--- a/ENI2/EditControls/EditReportingPartyDialog.xaml.cs
+++ b/ENI2/EditControls/EditReportingPartyDialog.xaml.cs
@@ -25,7 +25,7 @@ namespace ENI2.EditControls
private void EditReportingPartyDialog_Loaded(object sender, RoutedEventArgs e)
{
- this.comboBoxDefaultDisplay.ItemsSource = Util.EnumHelper.GetAllValuesAndDescription(typeof(ReportingParty.ShipcallDisplayModeEnum));
+
this.textBoxCity.Text = this.ReportingParty.City;
this.textBoxCountry.Text = this.ReportingParty.Country;
this.textBoxEMail.Text = this.ReportingParty.EMail;
@@ -42,7 +42,7 @@ namespace ENI2.EditControls
this.checkBoxAdministrator.IsChecked = this.ReportingParty.IsAdmin;
this.checkBoxArchived.IsChecked = this.ReportingParty.IsArchived;
this.checkBoxEditor.IsChecked = this.ReportingParty.IsEditor;
- this.comboBoxDefaultDisplay.SelectedValue = this.ReportingParty.ShipcallDisplayMode;
+
this.dateTimePickerChanged.Content = this.ReportingParty.Changed.HasValue ? this.ReportingParty.Changed.ToString() : "";
this.dateTimePickerCreated.Content = this.ReportingParty.Created.HasValue ? this.ReportingParty.Created.ToString() : "";
@@ -64,8 +64,7 @@ namespace ENI2.EditControls
this.ReportingParty.PostalCode = this.textBoxPostalCode.Text.Trim();
this.ReportingParty.StreetAndNumber = this.textBoxStreetNumber.Text.Trim();
this.ReportingParty.UserEMail = this.textBoxUserEMail.Text.Trim();
- this.ReportingParty.Logon = this.textBoxUserLogon.Text.Trim();
- this.ReportingParty.ShipcallDisplayMode = (ReportingParty.ShipcallDisplayModeEnum) Enum.Parse(typeof(ReportingParty.ShipcallDisplayModeEnum), (string) this.comboBoxDefaultDisplay.SelectedValue);
+ this.ReportingParty.Logon = this.textBoxUserLogon.Text.Trim();
if(!this.passwordBoxPassword.Password.IsNullOrEmpty())
{
diff --git a/ENI2/Properties/Resources.Designer.cs b/ENI2/Properties/Resources.Designer.cs
index c4e05a3c..10b436c9 100644
--- a/ENI2/Properties/Resources.Designer.cs
+++ b/ENI2/Properties/Resources.Designer.cs
@@ -4188,6 +4188,15 @@ namespace ENI2.Properties {
}
}
+ ///
+ /// Looks up a localized string similar to New password.
+ ///
+ public static string textNewPassword {
+ get {
+ return ResourceManager.GetString("textNewPassword", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Create new id.
///
@@ -4323,6 +4332,15 @@ namespace ENI2.Properties {
}
}
+ ///
+ /// Looks up a localized string similar to Old password.
+ ///
+ public static string textOldPassword {
+ get {
+ return ResourceManager.GetString("textOldPassword", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to This only works if the grid is empty!.
///
@@ -4989,6 +5007,15 @@ namespace ENI2.Properties {
}
}
+ ///
+ /// Looks up a localized string similar to Repeat new password.
+ ///
+ public static string textRepeatNewPassword {
+ get {
+ return ResourceManager.GetString("textRepeatNewPassword", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Reporting party.
///
diff --git a/ENI2/Properties/Resources.resx b/ENI2/Properties/Resources.resx
index 3c31bdc3..87000ee2 100644
--- a/ENI2/Properties/Resources.resx
+++ b/ENI2/Properties/Resources.resx
@@ -2218,4 +2218,13 @@
4 Tanker
+
+ New password
+
+
+ Old password
+
+
+ Repeat new password
+
\ No newline at end of file
diff --git a/ENI2/SheetDisplayControls/PreArrivalControl.xaml b/ENI2/SheetDisplayControls/PreArrivalControl.xaml
index 0f814f33..66ed2200 100644
--- a/ENI2/SheetDisplayControls/PreArrivalControl.xaml
+++ b/ENI2/SheetDisplayControls/PreArrivalControl.xaml
@@ -51,7 +51,7 @@
-
+
diff --git a/ENI2/SheetDisplayControls/PreDepartureControl.xaml.cs b/ENI2/SheetDisplayControls/PreDepartureControl.xaml.cs
index bdba1394..e7590828 100644
--- a/ENI2/SheetDisplayControls/PreDepartureControl.xaml.cs
+++ b/ENI2/SheetDisplayControls/PreDepartureControl.xaml.cs
@@ -69,7 +69,7 @@ namespace ENI2.SheetDisplayControls
// 4.3
this.dataGridBKRD.Initialize();
- this.dataGridBKRD.ItemsSource = this._brkaMessage.Elements;
+ this.dataGridBKRD.ItemsSource = this._brkdMessage.Elements;
this.dataGridBKRD.AddingNewItem += DataGridBKRD_AddingNewItem;
this.dataGridBKRD.EditRequested += DataGridBKRD_EditRequested;
this.dataGridBKRD.DeleteRequested += DataGridBKRD_DeleteRequested;