WIP
This commit is contained in:
1 parent
2bfe914c8f
commit
4281924ee5
16 files changed
+369
-76
No files matched your search
@@ -67,6 +67,44 @@ public partial class Salary
|
||||
private bool _showDeleteModal;
|
||||
private Data.Entities.Salary? _pendingDeleteSalary;
|
||||
|
||||
private bool _showEditModal;
|
||||
private int _editSalaryId;
|
||||
private SalaryForm _editFormModel = new();
|
||||
|
||||
private void OpenEditModal(Data.Entities.Salary s)
|
||||
{
|
||||
_editSalaryId = s.Id;
|
||||
_editFormModel = new SalaryForm
|
||||
{
|
||||
Name = s.Name,
|
||||
Amount = s.Amount,
|
||||
AccountId = s.AccountId,
|
||||
RecurrenceType = s.RecurrenceType,
|
||||
StartDate = s.StartDate
|
||||
};
|
||||
_showEditModal = true;
|
||||
}
|
||||
|
||||
private void CancelEdit() => _showEditModal = false;
|
||||
|
||||
private async Task SaveEdit()
|
||||
{
|
||||
if (_userId is null) return;
|
||||
var salary = new Data.Entities.Salary
|
||||
{
|
||||
Id = _editSalaryId,
|
||||
Name = _editFormModel.Name,
|
||||
Amount = _editFormModel.Amount,
|
||||
AccountId = _editFormModel.AccountId,
|
||||
RecurrenceType = _editFormModel.RecurrenceType,
|
||||
StartDate = _editFormModel.StartDate,
|
||||
UserId = _userId
|
||||
};
|
||||
await SalaryService.UpdateSalaryAsync(salary, DateTime.Today.AddDays(90), _userId);
|
||||
_showEditModal = false;
|
||||
await LoadData();
|
||||
}
|
||||
|
||||
private void ConfirmDelete(Data.Entities.Salary s)
|
||||
{
|
||||
_pendingDeleteSalary = s;
|
||||
|
||||
Reference in new issue
Block a user