Feedback LucP

This commit is contained in:
Luc Vandenbroucke 2019-02-21 15:20:39 +01:00
parent 8de35a5b7a
commit 41f1d36927
5 changed files with 52 additions and 21 deletions

View file

@ -406,8 +406,14 @@ namespace eDosStation
private void Starter()
{
a = new OkReadBadge.Badging(Msg);
a.Start();
try
{
a = new OkReadBadge.Badging(Msg);
a.Start();
} catch (System.Exception ex)
{
MessageBox.Show($"Badgereader error {ex.Message}", "Error", MessageBoxButton.OK, MessageBoxImage.Exclamation);
}
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
@ -447,7 +453,12 @@ namespace eDosStation
{
////Debug
_User = new User(TestCSN, string.Empty);
Dispatcher.InvokeAsync(AskTask);
if (_User.Error > 0)
{
MessageBox.Show(_User.ErrorMessage, "DB Error", MessageBoxButton.OK, MessageBoxImage.Exclamation);
} else {
Dispatcher.InvokeAsync(AskTask);
}
}
}
}

View file

@ -97,9 +97,7 @@ namespace eDosStation
{
statusEPD.Content = $"Search Timeout";
}
}
}
private void Window_Unloaded(object sender, RoutedEventArgs e)

View file

@ -20,6 +20,9 @@ namespace eDosStation
public bool? VisitIDLocked {get;set; }
public int Error = 0;
public string ErrorMessage;
public User(string CSN, string Code)
{
LastName = FirstName = conCode = Language = string.Empty;
@ -32,23 +35,31 @@ namespace eDosStation
cmd.Parameters.AddWithValue("csn", CSN);
if (!string.IsNullOrWhiteSpace(Code)) cmd.Parameters.AddWithValue("Badge", Code);
co.Open();
var rs = cmd.ExecuteReader(System.Data.CommandBehavior.SingleRow);
if (rs.HasRows && rs.Read())
try
{
object[] Values = new object[rs.FieldCount];
int rv = rs.GetValues(Values);
PersID = (int)Values[rs.GetOrdinal("PersID")];
LastName = Values[rs.GetOrdinal("LastName")].ToString();
FirstName = Values[rs.GetOrdinal("FirstName")].ToString();
conCode = Values[rs.GetOrdinal("conCode")].ToString();
Language = Values[rs.GetOrdinal("Language")].ToString();
AccessAllow = Values[rs.GetOrdinal("AccessAllow")] as bool?;
Margin = Values[rs.GetOrdinal("AccessAllow")] as double?;
VisitIDLocked = Values[rs.GetOrdinal("VisitIDLocked")] as bool?;
var rs = cmd.ExecuteReader(System.Data.CommandBehavior.SingleRow);
if (rs.HasRows && rs.Read())
{
object[] Values = new object[rs.FieldCount];
int rv = rs.GetValues(Values);
PersID = (int)Values[rs.GetOrdinal("PersID")];
LastName = Values[rs.GetOrdinal("LastName")].ToString();
FirstName = Values[rs.GetOrdinal("FirstName")].ToString();
conCode = Values[rs.GetOrdinal("conCode")].ToString();
Language = Values[rs.GetOrdinal("Language")].ToString();
AccessAllow = Values[rs.GetOrdinal("AccessAllow")] as bool?;
Margin = Values[rs.GetOrdinal("AccessAllow")] as double?;
VisitIDLocked = Values[rs.GetOrdinal("VisitIDLocked")] as bool?;
}
rs.Close();
} catch(System.Exception ex)
{
Error = 1;
ErrorMessage = ex.Message;
}
rs.Close();
co.Close();
co.Close();
}
}

View file

@ -18,7 +18,7 @@
<PublishUrl>\\scksrv1\sckcen\DOKUMENT\idpbw\TOESTELLEN\REMSnew\eDosStation\</PublishUrl>
<Install>true</Install>
<InstallFrom>Unc</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateEnabled>true</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
@ -27,7 +27,7 @@
<MapFileExtensions>true</MapFileExtensions>
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>publish.htm</WebPage>
<ApplicationRevision>1</ApplicationRevision>
<ApplicationRevision>4</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
@ -202,6 +202,9 @@
<DependentUpon>DataSet1.xsd</DependentUpon>
</None>
<None Include="eDosStation_TemporaryKey.pfx" />
<None Include="LOG.INI">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
@ -236,5 +239,10 @@
<Resource Include="Images\EPD-MK2.png" />
<Resource Include="Images\EPD-N2.png" />
</ItemGroup>
<ItemGroup>
<Content Include="IR_READER_MS_DLL.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View file

@ -13,4 +13,7 @@
<FallbackCulture>en-US</FallbackCulture>
<VerifyUploadedFiles>false</VerifyUploadedFiles>
</PropertyGroup>
<PropertyGroup>
<EnableSecurityDebugging>false</EnableSecurityDebugging>
</PropertyGroup>
</Project>