diff --git a/.gitignore b/.gitignore index 96374c4..bc78471 100644 --- a/.gitignore +++ b/.gitignore @@ -1,39 +1,452 @@ -# Windows image file caches -Thumbs.db -ehthumbs.db +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from `dotnet new gitignore` -# Folder config file -Desktop.ini +# dotenv files +.env -# Recycle Bin used on file shares -$RECYCLE.BIN/ +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates -# Windows Installer files +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET +project.lock.json +project.fragment.lock.json +artifacts/ + +# Tye +.tye/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.tlog +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio 6 auto-generated project file (contains which files were open etc.) +*.vbp + +# Visual Studio 6 workspace and project file (working project files containing files to include in project) +*.dsw +*.dsp + +# Visual Studio 6 technical files +*.ncb +*.aps + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# Visual Studio History (VSHistory) files +.vshistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +# VS Code files for those working on multiple tools +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# Local History for Visual Studio Code +.history/ + +# Windows Installer files from build outputs *.cab *.msi +*.msix *.msm *.msp -# Windows shortcuts -*.lnk +# JetBrains Rider +*.sln.iml +.idea/ -# ========================= -# Operating System Files -# ========================= +## +## Visual studio for Mac +## -# OSX -# ========================= +# globs +Makefile.in +*.userprefs +*.usertasks +config.make +config.status +aclocal.m4 +install-sh +autom4te.cache/ +*.tar.gz +tarballs/ +test-results/ + +# Mac bundle stuff +*.dmg +*.app + +# content below from: https://github.com/github/gitignore/blob/main/Global/macOS.gitignore +# General .DS_Store .AppleDouble .LSOverride +# Icon must end with two \r +Icon + + # Thumbnails ._* -# Files that might appear on external disk +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd .Spotlight-V100 +.TemporaryItems .Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent # Directories potentially created on remote AFP share .AppleDB @@ -41,3 +454,31 @@ $RECYCLE.BIN/ Network Trash Folder Temporary Items .apdisk + +# content below from: https://github.com/github/gitignore/blob/main/Global/Windows.gitignore +# Windows thumbnail cache files +Thumbs.db +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# Vim temporary swap files +*.swp diff --git a/ToyStoreCustomers/ToyStoreCustomers/App.config b/ToyStoreCustomers/ToyStoreCustomers/App.config index bc3672d..a86c646 100644 --- a/ToyStoreCustomers/ToyStoreCustomers/App.config +++ b/ToyStoreCustomers/ToyStoreCustomers/App.config @@ -1,6 +1,6 @@ - + - + - \ No newline at end of file + diff --git a/ToyStoreCustomers/ToyStoreCustomers/My Project/Application.Designer.vb b/ToyStoreCustomers/ToyStoreCustomers/My Project/Application.Designer.vb index bf42860..22a6c5b 100644 --- a/ToyStoreCustomers/ToyStoreCustomers/My Project/Application.Designer.vb +++ b/ToyStoreCustomers/ToyStoreCustomers/My Project/Application.Designer.vb @@ -1,7 +1,7 @@ '------------------------------------------------------------------------------ ' ' This code was generated by a tool. -' Runtime Version:4.0.30319.34209 +' Runtime Version:4.0.30319.42000 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. @@ -34,5 +34,11 @@ Namespace My Protected Overrides Sub OnCreateMainForm() Me.MainForm = Global.ToyStoreCustomers.frmCustomerOrders End Sub + + _ + Protected Overrides Function OnInitialize(ByVal commandLineArgs As System.Collections.ObjectModel.ReadOnlyCollection(Of String)) As Boolean + Me.MinimumSplashScreenDisplayTime = 0 + Return MyBase.OnInitialize(commandLineArgs) + End Function End Class End Namespace diff --git a/ToyStoreCustomers/ToyStoreCustomers/My Project/Resources.Designer.vb b/ToyStoreCustomers/ToyStoreCustomers/My Project/Resources.Designer.vb index ef53b84..9a10cec 100644 --- a/ToyStoreCustomers/ToyStoreCustomers/My Project/Resources.Designer.vb +++ b/ToyStoreCustomers/ToyStoreCustomers/My Project/Resources.Designer.vb @@ -1,7 +1,7 @@ '------------------------------------------------------------------------------ ' ' This code was generated by a tool. -' Runtime Version:4.0.30319.34209 +' Runtime Version:4.0.30319.42000 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. @@ -11,6 +11,7 @@ Option Strict On Option Explicit On +Imports System Namespace My.Resources @@ -21,20 +22,20 @@ Namespace My.Resources ''' ''' A strongly-typed resource class, for looking up localized strings, etc. ''' - _ + _ Friend Module Resources - + Private resourceMan As Global.System.Resources.ResourceManager - + Private resourceCulture As Global.System.Globalization.CultureInfo - + ''' ''' Returns the cached ResourceManager instance used by this class. ''' - _ + _ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then @@ -44,17 +45,17 @@ Namespace My.Resources Return resourceMan End Get End Property - + ''' ''' Overrides the current thread's CurrentUICulture property for all ''' resource lookups using this strongly typed resource class. ''' - _ + _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get - Set(ByVal value As Global.System.Globalization.CultureInfo) + Set resourceCulture = value End Set End Property diff --git a/ToyStoreCustomers/ToyStoreCustomers/My Project/Settings.Designer.vb b/ToyStoreCustomers/ToyStoreCustomers/My Project/Settings.Designer.vb index 506cfa1..6a9c901 100644 --- a/ToyStoreCustomers/ToyStoreCustomers/My Project/Settings.Designer.vb +++ b/ToyStoreCustomers/ToyStoreCustomers/My Project/Settings.Designer.vb @@ -1,7 +1,7 @@ '------------------------------------------------------------------------------ ' ' This code was generated by a tool. -' Runtime Version:4.0.30319.34209 +' Runtime Version:4.0.30319.42000 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. @@ -13,42 +13,42 @@ Option Explicit On Namespace My - - _ + + _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase - - Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) - + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings) + #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then - Private Shared addedHandler As Boolean + Private Shared addedHandler As Boolean - Private Shared addedHandlerLockObject As New Object + Private Shared addedHandlerLockObject As New Object - _ - Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) - If My.Application.SaveMySettingsOnExit Then - My.Settings.Save() - End If - End Sub + _ + Private Shared Sub AutoSaveSettings(sender As Global.System.Object, e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub #End If #End Region - + Public Shared ReadOnly Property [Default]() As MySettings Get - + #If _MyType = "WindowsForms" Then - If Not addedHandler Then - SyncLock addedHandlerLockObject - If Not addedHandler Then - AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings - addedHandler = True - End If - End SyncLock - End If + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If #End If Return defaultInstance End Get diff --git a/ToyStoreCustomers/ToyStoreCustomers/ToyStoreCustomers.vbproj b/ToyStoreCustomers/ToyStoreCustomers/ToyStoreCustomers.vbproj index c232f6b..5c3585c 100644 --- a/ToyStoreCustomers/ToyStoreCustomers/ToyStoreCustomers.vbproj +++ b/ToyStoreCustomers/ToyStoreCustomers/ToyStoreCustomers.vbproj @@ -11,7 +11,8 @@ ToyStoreCustomers 512 WindowsForms - v4.5 + v4.8 + AnyCPU @@ -72,6 +73,16 @@ + + + + + + + + + + frmAddModifyCustomers.vb @@ -108,6 +119,7 @@ True Application.myapp + True True @@ -162,6 +174,7 @@ Settings.Designer.vb + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ToyStoreCustomers/ToyStoreData/CustomerDB.vb b/ToyStoreCustomers/ToyStoreData/CustomerDB.vb index 49cb455..ea3b829 100644 --- a/ToyStoreCustomers/ToyStoreData/CustomerDB.vb +++ b/ToyStoreCustomers/ToyStoreData/CustomerDB.vb @@ -1,13 +1,13 @@ -Imports System.Data.SqlClient - +Imports System.Data.Common +Imports SalouWS4Sql.Client Public Class CustomerDB Public Shared Function AddCustomer(ByVal customer As Customer) As String - Dim connection As SqlConnection = ToyStoreDataDB.GetConnection + Dim connection As DbConnection = ToyStoreDataDB.GetConnection Dim insertStatement As String = "INSERT Customers (cust_name, cust_address, cust_city, cust_state, " & "cust_zip, cust_country) VALUES (@cust_name, @cust_address, @cust_city, @cust_state, @cust_zip, " & "@cust_country);" - Dim insertcommand As New SqlCommand(insertStatement, connection) + Dim insertcommand = New SalouCommand(insertStatement, connection) insertcommand.Parameters.AddWithValue("@cust_name", customer.Cust_name) insertcommand.Parameters.AddWithValue("@cust_address", customer.Cust_address) insertcommand.Parameters.AddWithValue("@cust_city", customer.Cust_city) @@ -18,7 +18,7 @@ Public Class CustomerDB connection.Open() insertcommand.ExecuteNonQuery() Dim selectStatement As String = "SELECT DISTINCT IDENT_CURRENT('Customers') FROM Customers" - Dim selectCommand As New SqlCommand(selectStatement, connection) + Dim selectCommand As New SalouCommand(selectStatement, connection) Dim customerID As Integer = CInt(selectCommand.ExecuteScalar) Return customerID Catch ex As Exception @@ -31,18 +31,18 @@ Public Class CustomerDB Public Shared Function GetSelectedCustomers(ByVal name As String, ByVal state As String) As List(Of Customer) Dim customerList As New List(Of Customer) - Dim connection As SqlConnection = ToyStoreDataDB.GetConnection + Dim connection As DbConnection = ToyStoreDataDB.GetConnection Dim selectStatement As String = "SELECT * " & "FROM Customers " & "WHERE (cust_name LIKE @cust_name) AND (cust_state LIKE @cust_state) " & "Order by cust_name;" - Dim selectCommand As New SqlCommand(selectStatement, connection) + Dim selectCommand As New SalouCommand(selectStatement, connection) selectCommand.Parameters.AddWithValue("@cust_name", name & "%") selectCommand.Parameters.AddWithValue("@cust_state", state & "%") Try connection.Open() - Dim reader As SqlDataReader = selectCommand.ExecuteReader + Dim reader = selectCommand.ExecuteReader Dim customer As Customer While reader.Read customer = New Customer @@ -66,17 +66,17 @@ Public Class CustomerDB Public Shared Function GetCustomerByID(ByVal custID As String) As Customer Dim customer As New Customer - Dim connection As SqlConnection = ToyStoreDataDB.GetConnection + Dim connection As DbConnection = ToyStoreDataDB.GetConnection 'Get rid of * and specify columns? Dim selectStatement As String = "SELECT * " & "FROM Customers " & "WHERE cust_id = @cust_id;" - Dim selectCommand As New SqlCommand(selectStatement, connection) + Dim selectCommand As New SalouCommand(selectStatement, connection) selectCommand.Parameters.AddWithValue("@cust_id", custID) Try connection.Open() - Dim reader As SqlDataReader = selectCommand.ExecuteReader() + Dim reader = selectCommand.ExecuteReader() If reader.Read Then customer.Cust_id = reader("cust_id").ToString customer.Cust_name = reader("cust_name").ToString @@ -98,7 +98,7 @@ Public Class CustomerDB End Function Public Shared Function UpdateCustomer(ByVal oldCustomer As Customer, ByVal newCustomer As Customer) As Boolean - Dim connection As SqlConnection = ToyStoreDataDB.GetConnection + Dim connection As DbConnection = ToyStoreDataDB.GetConnection Dim updateStatement As String = "UPDATE Customers SET cust_name = @newcust_name, " & "cust_address = @newcust_address, " & "cust_city = @newcust_city, " & @@ -112,7 +112,7 @@ Public Class CustomerDB "cust_state = @oldcust_state AND " & "cust_zip = @oldcust_zip AND " & "cust_country = @oldcust_country " - Dim updateCommand As New SqlCommand(updateStatement, connection) + Dim updateCommand As New SalouCommand(updateStatement, connection) updateCommand.Parameters.AddWithValue("@newcust_name", newCustomer.Cust_name) updateCommand.Parameters.AddWithValue("@newcust_address", newCustomer.Cust_address) updateCommand.Parameters.AddWithValue("@newcust_city", newCustomer.Cust_city) diff --git a/ToyStoreCustomers/ToyStoreData/ILLink/ILLink.Descriptors.LibraryBuild.xml b/ToyStoreCustomers/ToyStoreData/ILLink/ILLink.Descriptors.LibraryBuild.xml new file mode 100644 index 0000000..a42d7f0 --- /dev/null +++ b/ToyStoreCustomers/ToyStoreData/ILLink/ILLink.Descriptors.LibraryBuild.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/ToyStoreCustomers/ToyStoreData/My Project/Application.Designer.vb b/ToyStoreCustomers/ToyStoreData/My Project/Application.Designer.vb index a8790f4..88dd01c 100644 --- a/ToyStoreCustomers/ToyStoreData/My Project/Application.Designer.vb +++ b/ToyStoreCustomers/ToyStoreData/My Project/Application.Designer.vb @@ -1,7 +1,7 @@ '------------------------------------------------------------------------------ ' ' This code was generated by a tool. -' Runtime Version:4.0.30319.34209 +' Runtime Version:4.0.30319.42000 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. diff --git a/ToyStoreCustomers/ToyStoreData/My Project/Resources.Designer.vb b/ToyStoreCustomers/ToyStoreData/My Project/Resources.Designer.vb index 3b0a1e6..8302f72 100644 --- a/ToyStoreCustomers/ToyStoreData/My Project/Resources.Designer.vb +++ b/ToyStoreCustomers/ToyStoreData/My Project/Resources.Designer.vb @@ -1,7 +1,7 @@ '------------------------------------------------------------------------------ ' ' This code was generated by a tool. -' Runtime Version:4.0.30319.34209 +' Runtime Version:4.0.30319.42000 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. @@ -11,6 +11,7 @@ Option Strict On Option Explicit On +Imports System Namespace My.Resources @@ -21,20 +22,20 @@ Namespace My.Resources ''' ''' A strongly-typed resource class, for looking up localized strings, etc. ''' - _ + _ Friend Module Resources - + Private resourceMan As Global.System.Resources.ResourceManager - + Private resourceCulture As Global.System.Globalization.CultureInfo - + ''' ''' Returns the cached ResourceManager instance used by this class. ''' - _ + _ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then @@ -44,17 +45,17 @@ Namespace My.Resources Return resourceMan End Get End Property - + ''' ''' Overrides the current thread's CurrentUICulture property for all ''' resource lookups using this strongly typed resource class. ''' - _ + _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get - Set(ByVal value As Global.System.Globalization.CultureInfo) + Set resourceCulture = value End Set End Property diff --git a/ToyStoreCustomers/ToyStoreData/My Project/Settings.Designer.vb b/ToyStoreCustomers/ToyStoreData/My Project/Settings.Designer.vb index a5d0eab..86b175b 100644 --- a/ToyStoreCustomers/ToyStoreData/My Project/Settings.Designer.vb +++ b/ToyStoreCustomers/ToyStoreData/My Project/Settings.Designer.vb @@ -1,7 +1,7 @@ '------------------------------------------------------------------------------ ' ' This code was generated by a tool. -' Runtime Version:4.0.30319.34209 +' Runtime Version:4.0.30319.42000 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. @@ -13,42 +13,42 @@ Option Explicit On Namespace My - - _ + + _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase - - Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) - + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings) + #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then - Private Shared addedHandler As Boolean + Private Shared addedHandler As Boolean - Private Shared addedHandlerLockObject As New Object + Private Shared addedHandlerLockObject As New Object - _ - Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) - If My.Application.SaveMySettingsOnExit Then - My.Settings.Save() - End If - End Sub + _ + Private Shared Sub AutoSaveSettings(sender As Global.System.Object, e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub #End If #End Region - + Public Shared ReadOnly Property [Default]() As MySettings Get - + #If _MyType = "WindowsForms" Then - If Not addedHandler Then - SyncLock addedHandlerLockObject - If Not addedHandler Then - AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings - addedHandler = True - End If - End SyncLock - End If + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If #End If Return defaultInstance End Get diff --git a/ToyStoreCustomers/ToyStoreData/OrderDB.vb b/ToyStoreCustomers/ToyStoreData/OrderDB.vb index aec5177..f4a98f9 100644 --- a/ToyStoreCustomers/ToyStoreData/OrderDB.vb +++ b/ToyStoreCustomers/ToyStoreData/OrderDB.vb @@ -1,15 +1,16 @@ -Imports System.Data.SqlClient +Imports System.Data.Common +Imports SalouWS4Sql.Client Public Class OrderDB Public Shared Function GetCustomerOrders(ByVal CustomerID As Integer) As List(Of Order) Dim orderList As New List(Of Order) - Dim connection As SqlConnection = ToyStoreDataDB.GetConnection + Dim connection As DbConnection = ToyStoreDataDB.GetConnection Dim selectStatement As String = "SELECT * FROM Orders WHERE cust_id = @cust_id ORDER BY order_date desc;" - Dim selectCommand As New SqlCommand(selectStatement, connection) + Dim selectCommand As New SalouCommand(selectStatement, connection) selectCommand.Parameters.AddWithValue("@cust_id", CustomerID) Try connection.Open() - Dim reader As SqlDataReader = selectCommand.ExecuteReader + Dim reader = selectCommand.ExecuteReader Dim order As New Order While (reader.Read) order = New Order diff --git a/ToyStoreCustomers/ToyStoreData/OrderItemDB.vb b/ToyStoreCustomers/ToyStoreData/OrderItemDB.vb index b028510..4a4300b 100644 --- a/ToyStoreCustomers/ToyStoreData/OrderItemDB.vb +++ b/ToyStoreCustomers/ToyStoreData/OrderItemDB.vb @@ -1,15 +1,16 @@ -Imports System.Data.SqlClient +Imports System.Data.Common +Imports SalouWS4Sql.Client Public Class OrderItemDB Public Shared Function GetOrderItems(ByVal orderNum As Integer) As List(Of OrderItem) Dim orderItemList As New List(Of OrderItem) - Dim connection As SqlConnection = ToyStoreDataDB.GetConnection + Dim connection As DbConnection = ToyStoreDataDB.GetConnection Dim selectStatement As String = "SELECT * FROM OrderItems WHERE order_num = @order_num;" - Dim selectCommand As New SqlCommand(selectStatement, connection) + Dim selectCommand As New SalouCommand(selectStatement, connection) selectCommand.Parameters.AddWithValue("@order_num", orderNum) Try connection.Open() - Dim reader As SqlDataReader = selectCommand.ExecuteReader + Dim reader = selectCommand.ExecuteReader Dim orderItem As OrderItem While reader.Read orderItem = New OrderItem diff --git a/ToyStoreCustomers/ToyStoreData/ProductDB.vb b/ToyStoreCustomers/ToyStoreData/ProductDB.vb index 18c07cc..ac48c8e 100644 --- a/ToyStoreCustomers/ToyStoreData/ProductDB.vb +++ b/ToyStoreCustomers/ToyStoreData/ProductDB.vb @@ -1,15 +1,16 @@ -Imports System.Data.SqlClient +Imports System.Data.Common +Imports SalouWS4Sql.Client Public Class ProductDB Public Shared Function GetProducts() As List(Of Product) Dim productList As New List(Of Product) - Dim connection As SqlConnection = ToyStoreDataDB.GetConnection + Dim connection As DbConnection = ToyStoreDataDB.GetConnection Dim selectStatement As String = "SELECT * FROM Products" - Dim selectCommand As New SqlCommand(selectStatement, connection) + Dim selectCommand As New SalouCommand(selectStatement, connection) Try connection.Open() - Dim reader As SqlDataReader = selectCommand.ExecuteReader + Dim reader = selectCommand.ExecuteReader Dim product As Product While reader.Read product = New Product diff --git a/ToyStoreCustomers/ToyStoreData/ToyStoreData.vbproj b/ToyStoreCustomers/ToyStoreData/ToyStoreData.vbproj index fdffe7a..02f5ca6 100644 --- a/ToyStoreCustomers/ToyStoreData/ToyStoreData.vbproj +++ b/ToyStoreCustomers/ToyStoreData/ToyStoreData.vbproj @@ -10,7 +10,8 @@ ToyStoreData 512 Windows - v4.5 + v4.8 + true @@ -43,8 +44,36 @@ On + + ..\..\..\Salou\packages\Microsoft.Bcl.AsyncInterfaces.9.0.1\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll + + + ..\..\..\Salou\packages\Microsoft.Extensions.DependencyInjection.Abstractions.9.0.1\lib\net462\Microsoft.Extensions.DependencyInjection.Abstractions.dll + + + ..\..\..\Salou\packages\Microsoft.Extensions.Logging.Abstractions.9.0.1\lib\net462\Microsoft.Extensions.Logging.Abstractions.dll + + + ..\..\..\Salou\packages\System.Buffers.4.6.0\lib\net462\System.Buffers.dll + + + ..\..\..\Salou\packages\System.Diagnostics.DiagnosticSource.9.0.1\lib\net462\System.Diagnostics.DiagnosticSource.dll + + + ..\..\..\Salou\packages\System.Memory.4.6.0\lib\net462\System.Memory.dll + + + + ..\..\..\Salou\packages\System.Numerics.Vectors.4.6.0\lib\net462\System.Numerics.Vectors.dll + + + ..\..\..\Salou\packages\System.Runtime.CompilerServices.Unsafe.6.1.0\lib\net462\System.Runtime.CompilerServices.Unsafe.dll + + + ..\..\..\Salou\packages\System.Threading.Tasks.Extensions.4.6.0\lib\net462\System.Threading.Tasks.Extensions.dll + @@ -73,6 +102,7 @@ True Application.myapp + True True @@ -97,6 +127,7 @@ + MyApplicationCodeGenerator Application.Designer.vb @@ -111,8 +142,17 @@ My Settings.Designer.vb + + + + + {e4d1ca12-cceb-4480-908b-c9c4cda9a7bd} + Salou48 + + + + -