Es wird überprüft auf den Datenbank version
This commit is contained in:
@@ -53,6 +53,10 @@
|
||||
<Project>{c82bd650-466b-403f-bed9-2b1660771f54}</Project>
|
||||
<Name>KlassenBIB</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\SanShared\SanShared.csproj">
|
||||
<Project>{c949087e-20e1-4a17-b021-faead363c1d8}</Project>
|
||||
<Name>SanShared</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
|
||||
@@ -10,6 +10,7 @@ using System.Diagnostics;
|
||||
using ICSharpCode.SharpZipLib.Zip;
|
||||
using ICSharpCode.SharpZipLib.Core;
|
||||
using KlassenBIB;
|
||||
using SanShared.Exceptions;
|
||||
|
||||
namespace Database
|
||||
{
|
||||
@@ -40,7 +41,16 @@ namespace Database
|
||||
if (File.Exists(filepath))
|
||||
{
|
||||
File.Copy(filepath, string.Format("{0}_{1}_{2}.bak", filepath,DateTime.Now.ToShortDateString(),DateTime.Now.Ticks));
|
||||
loadedProjekt = XamlServices.Load(filepath) as KlassenBIB.Projekt;
|
||||
try
|
||||
{
|
||||
loadedProjekt = XamlServices.Load(filepath) as KlassenBIB.Projekt;
|
||||
}
|
||||
catch(XamlObjectWriterException ex)
|
||||
{
|
||||
string msg = ex.Message;
|
||||
if (msg.ToLower().Contains("kann nicht festgelegt werden"))
|
||||
throw new DataBaseVersionMismatchException();
|
||||
}
|
||||
}
|
||||
else
|
||||
loadedProjekt = new KlassenBIB.Projekt();
|
||||
|
||||
Reference in New Issue
Block a user