ClientsModels
This commit is contained in:
parent
459fc319ef
commit
2c89484fd4
@ -18,6 +18,8 @@ namespace BankYouBankruptDatabaseImplement.Models
|
||||
[Required]
|
||||
public int CardId { get; set; }
|
||||
|
||||
public virtual Card Card { get; set; } = new();
|
||||
|
||||
[Required]
|
||||
public int Sum { get; set; }
|
||||
|
||||
@ -29,24 +31,21 @@ namespace BankYouBankruptDatabaseImplement.Models
|
||||
{
|
||||
Id = Id,
|
||||
CardId = CardId,
|
||||
CardNumber = Card.Number,
|
||||
Sum = Sum,
|
||||
Date = Date
|
||||
};
|
||||
|
||||
public static Crediting Create(CreditingBindingModel model)
|
||||
public static Crediting Create(BankYouBancruptDatabase context, CreditingBindingModel model)
|
||||
{
|
||||
return new Crediting()
|
||||
{
|
||||
Id = model.Id,
|
||||
CardId = model.CardId,
|
||||
Card = context.Cards.First(x => x.Id == model.CardId),
|
||||
Sum = model.Sum,
|
||||
Date = model.Date
|
||||
};
|
||||
}
|
||||
|
||||
public void Update(CreditingBindingModel model)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ namespace BankYouBankruptDatabaseImplement.Models
|
||||
|
||||
[Required]
|
||||
public int CardId { get; set; }
|
||||
public virtual Card Card { get; set; } = new();
|
||||
|
||||
[Required]
|
||||
public int Sum { get; set; }
|
||||
@ -28,24 +29,21 @@ namespace BankYouBankruptDatabaseImplement.Models
|
||||
{
|
||||
Id = Id,
|
||||
CardId = CardId,
|
||||
CardNumber = Card.Number,
|
||||
Sum = Sum,
|
||||
Date = Date
|
||||
};
|
||||
|
||||
public static Debiting Create(DebitingBindingModel model)
|
||||
public static Debiting Create(BankYouBancruptDatabase context, DebitingBindingModel model)
|
||||
{
|
||||
return new Debiting()
|
||||
{
|
||||
Id = model.Id,
|
||||
CardId = model.CardId,
|
||||
Card = context.Cards.First(x => x.Id == model.CardId),
|
||||
Sum = model.Sum,
|
||||
Date = model.Date
|
||||
};
|
||||
}
|
||||
|
||||
public void Update(DebitingBindingModel model)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user