Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Buchhandlung
- {
- class Program
- {
- static void Main(string[] args)
- {
- Buch Einzelkind = new Buch("1234" , "Einzelkind");
- Autor Christian = new Autor("Christian");
- List<Autor> mAutoren = new List<Autor>();
- mAutoren.Add(Christian);
- List<Buch> mBücher = new List<Buch>();
- mBücher.Add(Einzelkind);
- Christian.SetvBuch(Einzelkind);
- Einzelkind.SetvAutor(Christian);
- }
- }
- }
- class Autor
- {
- private string name;
- public Autor(string Name)
- {
- name = Name;
- }
- public string Name
- {
- set { name = value; }
- get {return name; }
- }
- private Buch vBuch = null;
- public void SetvBuch(Buch vB)
- {
- vBuch = vB;
- }
- }
- class Buch
- {
- public Buch(string ISBN, string Buchname)
- {
- isbn = ISBN;
- buchname = Buchname;
- }
- private string isbn;
- public string ISBN
- {
- set { isbn = value; }
- get { return isbn; }
- }
- private string buchname;
- public string Buchname
- {
- set { buchname = value; }
- get { return buchname; }
- }
- private Autor vAutor = null;
- public void SetvAutor(Autor vA)
- {
- vAutor = vA;
- }
- public string getAutor()
- {
- return vAutor.Name;
- }
- }
- class Verlag
- {
- private string verlagsname;
- public string Verlagsname
- {
- set { verlagsname = value; }
- get { return verlagsname; }
- }
- }
- class Mitarbeiter
- {
- private string m_id;
- public string M_ID
- {
- set { m_id = value; }
- get { return m_id; }
- }
- private string name;
- public string Name
- {
- set { name = value; }
- get { return name; }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement