BacupFunctionality
This commit is contained in:
@ -14,6 +14,7 @@ using System.Text.Json;
|
||||
using System.IO;
|
||||
using Helpers;
|
||||
using StockBL.Interface;
|
||||
using SqliteBackups.Interfaces;
|
||||
|
||||
namespace StockInfo
|
||||
{
|
||||
@ -24,12 +25,15 @@ namespace StockInfo
|
||||
private readonly IPersonRepository _personRepository;
|
||||
private readonly IAddressRepository _addressRepository;
|
||||
private readonly IStockPersonConnect _stockPersonConnect;
|
||||
private readonly IBackupRepository _backupRepository;
|
||||
private readonly IBackupRoutines _backupRoutines;
|
||||
private readonly IPersonStockFacade _personStockFacade;
|
||||
private frmRegisterStock regWindow;
|
||||
private frmMyStocks stockWindow;
|
||||
private frmSelling sellWindow;
|
||||
private frmPerson personWindow;
|
||||
private frmPersonShareConnect personShareConnect;
|
||||
private frmBackup backupWindow;
|
||||
public int SelectedPersonId { get; set; } = 0;
|
||||
|
||||
public frmInitial(
|
||||
@ -38,7 +42,9 @@ namespace StockInfo
|
||||
IPersonRepository personRepository,
|
||||
IAddressRepository addressRepository,
|
||||
IStockPersonConnect stockPersonConnect,
|
||||
IPersonStockFacade personStockFacade)
|
||||
IBackupRepository backupRepository,
|
||||
IBackupRoutines backupRoutines,
|
||||
IPersonStockFacade personStockFacade)
|
||||
{
|
||||
InitializeComponent();
|
||||
_stockRepository = stockMemberRepository;
|
||||
@ -46,6 +52,8 @@ namespace StockInfo
|
||||
_personRepository = personRepository;
|
||||
_addressRepository = addressRepository;
|
||||
_stockPersonConnect = stockPersonConnect;
|
||||
_backupRepository = backupRepository;
|
||||
_backupRoutines = backupRoutines;
|
||||
_personStockFacade = personStockFacade;
|
||||
}
|
||||
|
||||
@ -55,6 +63,8 @@ namespace StockInfo
|
||||
btnRestoreShares.Enabled = false;
|
||||
btnBackupShares.Enabled = false;
|
||||
btnReloadShares.Enabled = false;
|
||||
btnRestoreAll.Enabled = false;
|
||||
btnBackupAll.Enabled = false;
|
||||
}
|
||||
|
||||
private void ReloadData()
|
||||
@ -135,11 +145,15 @@ namespace StockInfo
|
||||
{
|
||||
btnRestoreShares.Enabled = true;
|
||||
btnBackupShares.Enabled = true;
|
||||
btnBackupAll.Enabled = true;
|
||||
btnRestoreAll.Enabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
btnRestoreShares.Enabled = false;
|
||||
btnBackupShares.Enabled = false;
|
||||
btnBackupAll.Enabled = false;
|
||||
btnRestoreAll.Enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -235,5 +249,11 @@ namespace StockInfo
|
||||
{
|
||||
SelectedPersonId = ((ComboboxItem)cmbOwners.SelectedItem).HiddenValue;
|
||||
}
|
||||
|
||||
private void btnBackupAll_Click(object sender, EventArgs e)
|
||||
{
|
||||
backupWindow = new frmBackup(_backupRepository,_backupRoutines);
|
||||
backupWindow.ShowDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user