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

53 lines
1.2 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 Crediting : ICreditingModel
{
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 CreditingViewModel GetViewModel => new()
{
Id = Id,
CardId = CardId,
Sum = Sum,
Date = Date
};
public static Crediting Create(CreditingBindingModel model)
{
return new Crediting()
{
Id = model.Id,
CardId = model.CardId,
Sum = model.Sum,
Date = model.Date
};
}
public void Update(CreditingBindingModel model)
{
}
}
}