From 4b2642136823d7d87cbef7c45e15e9340f16d2f0 Mon Sep 17 00:00:00 2001 From: nek0 Date: Thu, 23 Apr 2020 13:27:32 +0200 Subject: [PATCH] add classes --- Administration.cs | 10 ++++++++++ Book.cs | 38 ++++++++++++++++++++++++++++++++++++++ Item.cs | 18 ++++++++++++++++++ Lending.cs | 23 +++++++++++++++++++++++ StatusEnum.cs | 11 +++++++++++ 5 files changed, 100 insertions(+) create mode 100644 Administration.cs create mode 100644 Book.cs create mode 100644 Item.cs create mode 100644 Lending.cs create mode 100644 StatusEnum.cs diff --git a/Administration.cs b/Administration.cs new file mode 100644 index 0000000..d261b12 --- /dev/null +++ b/Administration.cs @@ -0,0 +1,10 @@ +namespace Bücherwurm +{ + class Administration + { + + public Administration() + { + } + } +} \ No newline at end of file diff --git a/Book.cs b/Book.cs new file mode 100644 index 0000000..cbc2740 --- /dev/null +++ b/Book.cs @@ -0,0 +1,38 @@ +namespace Bücherwurm +{ + class Book + { + public int BookId {get;} + + public string Title {get; set;} + + public string Author {get; set;} + + public string Country {get; set;} + + public string ImageLink {get; set;} + + public string Link {get; set;} + + public string Language {get; set;} + + public int Pages {get; set;} + + public int Year {get; set;} + + public Book(int Id, string Title, string Author, + string Country, string ILink, string Link, string Language, + int Pages, int Year) + { + BookId = Id; + this.Title = Title; + this.Author = Author; + this.Country = Country; + ImageLink = ILink; + this.Link = Link; + this.Language = Language; + this.Pages = Pages; + this.Year = Year; + } + } +} \ No newline at end of file diff --git a/Item.cs b/Item.cs new file mode 100644 index 0000000..4077399 --- /dev/null +++ b/Item.cs @@ -0,0 +1,18 @@ +namespace Bücherwurm +{ + partial class Item + { + public int ItemId {get;} + + public int BookId {get;} + + public StatusEnum Status {get; set;} + + public Item(int Id, int BookId) + { + ItemId = Id; + this.BookId = BookId; + Status = StatusEnum.Available; + } + } +} \ No newline at end of file diff --git a/Lending.cs b/Lending.cs new file mode 100644 index 0000000..81f74c3 --- /dev/null +++ b/Lending.cs @@ -0,0 +1,23 @@ +using System; + +namespace Bücherwurm +{ + class Lending + { + public int LendId {get;} + + public int[] LendItems {get; set;} + + public DateTime ReturnDate {get;} + + public string Customer {get; } + + public Lending(int Id, int[] Items, string Customer) + { + LendId = Id; + LendItems = Items; + ReturnDate = DateTime.Now.AddDays(30); + this.Customer = Customer; + } + } +} \ No newline at end of file diff --git a/StatusEnum.cs b/StatusEnum.cs new file mode 100644 index 0000000..2882e48 --- /dev/null +++ b/StatusEnum.cs @@ -0,0 +1,11 @@ +namespace Bücherwurm +{ + partial class Item + { + public enum StatusEnum + { + Available, + Lended + } + } +} \ No newline at end of file