Buecherwurm/Magazine.cs

62 lines
1.4 KiB
C#
Raw Permalink Normal View History

2020-04-28 09:20:42 +00:00
using System.Text.Json.Serialization;
2020-04-28 09:04:54 +00:00
namespace Bücherwurm
{
public class Magazine : IProduct
{
2020-04-28 09:20:42 +00:00
[JsonIgnore]
2020-04-28 09:04:54 +00:00
public int ProductId {get; set;}
2020-04-28 09:20:42 +00:00
[JsonIgnore]
2020-04-28 13:29:20 +00:00
public CategoryEnum Category {get; set;}
2020-04-28 09:04:54 +00:00
2020-04-28 09:20:42 +00:00
[JsonIgnore]
2020-04-28 09:04:54 +00:00
public int LendTime {get; set;}
2020-04-28 09:20:42 +00:00
[JsonPropertyName("Titel")]
2020-04-28 13:11:31 +00:00
public string Name {get; set;}
2020-04-28 09:20:42 +00:00
[JsonPropertyName("Auflage")]
public string Run {get; set;}
[JsonPropertyName("Gruppe")]
public string Audience {get; set;}
[JsonPropertyName("Sachgruppe")]
public string Topic {get; set;}
2020-04-28 13:36:36 +00:00
public LendTypeEnum LendType {get; set;}
2020-04-28 09:04:54 +00:00
public void OverwriteNullId(int Id)
{
if (ProductId == 0)
{
ProductId = Id;
}
}
2020-04-28 09:20:42 +00:00
public Magazine()
{
2020-04-28 13:29:20 +00:00
Category = CategoryEnum.Magazine;
2020-04-28 09:20:42 +00:00
LendTime = 2;
2020-04-28 13:36:36 +00:00
LendType = LendTypeEnum.Physical;
2020-04-28 09:20:42 +00:00
}
2020-04-29 09:30:49 +00:00
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;
}
2020-04-28 09:04:54 +00:00
}
}