Advertisement
Guest User

Classes_Buchhandlung

a guest
Feb 21st, 2018
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Buchhandlung
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. Buch Einzelkind = new Buch("1234" , "Einzelkind");
  14. Autor Christian = new Autor("Christian");
  15. List<Autor> mAutoren = new List<Autor>();
  16. mAutoren.Add(Christian);
  17. List<Buch> mBücher = new List<Buch>();
  18. mBücher.Add(Einzelkind);
  19.  
  20.  
  21. Christian.SetvBuch(Einzelkind);
  22. Einzelkind.SetvAutor(Christian);
  23.  
  24. }
  25. }
  26. }
  27.  
  28. class Autor
  29. {
  30. private string name;
  31.  
  32. public Autor(string Name)
  33. {
  34. name = Name;
  35. }
  36.  
  37. public string Name
  38. {
  39. set { name = value; }
  40. get {return name; }
  41. }
  42.  
  43. private Buch vBuch = null;
  44. public void SetvBuch(Buch vB)
  45. {
  46. vBuch = vB;
  47. }
  48. }
  49.  
  50. class Buch
  51. {
  52. public Buch(string ISBN, string Buchname)
  53. {
  54. isbn = ISBN;
  55. buchname = Buchname;
  56. }
  57.  
  58. private string isbn;
  59.  
  60. public string ISBN
  61. {
  62. set { isbn = value; }
  63. get { return isbn; }
  64. }
  65.  
  66. private string buchname;
  67.  
  68. public string Buchname
  69. {
  70. set { buchname = value; }
  71. get { return buchname; }
  72. }
  73. private Autor vAutor = null;
  74.  
  75. public void SetvAutor(Autor vA)
  76. {
  77. vAutor = vA;
  78. }
  79.  
  80. public string getAutor()
  81. {
  82. return vAutor.Name;
  83. }
  84. }
  85.  
  86. class Verlag
  87. {
  88. private string verlagsname;
  89. public string Verlagsname
  90. {
  91. set { verlagsname = value; }
  92. get { return verlagsname; }
  93. }
  94. }
  95.  
  96.  
  97. class Mitarbeiter
  98. {
  99. private string m_id;
  100. public string M_ID
  101. {
  102. set { m_id = value; }
  103. get { return m_id; }
  104. }
  105.  
  106. private string name;
  107. public string Name
  108. {
  109. set { name = value; }
  110. get { return name; }
  111. }
  112. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement