SENKYO

מחלקות משתמשים

Mar 23rd, 2016
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 6.00 KB | None | 0 0
  1. // Junior מחלקת
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7.  
  8. namespace Schedule
  9. {
  10.     class Junior:Lecturer
  11.     {
  12.         public Junior() : base() { }
  13.  
  14.         public Junior(string fname, string lname, string id, string address, string user, string pass, int numHours, string type) : base(fname, lname, id, address, pass, user, numHours, type) { }
  15.  
  16.     }
  17. }
  18.  
  19.  
  20. // Professor מחלקת
  21.  
  22. using System;
  23. using System.Collections.Generic;
  24. using System.Linq;
  25. using System.Text;
  26. using System.Threading.Tasks;
  27.  
  28. namespace Schedule
  29. {
  30.     class Professor:Lecturer
  31.     {
  32.        
  33.         public Professor():base(){}
  34.  
  35.         public Professor(string fname, string lname, string id, string address, string user, string pass, int numHours, string type) : base(fname, lname, id, address, pass, user, numHours, type) { }
  36.  
  37.     }
  38. }
  39.  
  40. // Student מחלקת
  41.  
  42. using System;
  43. using System.Collections.Generic;
  44. using System.Linq;
  45. using System.Text;
  46. using System.Threading.Tasks;
  47.  
  48. namespace Schedule
  49. {
  50.     class Student : Person
  51.     {
  52.         private char year;    //college year (A,B,C,D)
  53.         private string department;  
  54.         private bool exellent;      // True or False
  55.         private float average;
  56.  
  57.  
  58.         public Student(): base(){
  59.             year = 'A';
  60.             department = null;
  61.             exellent = false;
  62.             average=0;
  63.         }
  64.         public Student(string fname, string lname, string id, string address,string user, string pass, char year, string depart, bool ex, float avg) :base(fname,lname,id,address,user,pass){
  65.             this.year = year;
  66.             department = depart;
  67.             exellent = ex;
  68.             average=avg;
  69.         }
  70.  
  71.  
  72.  
  73.         //---Getters---
  74.         public char getYear() { return year; }
  75.         public string getDepartment() { return department; }
  76.         public bool getExellent() { return exellent; }
  77.         public float getAverage() { return average; }
  78.  
  79.         //---Setters---
  80.         public void setYear(char year) { this.year = year; }
  81.         public void setDepartment(string department) { this.department = department; }
  82.         public void setExellent(bool exellent) { this.exellent = exellent; }
  83.         public void setAverage(float avg) { this.average = avg; }
  84.  
  85.         public string printObj()//--print Person object with all details
  86.         {
  87.             return base.printObj() + string.Format("\nyear: {0}\ndepartment: {1}\nexellent: {2}\naverage: {3}", getYear(), getDepartment(), getExellent(), getAverage());
  88.         }
  89.  
  90.     }
  91. }
  92.  
  93. // Secretary מחלקת
  94.  
  95. using System;
  96. using System.Collections.Generic;
  97. using System.Linq;
  98. using System.Text;
  99. using System.Threading.Tasks;
  100.  
  101. namespace Schedule
  102. {
  103.     class Secretary : Person
  104.     {
  105.  
  106.  
  107.         public Secretary() : base() { }
  108.  
  109.         public Secretary(string fname, string lname, string id, string address, string user, string pass) : base(fname, lname, id, address, pass, user) { }
  110.  
  111.  
  112.     }
  113. }
  114.  
  115. // Deparment Manager מחלקת
  116.  
  117. using System;
  118. using System.Collections.Generic;
  119. using System.Linq;
  120. using System.Text;
  121. using System.Threading.Tasks;
  122.  
  123. namespace Schedule
  124.  
  125. {
  126.     class DepartmentManager : Person
  127.     {
  128.        
  129.         public DepartmentManager():base(){}
  130.  
  131.         public DepartmentManager(string fname, string lname, string id, string address, string user, string pass) : base(fname, lname, id, address, pass, user) { }
  132.  
  133.     }
  134. }
  135.  
  136. // Tutor מחלקת
  137.  
  138. using System;
  139. using System.Collections.Generic;
  140. using System.Linq;
  141. using System.Text;
  142. using System.Threading.Tasks;
  143.  
  144. namespace Schedule
  145. {
  146.     class Tutor : Person
  147.     {
  148.  
  149.         public Tutor() : base() { }
  150.  
  151.         public Tutor(string fname, string lname, string id, string address, string user, string pass) : base(fname, lname, id, address, pass, user) { }
  152.  
  153.     }
  154. }
  155.  
  156. //Person מחלקת
  157.  
  158. using System;
  159. using System.Collections.Generic;
  160. using System.Linq;
  161. using System.Text;
  162. using System.Threading.Tasks;
  163.  
  164. namespace Schedule
  165. {
  166.     class Person
  167.     {
  168.         private Databases DB;
  169.         private string firstName;
  170.         private string lastName;
  171.         private string ID;
  172.         private string address;
  173.         private string userName;
  174.         private string password;    //letters and numbers
  175.  
  176.         public Person()
  177.         {
  178.  
  179.             DB = new UsersDB();
  180.             firstName = null;
  181.             lastName = null;
  182.             ID = null;
  183.             address = null;
  184.             userName = null;
  185.             password = null;
  186.         }
  187.         public Person(string fname, string lname, string id, string address, string user, string pass)
  188.         {
  189.             firstName = fname;
  190.             lastName = lname;
  191.             ID = id;
  192.             this.address = address;
  193.             userName = user;
  194.             password = pass;
  195.         }
  196.         //---Getters---
  197.         public string getFirstName() { return firstName; }
  198.         public string getLastName() { return lastName; }
  199.         public string getID() { return ID; }
  200.         public string getAddress() { return address; }
  201.         public string getUserName() { return userName; }
  202.         public string getPassword() { return password; }
  203.         //---Setters---
  204.         public void setFirstName(string fName) { this.firstName = fName; }
  205.         public void setLastName(string lName) { this.lastName = lName; }
  206.         public void setID(string id) { this.ID = id; }
  207.         public void setAddress(string address) { this.address = address; }
  208.         public void setUserName(string user) { this.userName = user; }
  209.         public void setPassword(string password) { this.password = password; }
  210.         //------------
  211.         public string printObj()//--print Person object with all details
  212.         {
  213.             return string.Format("Details\n-----------------\nfull name: {0} {1}\nid: {2}\naddress: {3}\nuser name: {4}\npassword: {5}", getFirstName(), getLastName(), getID(), getAddress(), getUserName(), getPassword());
  214.         }
  215.     }
  216. }
Add Comment
Please, Sign In to add comment