This commit is contained in:
2023-06-17 14:16:09 +03:00
parent 62178f1f32
commit 7ae5d3bc81
180 changed files with 12932 additions and 192 deletions
@@ -0,0 +1,29 @@
namespace MyOffice.Web.Models.Account
{
using System.ComponentModel.DataAnnotations;
using Core.Extensions;
using Data.Models.Accounts;
public class MotionCategoryViewModel
{
public string? Id { get; set; }
[Required]
public string? Name { get; set; }
public bool? AllowDelete { get; set; }
}
public static class AccountCategoryViewModelExtensions
{
public static MotionCategoryViewModel ToModel(this AccountCategory input)
{
return new MotionCategoryViewModel
{
Id = input.Id.ToShort(),
Name = input.Name,
AllowDelete = !input.Accounts?.Any(),
};
}
}
}