some indentation
This commit is contained in:
parent
58df08471b
commit
5f924f70f6
6 changed files with 64 additions and 11 deletions
13
Book.cs
13
Book.cs
|
@ -35,9 +35,16 @@ namespace Bücherwurm
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public LendTypeEnum LendType {get; set;}
|
public LendTypeEnum LendType {get; set;}
|
||||||
|
|
||||||
public Book(int Id, string Title, string Author,
|
public Book(
|
||||||
string Country, string ILink, string Link, string Language,
|
int Id,
|
||||||
int Pages, int Year)
|
string Title,
|
||||||
|
string Author,
|
||||||
|
string Country,
|
||||||
|
string ILink,
|
||||||
|
string Link,
|
||||||
|
string Language,
|
||||||
|
int Pages,
|
||||||
|
int Year)
|
||||||
{
|
{
|
||||||
ProductId = Id;
|
ProductId = Id;
|
||||||
Category = CategoryEnum.Book;
|
Category = CategoryEnum.Book;
|
||||||
|
|
30
Catalogue.cs
30
Catalogue.cs
|
@ -57,12 +57,32 @@ namespace Bücherwurm
|
||||||
Products.AddRange(new List<IProduct>(ePapers));
|
Products.AddRange(new List<IProduct>(ePapers));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddBook(string Title, string Author,
|
public void AddManualBook(
|
||||||
string Country, string ILink, string Link,
|
string Title,
|
||||||
string Language, int Pages, int Year)
|
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));
|
var newBook = new Book(NextId, Title, Author, Country, ILink, Link, Language, Pages, Year);
|
||||||
NextId = NextId++;
|
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)
|
public void Add(IProduct product)
|
||||||
|
|
4
Item.cs
4
Item.cs
|
@ -8,7 +8,9 @@ namespace Bücherwurm
|
||||||
|
|
||||||
public StatusEnum Status {get; set;}
|
public StatusEnum Status {get; set;}
|
||||||
|
|
||||||
public Item(int Id, int BookId)
|
public Item(
|
||||||
|
int Id,
|
||||||
|
int BookId)
|
||||||
{
|
{
|
||||||
ItemId = Id;
|
ItemId = Id;
|
||||||
this.ProdId = BookId;
|
this.ProdId = BookId;
|
||||||
|
|
|
@ -17,7 +17,10 @@ namespace Bücherwurm
|
||||||
NextId = 1;
|
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));
|
Lendings.Add(new Lending(NextId, ItemId, Customer, timeInDays));
|
||||||
ActiveLendings.Add(NextId);
|
ActiveLendings.Add(NextId);
|
||||||
|
|
|
@ -12,7 +12,11 @@ namespace Bücherwurm
|
||||||
|
|
||||||
public string Customer {get; }
|
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;
|
LendId = Id;
|
||||||
LendItem = Item;
|
LendItem = Item;
|
||||||
|
|
17
Magazine.cs
17
Magazine.cs
|
@ -41,5 +41,22 @@ namespace Bücherwurm
|
||||||
LendTime = 2;
|
LendTime = 2;
|
||||||
LendType = LendTypeEnum.Physical;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue