diff --git a/EpdBase/x64/Debug/AssemblyInfo.obj b/EpdBase/x64/Debug/AssemblyInfo.obj index ef1378d..9dfb841 100644 Binary files a/EpdBase/x64/Debug/AssemblyInfo.obj and b/EpdBase/x64/Debug/AssemblyInfo.obj differ diff --git a/EpdBase/x64/Debug/EpdBase.log b/EpdBase/x64/Debug/EpdBase.log index 7652a1c..6823ad9 100644 --- a/EpdBase/x64/Debug/EpdBase.log +++ b/EpdBase/x64/Debug/EpdBase.log @@ -1,12 +1,7 @@  stdafx.cpp AssemblyInfo.cpp EpdBase.cpp -c:\l\src\cs\edos\epdbase\timefunctions.h(12): warning C4091: 'static ': ignored on left of 'TimeFunctions' when no variable is declared -c:\l\src\cs\edos\epdbase\epdbase.cpp(95): warning C4244: '=': conversion from 'DWORD' to 'WORD', possible loss of data TimeFunctions.cpp -c:\l\src\cs\edos\epdbase\timefunctions.h(12): warning C4091: 'static ': ignored on left of 'TimeFunctions' when no variable is declared Generating Code... - .NETFramework,Version=v4.7.2.AssemblyAttributes.cpp -.NETFramework,Version=v4.7.2.AssemblyAttributes.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library -AssemblyInfo.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library - EpdBase.vcxproj -> C:\l\src\cs\eDos\x64\Debug\EpdBase.lib + .NETFramework,Version=v4.8.AssemblyAttributes.cpp + EpdBase.vcxproj -> D:\l\src\cs\eDosStation\x64\Debug\EpdBase.lib diff --git a/EpdBase/x64/Debug/EpdBase.obj b/EpdBase/x64/Debug/EpdBase.obj index b1c8f12..738c818 100644 Binary files a/EpdBase/x64/Debug/EpdBase.obj and b/EpdBase/x64/Debug/EpdBase.obj differ diff --git a/EpdBase/x64/Debug/EpdBase.pch b/EpdBase/x64/Debug/EpdBase.pch index e797ad2..12d64c3 100644 Binary files a/EpdBase/x64/Debug/EpdBase.pch and b/EpdBase/x64/Debug/EpdBase.pch differ diff --git a/EpdBase/x64/Debug/EpdBase.tlog/CL.command.1.tlog b/EpdBase/x64/Debug/EpdBase.tlog/CL.command.1.tlog index 028341e..5031f98 100644 Binary files a/EpdBase/x64/Debug/EpdBase.tlog/CL.command.1.tlog and b/EpdBase/x64/Debug/EpdBase.tlog/CL.command.1.tlog differ diff --git a/EpdBase/x64/Debug/EpdBase.tlog/CL.read.1.tlog b/EpdBase/x64/Debug/EpdBase.tlog/CL.read.1.tlog index a29c166..348c7ae 100644 Binary files a/EpdBase/x64/Debug/EpdBase.tlog/CL.read.1.tlog and b/EpdBase/x64/Debug/EpdBase.tlog/CL.read.1.tlog differ diff --git a/EpdBase/x64/Debug/EpdBase.tlog/CL.write.1.tlog b/EpdBase/x64/Debug/EpdBase.tlog/CL.write.1.tlog index d09fe73..93a2b85 100644 Binary files a/EpdBase/x64/Debug/EpdBase.tlog/CL.write.1.tlog and b/EpdBase/x64/Debug/EpdBase.tlog/CL.write.1.tlog differ diff --git a/EpdBase/x64/Debug/EpdBase.tlog/EpdBase.lastbuildstate b/EpdBase/x64/Debug/EpdBase.tlog/EpdBase.lastbuildstate index 8cbd985..599ff38 100644 --- a/EpdBase/x64/Debug/EpdBase.tlog/EpdBase.lastbuildstate +++ b/EpdBase/x64/Debug/EpdBase.tlog/EpdBase.lastbuildstate @@ -1,2 +1,2 @@ -#TargetFrameworkVersion=v4.7.2:PlatformToolSet=v141:EnableManagedIncrementalBuild=true:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.17763.0 -Debug|x64|C:\l\src\cs\eDos\| +PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.29.30133:VCServicingVersionMFC=14.29.30136:VCServicingVersionCrtHeaders=14.29.30136:TargetPlatformVersion=10.0.19041.0:TargetFrameworkVersion=v4.8::EnableManagedIncrementalBuild=true: +Debug|x64|D:\l\src\cs\eDosStation\| diff --git a/EpdBase/x64/Debug/EpdBase.tlog/Lib-link-cvtres.read.1.tlog b/EpdBase/x64/Debug/EpdBase.tlog/Lib-link-cvtres.read.1.tlog index a629493..22a6ee1 100644 Binary files a/EpdBase/x64/Debug/EpdBase.tlog/Lib-link-cvtres.read.1.tlog and b/EpdBase/x64/Debug/EpdBase.tlog/Lib-link-cvtres.read.1.tlog differ diff --git a/EpdBase/x64/Debug/EpdBase.tlog/Lib-link-cvtres.write.1.tlog b/EpdBase/x64/Debug/EpdBase.tlog/Lib-link-cvtres.write.1.tlog index f65e00a..5c481dc 100644 Binary files a/EpdBase/x64/Debug/EpdBase.tlog/Lib-link-cvtres.write.1.tlog and b/EpdBase/x64/Debug/EpdBase.tlog/Lib-link-cvtres.write.1.tlog differ diff --git a/EpdBase/x64/Debug/EpdBase.tlog/Lib.command.1.tlog b/EpdBase/x64/Debug/EpdBase.tlog/Lib.command.1.tlog index 7d71cea..e0dd256 100644 Binary files a/EpdBase/x64/Debug/EpdBase.tlog/Lib.command.1.tlog and b/EpdBase/x64/Debug/EpdBase.tlog/Lib.command.1.tlog differ diff --git a/EpdBase/x64/Debug/EpdBase.tlog/metagen.read.1.tlog b/EpdBase/x64/Debug/EpdBase.tlog/metagen.read.1.tlog index 46b134b..b1e82bb 100644 Binary files a/EpdBase/x64/Debug/EpdBase.tlog/metagen.read.1.tlog and b/EpdBase/x64/Debug/EpdBase.tlog/metagen.read.1.tlog differ diff --git a/EpdBase/x64/Debug/EpdBase.tlog/metagen.write.1.tlog b/EpdBase/x64/Debug/EpdBase.tlog/metagen.write.1.tlog index 46b134b..b6f76a4 100644 Binary files a/EpdBase/x64/Debug/EpdBase.tlog/metagen.write.1.tlog and b/EpdBase/x64/Debug/EpdBase.tlog/metagen.write.1.tlog differ diff --git a/EpdBase/x64/Debug/EpdBase.tlog/rc.command.1.tlog b/EpdBase/x64/Debug/EpdBase.tlog/rc.command.1.tlog index 9bd333f..a8b3697 100644 Binary files a/EpdBase/x64/Debug/EpdBase.tlog/rc.command.1.tlog and b/EpdBase/x64/Debug/EpdBase.tlog/rc.command.1.tlog differ diff --git a/EpdBase/x64/Debug/EpdBase.tlog/rc.read.1.tlog b/EpdBase/x64/Debug/EpdBase.tlog/rc.read.1.tlog index 92e0cab..4fbdfc9 100644 Binary files a/EpdBase/x64/Debug/EpdBase.tlog/rc.read.1.tlog and b/EpdBase/x64/Debug/EpdBase.tlog/rc.read.1.tlog differ diff --git a/EpdBase/x64/Debug/EpdBase.tlog/rc.write.1.tlog b/EpdBase/x64/Debug/EpdBase.tlog/rc.write.1.tlog index 01bac02..7cce73d 100644 Binary files a/EpdBase/x64/Debug/EpdBase.tlog/rc.write.1.tlog and b/EpdBase/x64/Debug/EpdBase.tlog/rc.write.1.tlog differ diff --git a/EpdBase/x64/Debug/TimeFunctions.obj b/EpdBase/x64/Debug/TimeFunctions.obj index dac95d4..b7eab8d 100644 Binary files a/EpdBase/x64/Debug/TimeFunctions.obj and b/EpdBase/x64/Debug/TimeFunctions.obj differ diff --git a/EpdBase/x64/Debug/app.res b/EpdBase/x64/Debug/app.res index bf850e7..0799ef6 100644 Binary files a/EpdBase/x64/Debug/app.res and b/EpdBase/x64/Debug/app.res differ diff --git a/EpdBase/x64/Debug/stdafx.obj b/EpdBase/x64/Debug/stdafx.obj index 36fae4f..371a713 100644 Binary files a/EpdBase/x64/Debug/stdafx.obj and b/EpdBase/x64/Debug/stdafx.obj differ diff --git a/OkReadBadge/OkReadBadge.cpp b/OkReadBadge/OkReadBadge.cpp index a37b33b..887672b 100644 --- a/OkReadBadge/OkReadBadge.cpp +++ b/OkReadBadge/OkReadBadge.cpp @@ -23,7 +23,7 @@ void OkReadBadge::BadgeUnmanaged::GetDeviceUSB(std::wstring vid, std::wstring pi DWORD DeviceInstanceIdSize = 500; DWORD RequiredSize = 0; - WCHAR * DeviceInstanceId = new WCHAR(DeviceInstanceIdSize); + WCHAR * DeviceInstanceId = new WCHAR[DeviceInstanceIdSize]; DeviceType = 0; while (DeviceType == 0 && SetupDiEnumDeviceInfo(deviceInterfaceSet, deviceIndex, &deviceInfoData)) diff --git a/eDosStation/App.xaml b/eDosStation/App.xaml index 9f6b21d..d80ce8c 100644 --- a/eDosStation/App.xaml +++ b/eDosStation/App.xaml @@ -4,10 +4,13 @@ xmlns:local="clr-namespace:eDosStation" StartupUri="MainWindow.xaml" Startup="Application_Startup" > - + + + + diff --git a/eDosStation/DataInterface.cs b/eDosStation/DataInterface.cs index 9fc0daa..a4ad198 100644 --- a/eDosStation/DataInterface.cs +++ b/eDosStation/DataInterface.cs @@ -356,40 +356,48 @@ namespace eDosStation //if (!string.IsNullOrWhiteSpace(Code)) cmd.Parameters.AddWithValue("Badge", Code); checkCon(true); var rs = cmd.ExecuteReader(System.Data.CommandBehavior.SingleRow); - if (rs.HasRows && rs.Read()) + using (var tb = new DataTable()) { - Values = new object[rs.FieldCount]; - int rv = rs.GetValues(Values); - u.PersID = (int)Values[rs.GetOrdinal("PersID")]; - u.LastName = Values[rs.GetOrdinal("LastName")].ToString(); - u.FirstName = Values[rs.GetOrdinal("FirstName")].ToString(); - //u.conCode = Values[rs.GetOrdinal("conCode")].ToString(); - u.Language = Values[rs.GetOrdinal("Language")].ToString(); - u.AccessAllow = Values[rs.GetOrdinal("AccessAllow")] as bool?; - decimal? m = Values[rs.GetOrdinal("Margin")] as decimal?; - if (m.HasValue) u.Margin = (double)m.Value; else u.Margin = null; - //u.Margin = (double ?)Values[rs.GetOrdinal("Margin")] ; - u.VisitIDLocked = Values[rs.GetOrdinal("VisitIDLocked")] as int?; - u.ReasonNoAccess = Values[rs.GetOrdinal("ReasonNoAccess")].ToString().Replace("\\n", "\n"); - u.UserComment = Values[rs.GetOrdinal("Comment")].ToString(); - u.AllOk = !CheckUser || (u.AccessAllow == true && u.VisitIDLocked == 0); + tb.Load(rs); + if (tb.Rows.Count > 0) + { + DataRow dr = tb.Rows[0]; + //Values = new object[rs.FieldCount]; + //int rv = rs.GetValues(Values); + u.PersID = (int)dr["PersID"]; + u.LastName = dr["LastName"].ToString(); + u.FirstName = dr["FirstName"].ToString(); + //u.conCode = Values[rs.GetOrdinal("conCode")].ToString(); + u.Language = dr["Language"].ToString(); + u.AccessAllow = dr["AccessAllow"] as bool?; + decimal? m = dr["Margin"] as decimal?; + if (m.HasValue) u.Margin = (double)m.Value; else u.Margin = null; + //u.Margin = (double ?)Values[rs.GetOrdinal("Margin")] ; + u.VisitIDLocked = dr["VisitIDLocked"] as int?; + u.ReasonNoAccess = dr["ReasonNoAccess"].ToString().Replace("\\n", "\n"); + u.UserComment = dr["Comment"].ToString(); + if (tb.Columns.Contains("hasEPD")) + u.hasEPD = (bool)dr["hasEPD"]; else u.hasEPD = false; + if (u.hasEPD) u.ReasonNoAccess = "EPD in use"; + u.AllOk = ( !CheckUser || (u.AccessAllow == true && u.VisitIDLocked == 0)); + } + else + { + // Not found + u.PersID = 0; + u.LastName = "Not Found"; + u.FirstName = "Not Found"; + //u.conCode = "A1"; + u.Language = "N"; + u.AccessAllow = false; + u.Margin = 0; + u.VisitIDLocked = 0; + u.ReasonNoAccess = "Not found"; + u.UserComment = ""; + u.AllOk = !CheckUser || (u.AccessAllow == true && u.VisitIDLocked == 0); + } + rs.Close(); } - else - { - // Not found - u.PersID = 0; - u.LastName = "Not Found"; - u.FirstName = "Not Found"; - //u.conCode = "A1"; - u.Language = "N"; - u.AccessAllow = false; - u.Margin = 0; - u.VisitIDLocked = 0; - u.ReasonNoAccess = "Not found"; - u.UserComment = ""; - u.AllOk = !CheckUser || (u.AccessAllow == true && u.VisitIDLocked == 0); - } - rs.Close(); } } catch (System.Exception ex) diff --git a/eDosStation/EntryBadge.xaml b/eDosStation/EntryBadge.xaml index 98a0412..be45ff0 100644 --- a/eDosStation/EntryBadge.xaml +++ b/eDosStation/EntryBadge.xaml @@ -124,23 +124,23 @@ - - - + + + - - - + + + - +