Buecherwurm/Magazine.cs
2020-04-29 11:30:49 +02:00

62 lines
No EOL
1.4 KiB
C#

using System.Text.Json.Serialization;
namespace Bücherwurm
{
public class Magazine : IProduct
{
[JsonIgnore]
public int ProductId {get; set;}
[JsonIgnore]
public CategoryEnum Category {get; set;}
[JsonIgnore]
public int LendTime {get; set;}
[JsonPropertyName("Titel")]
public string Name {get; set;}
[JsonPropertyName("Auflage")]
public string Run {get; set;}
[JsonPropertyName("Gruppe")]
public string Audience {get; set;}
[JsonPropertyName("Sachgruppe")]
public string Topic {get; set;}
public LendTypeEnum LendType {get; set;}
public void OverwriteNullId(int Id)
{
if (ProductId == 0)
{
ProductId = Id;
}
}
public Magazine()
{
Category = CategoryEnum.Magazine;
LendTime = 2;
LendType = LendTypeEnum.Physical;
}
public Magazine(
int ProductId,
string Title,
string Run,
string Audience,
string Topic)
{
Category = CategoryEnum.Magazine;
LendTime = 2;
LendType = LendTypeEnum.Physical;
this.ProductId = ProductId;
Name = Title;
this.Run = Run;
this.Audience = Audience;
this.Topic = Topic;
}
}
}