Browse Source

implement epapers

master
nek0 1 year ago
parent
commit
48bb08bd88
  1. 15
      Catalogue.cs
  2. 23
      EPaper.cs

15
Catalogue.cs

@ -39,14 +39,21 @@ namespace Bücherwurm
public void ImportMagazines(string JsonString)
{
var IntermediateBooks = JsonSerializer.Deserialize<List<Magazine>>(JsonString);
foreach (var Ibook in IntermediateBooks)
var IntermediateMagazines = JsonSerializer.Deserialize<List<Magazine>>(JsonString);
foreach (var Ibook in IntermediateMagazines)
{
Ibook.OverwriteNullId(NextId);
NextId += 1;
}
Products.AddRange(new List<IProduct>(IntermediateBooks));
Products.AddRange(new List<IProduct>(IntermediateMagazines));
var ePapers = new List<EPaper>();
foreach (var mag in IntermediateMagazines)
{
var epaper = new EPaper(mag);
epaper.OverwriteNullId(NextId);
NextId += 1;
}
Products.AddRange(new List<IProduct>(ePapers));
}
public void AddBook(string Title, string Author,

23
EPaper.cs

@ -0,0 +1,23 @@
namespace Bücherwurm
{
public class EPaper : Magazine, IProduct
{
public EPaper()
{
Category = CategoryEnum.EPaper;
LendTime = 2;
LendType = LendTypeEnum.Virtual;
}
public EPaper(Magazine Parent)
{
Category = CategoryEnum.EPaper;
LendTime = 2;
LendType = LendTypeEnum.Virtual;
Name = Parent.Name;
Run = Parent.Run;
Audience = Parent.Audience;
Topic = Parent.Topic;
}
}
}
Loading…
Cancel
Save