ClientsDatabase

This commit is contained in:
shadowik 2023-04-01 16:36:07 +04:00
parent 7494228685
commit 459fc319ef
2 changed files with 9 additions and 1 deletions

View File

@ -4,6 +4,7 @@ using BankYouBankruptDataModels.Models;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -15,7 +16,6 @@ namespace BankYouBankruptDatabaseImplement.Models
public int Id { get; set; } public int Id { get; set; }
[Required] [Required]
public int ClientID { get; set; } public int ClientID { get; set; }
public virtual Client Client { get; set; } = new(); public virtual Client Client { get; set; } = new();
[Required] [Required]
public int AccountId { get; set; } public int AccountId { get; set; }
@ -26,6 +26,12 @@ namespace BankYouBankruptDatabaseImplement.Models
[Required] [Required]
public DateTime Period { get; set; } = DateTime.Now; public DateTime Period { get; set; } = DateTime.Now;
[ForeignKey("CardId")]
public virtual List<Crediting> Creditings { get; set; } = new();
[ForeignKey("CardId")]
public virtual List<Debiting> Debitings { get; set; } = new();
public CardViewModel GetViewModel => new() public CardViewModel GetViewModel => new()
{ {
Id = Id, Id = Id,

View File

@ -33,6 +33,8 @@ namespace BankYouBankruptDatabaseImplement.Models
[Required] [Required]
public string Password { get; set; } = string.Empty; public string Password { get; set; } = string.Empty;
[ForeignKey("ClientID")]
public virtual List<Client> Clients { get; set; } = new();
public ClientViewModel GetViewModel => new() public ClientViewModel GetViewModel => new()
{ {