some indentation

This commit is contained in:
nek0 2020-04-29 11:30:49 +02:00
parent 58df08471b
commit 5f924f70f6
6 changed files with 64 additions and 11 deletions

13
Book.cs
View file

@ -35,9 +35,16 @@ namespace Bücherwurm
[JsonIgnore]
public LendTypeEnum LendType {get; set;}
public Book(int Id, string Title, string Author,
string Country, string ILink, string Link, string Language,
int Pages, int Year)
public Book(
int Id,
string Title,
string Author,
string Country,
string ILink,
string Link,
string Language,
int Pages,
int Year)
{
ProductId = Id;
Category = CategoryEnum.Book;

View file

@ -57,12 +57,32 @@ namespace Bücherwurm
Products.AddRange(new List<IProduct>(ePapers));
}
public void AddBook(string Title, string Author,
string Country, string ILink, string Link,
string Language, int Pages, int Year)
public void AddManualBook(
string Title,
string Author,
string Country,
string ILink,
string Link,
string Language,
int Pages,
int Year)
{
Products.Add(new Book(NextId, Title, Author, Country, ILink, Link, Language, Pages, Year));
NextId = NextId++;
var newBook = new Book(NextId, Title, Author, Country, ILink, Link, Language, Pages, Year);
Products.Add(newBook);
Products.Add(new EBook(newBook));
NextId += 1;
}
public void AddManualMagazine(
string Title,
string Run,
string Audience,
string Topic)
{
var newMagazine = new Magazine(NextId, Title, Run, Audience, Topic);
Products.Add(newMagazine);
Products.Add(new EPaper(newMagazine));
NextId += 1;
}
public void Add(IProduct product)

View file

@ -8,7 +8,9 @@ namespace Bücherwurm
public StatusEnum Status {get; set;}
public Item(int Id, int BookId)
public Item(
int Id,
int BookId)
{
ItemId = Id;
this.ProdId = BookId;

View file

@ -17,7 +17,10 @@ namespace Bücherwurm
NextId = 1;
}
public void Lend(int ItemId, string Customer, int timeInDays)
public void Lend(
int ItemId,
string Customer,
int timeInDays)
{
Lendings.Add(new Lending(NextId, ItemId, Customer, timeInDays));
ActiveLendings.Add(NextId);

View file

@ -12,7 +12,11 @@ namespace Bücherwurm
public string Customer {get; }
public Lending(int Id, int Item, string Customer, int timeInDays)
public Lending(
int Id,
int Item,
string Customer,
int timeInDays)
{
LendId = Id;
LendItem = Item;

View file

@ -41,5 +41,22 @@ namespace Bücherwurm
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;
}
}
}