CourseWork_BankYouBankrupt/BankYouBankrupt/BankYouBankruptDatabaseImplement/Models/Debiting.cs

52 lines
1.1 KiB
C#
Raw Normal View History

2023-04-01 16:30:10 +04:00
using BankYouBankruptContracts.BindingModels;
using BankYouBankruptContracts.ViewModels;
using BankYouBankruptDataModels.Models;
2023-04-01 15:33:39 +04:00
using System;
using System.Collections.Generic;
2023-04-01 16:30:10 +04:00
using System.ComponentModel.DataAnnotations;
2023-04-01 15:33:39 +04:00
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BankYouBankruptDatabaseImplement.Models
{
public class Debiting : IDebitingModel
{
2023-04-01 16:30:10 +04:00
public int Id { get; set; }
2023-04-01 15:33:39 +04:00
2023-04-01 16:30:10 +04:00
[Required]
public int CardId { get; set; }
2023-04-01 15:33:39 +04:00
2023-04-01 16:30:10 +04:00
[Required]
public int Sum { get; set; }
2023-04-01 15:33:39 +04:00
2023-04-01 16:30:10 +04:00
[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)
{
}
2023-04-01 15:33:39 +04:00
}
}