CourseWork_BankYouBankrupt/BankYouBankrupt/BankYouBankruptDatabaseImplement/Models/Debiting.cs
2023-04-01 16:30:10 +04:00

52 lines
1.1 KiB
C#

using BankYouBankruptContracts.BindingModels;
using BankYouBankruptContracts.ViewModels;
using BankYouBankruptDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BankYouBankruptDatabaseImplement.Models
{
public class Debiting : IDebitingModel
{
public int Id { get; set; }
[Required]
public int CardId { get; set; }
[Required]
public int Sum { get; set; }
[Required]
public DateTime Date { get; set; } = DateTime.Now;
public DebitingViewModel GetViewModel => new()
{
Id = Id,
CardId = CardId,
Sum = Sum,
Date = Date
};
public static Debiting Create(DebitingBindingModel model)
{
return new Debiting()
{
Id = model.Id,
CardId = model.CardId,
Sum = model.Sum,
Date = model.Date
};
}
public void Update(DebitingBindingModel model)
{
}
}
}