WIP change to ids

This commit is contained in:
Geoffroy BONNEVILLE
2020-04-01 19:37:30 +02:00
parent 57be6bb917
commit b61a9652d1
24 changed files with 156 additions and 262 deletions

View File

@@ -28,10 +28,6 @@ namespace ModernKeePass.Interfaces
/// <param name="destination">The destination to move the entity to</param>
Task Move(GroupVm destination);
/// <summary>
/// Delete from Model
/// </summary>
Task CommitDelete();
/// <summary>
/// Delete from ViewModel
/// </summary>
Task MarkForDelete(string recycleBinTitle);

View File

@@ -11,7 +11,6 @@ using ModernKeePass.Application.Database.Queries.GetDatabase;
using ModernKeePass.Application.Entry.Commands.SetFieldValue;
using ModernKeePass.Application.Group.Commands.AddEntry;
using ModernKeePass.Application.Group.Commands.CreateGroup;
using ModernKeePass.Application.Group.Commands.DeleteEntry;
using ModernKeePass.Application.Group.Commands.RemoveEntry;
using ModernKeePass.Application.Security.Commands.GeneratePassword;
using ModernKeePass.Application.Security.Queries.EstimatePasswordComplexity;
@@ -266,18 +265,9 @@ namespace ModernKeePass.ViewModels
public async Task Move(Application.Group.Models.GroupVm destination)
{
await _mediator.Send(new AddEntryCommand { ParentGroup = destination, Entry = _entry });
await _mediator.Send(new RemoveEntryCommand { ParentGroup = _entry.ParentGroup, Entry = _entry });
if (destination == null)
{
await _mediator.Send(new DeleteEntryCommand { Entry = _entry });
}
await _mediator.Send(new RemoveEntryCommand { ParentGroup = _entry.ParentGroup, Entry = _entry, IsDelete = true });
}
public async Task CommitDelete()
{
await _mediator.Send(new DeleteEntryCommand {Entry = _entry});
}
public Application.Entry.Models.EntryVm GetEntry()
{
return _entry;

View File

@@ -13,7 +13,6 @@ using ModernKeePass.Application.Group.Commands.AddEntry;
using ModernKeePass.Application.Group.Commands.AddGroup;
using ModernKeePass.Application.Group.Commands.CreateEntry;
using ModernKeePass.Application.Group.Commands.CreateGroup;
using ModernKeePass.Application.Group.Commands.DeleteGroup;
using ModernKeePass.Application.Group.Commands.InsertEntry;
using ModernKeePass.Application.Group.Commands.RemoveEntry;
using ModernKeePass.Application.Group.Commands.RemoveGroup;
@@ -182,16 +181,7 @@ namespace ModernKeePass.ViewModels
public async Task Move(Application.Group.Models.GroupVm destination)
{
await _mediator.Send(new AddGroupCommand {ParentGroup = destination, Group = _group});
await _mediator.Send(new RemoveGroupCommand {ParentGroup = _group.ParentGroup, Group = _group});
if (destination == null)
{
await _mediator.Send(new DeleteGroupCommand { Group = _group });
}
}
public async Task CommitDelete()
{
await _mediator.Send(new DeleteGroupCommand { Group = _group });
await _mediator.Send(new RemoveGroupCommand {ParentGroup = _group.ParentGroup, Group = _group, IsDelete = true });
}
private async Task SortEntriesAsync()