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