refactor(session): expose WPF-compatible legacy state

This commit is contained in:
2026-07-29 14:09:00 +08:00
parent 4d907cf1dd
commit 6df28462be
4 changed files with 352 additions and 179 deletions
@@ -9,6 +9,7 @@ using Lskj.Business;
using Lskj.Business.Impl;
using Lskj.Control.Model;
using Lskj.Core;
using Lskj.Data;
using Lskj.Main.Model;
using Lskj.Model;
using Lskj.Util;
@@ -150,11 +151,13 @@ namespace Lskj.Main.Hosting
ValidateDatabase(candidate);
ValidateDelphi(candidate);
SystemInfo.RefreshSystemParam();
BaseResources.Localization(LocalizationType.CHS);
commit();
_ledgerTable = null;
SelectedLedgerName = candidate.AccountBookName;
ERPInfo.Instance.AccountBook = candidate.AccountBookName;
_connectionInitialized = true;
return string.Empty;
}
catch (Exception exception)
@@ -525,6 +528,7 @@ namespace Lskj.Main.Hosting
private string _delphiConnectionTemplate;
private string _selectedLedgerName;
private string _accountBook;
private bool _connectionInitialized;
public static LegacyConnectionStateSnapshot Capture(
LegacyLoginRuntime runtime)
@@ -540,7 +544,8 @@ namespace Lskj.Main.Hosting
_delphiConnectionTemplate =
DBConfig.Instance.dephiConnection,
_selectedLedgerName = runtime.SelectedLedgerName,
_accountBook = ERPInfo.Instance.AccountBook
_accountBook = ERPInfo.Instance.AccountBook,
_connectionInitialized = runtime._connectionInitialized
};
}
@@ -556,6 +561,7 @@ namespace Lskj.Main.Hosting
_delphiConnectionTemplate;
runtime.SelectedLedgerName = _selectedLedgerName;
runtime._ledgerTable = null;
runtime._connectionInitialized = _connectionInitialized;
ERPInfo.Instance.AccountBook = _accountBook;
try