fix
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
namespace MyOffice.Web.Models.Motion
|
||||
{
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Core.Extensions;
|
||||
using Data.Models.Accounts;
|
||||
using MyOffice.Data.Models.Motions;
|
||||
|
||||
public class AccountMotionViewModel
|
||||
{
|
||||
public string Id { get; set; } = null!;
|
||||
public DateTime Date { get; set; }
|
||||
public string Motion { get; set; } = null!;
|
||||
public string? Description { get; set; }
|
||||
public decimal Plus { get; set; }
|
||||
public decimal Minus { get; set; }
|
||||
}
|
||||
|
||||
public static class AccountMotionViewModelExtensions
|
||||
{
|
||||
public static AccountMotionViewModel ToModel(this AccountMotion input)
|
||||
{
|
||||
return new AccountMotionViewModel
|
||||
{
|
||||
Id = input.Id.ToShort(),
|
||||
Date = input.DateTime,
|
||||
Motion = input.Motion.MotionGlobal.Name,
|
||||
Description = input.Description,
|
||||
Plus = input.AmountPlus,
|
||||
Minus = input.AmountMinus,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user