implement functions
This commit is contained in:
parent
dd0e015d1e
commit
eb27c51bb0
6 changed files with 38 additions and 9 deletions
|
@ -2,7 +2,7 @@ namespace Bücherwurm
|
|||
{
|
||||
class Administration
|
||||
{
|
||||
private Catalogue Books {get; set;}
|
||||
private Catalogue Catalogue {get; set;}
|
||||
|
||||
private Inventory Inventory {get; set;}
|
||||
|
||||
|
@ -10,7 +10,7 @@ namespace Bücherwurm
|
|||
|
||||
public Administration()
|
||||
{
|
||||
Books = new Catalogue();
|
||||
Catalogue = new Catalogue();
|
||||
Inventory = new Inventory();
|
||||
Lendings = new Lend_Administration();
|
||||
}
|
||||
|
|
17
Catalogue.cs
17
Catalogue.cs
|
@ -1,3 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Bücherwurm
|
||||
|
@ -6,14 +7,30 @@ namespace Bücherwurm
|
|||
{
|
||||
private List<Book> Books {get; set;}
|
||||
|
||||
private int NextId {get; set;}
|
||||
|
||||
public Catalogue()
|
||||
{
|
||||
Books = new List<Book>();
|
||||
NextId = 0;
|
||||
}
|
||||
|
||||
public void Import(string JsonString)
|
||||
{
|
||||
//TODO: implement!
|
||||
}
|
||||
|
||||
public void Add(string Title, string Author,
|
||||
string Country, string ILink, string Link,
|
||||
string Language, int Pages, int Year)
|
||||
{
|
||||
Books.Add(new Book(NextId, Title, Author, Country, ILink, Link, Language, Pages, Year));
|
||||
NextId = NextId++;
|
||||
}
|
||||
|
||||
public void Remove(int BookID)
|
||||
{
|
||||
Books.RemoveAll(book => book.BookId == BookID);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -6,18 +6,22 @@ namespace Bücherwurm
|
|||
{
|
||||
private List<Item> InventoryList {get; set;}
|
||||
|
||||
private int NextId {get; set;}
|
||||
|
||||
public Inventory(){
|
||||
InventoryList = new List<Item>();
|
||||
NextId = 0;
|
||||
}
|
||||
|
||||
public void Add(Book Book)
|
||||
{
|
||||
//TODO: implement!
|
||||
InventoryList.Add(new Item(NextId, Book.BookId));
|
||||
NextId = NextId++;
|
||||
}
|
||||
|
||||
public void Remove(int Id)
|
||||
{
|
||||
//TODO: implement!
|
||||
InventoryList.RemoveAll(item => item.ItemId == Id);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -6,19 +6,27 @@ namespace Bücherwurm
|
|||
{
|
||||
private List<Lending> Lendings {get; set;}
|
||||
|
||||
private List<int> ActiveLendings {get; set;}
|
||||
|
||||
private int NextId {get; set;}
|
||||
|
||||
public Lend_Administration()
|
||||
{
|
||||
Lendings = new List<Lending>();
|
||||
ActiveLendings = new List<int>();
|
||||
NextId = 0;
|
||||
}
|
||||
|
||||
public void Lend(int[] ItemsIds, string Customer)
|
||||
public void Lend(int[] ItemIds, string Customer)
|
||||
{
|
||||
//TODO: implement!
|
||||
Lendings.Add(new Lending(NextId, ItemIds, Customer));
|
||||
ActiveLendings.Add(NextId);
|
||||
NextId = NextId++;
|
||||
}
|
||||
|
||||
public void Return(int LendID)
|
||||
{
|
||||
//TODO: implement!
|
||||
ActiveLendings.RemoveAll(id => id == LendID);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -6,7 +6,7 @@ namespace Bücherwurm
|
|||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Console.WriteLine("Hello World!");
|
||||
var Admin = new Administration();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
<mxfile host="Electron" modified="2020-04-23T08:32:31.986Z" agent="5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/12.9.9 Chrome/80.0.3987.163 Electron/8.2.1 Safari/537.36" etag="Ko7jEPaN3KFVTBNVUbiZ" version="12.9.9" type="device"><diagram id="C5RBs43oDa-KdzZeNtuy" name="Page-1">7V1dc5s4FP01nsk+uMOHcexH22nT7Ka7aZJtu087xMg2DUZekPPRX78ChA3SNcYYgUnodKZGFjLoHN17dXSldvTJ8uXSM1eLL9hCTkdTrJeOftHRNFUb9uk/QclrVDI0hlHB3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+9MAmKCBB+arEvF/vaD7NRwRNNJmufekCU60iyFvuC2Nd/mk2OTIJ3MqOXgG7eM2tkzejFFfUJ7T4Hz9eiGX/HkX352i2/IJZXuh1Im9+LEV43UHW2kV14UOq7D+2KzO6HJxPcw9DnWM9/Jya+fHRr12w1KHa7WgZ9cRYFba10Jw/+2nVb0awHs/Z/R9bSdu2gK8JRc4CvP86JA5x5U35dyHQBHbsmEqDoQSZqWiHsKwDhjByEK/cgE9gUiREGU5G3QUYsK7dxRgFTpBweZwBMlGaKIOm4DTPKARcMMwBwZS0L6GLiBxOIzxKi8GQjFLUxB6QqZHrw3KoCGHNIGugwGcBTEiOtuF0rlgs+uFRcJfjA8VbFg823LiyVv2Ss6emkwM2OowQhNAUICEtJCoQ3TmRLS7sVx/drC7JH1jHrxiD28o5EF5OD+XzQ3cnCLfxHwg8EhRXDD6QDp6d8ecSIlgdH8gBYQK6YB63CLBFeaI0YxFeWxhyjWfGGQG5bXrEdgpkYJHcIHiL+lr0fMAbz0P2Am/XleBv4UM5+QI3bPm70svf3qb3M+kfv74NZChyGJ9C0zv19ufeO5Zg3RiOw+v198MOc/MF1FXZ9czZ/w29Xz7lNJ2Drd+XoH2vsB5wtLHqQncqdad/j/5/UsjZ/c07FULON/Z76koz9qR8jVarFMU7J2AOn6r1hY5/d9U039vUcI3UCxn7Hatuxh5bycW9RW8831BtyU/eybP2Qe2B9z7lQ7FTrHfUl2fpTPxeqVIMzOCFbD5zq9JZtfXbXn6ytp5cexiRZ3TNXiy/YQkGN/wE=</diagram></mxfile>
|
||||
<mxfile host="Electron" modified="2020-04-23T13:42:54.100Z" agent="5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/12.9.9 Chrome/80.0.3987.163 Electron/8.2.1 Safari/537.36" etag="1wIon6ubGH6Jpe9GBUQR" version="12.9.9" type="device"><diagram id="C5RBs43oDa-KdzZeNtuy" name="Page-1">7V1bc9o4FP41zGQfyPiCuTwCSVPatE2TbNt92nG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