public Employee getEmployee(String Conditions) { Employee _emp = null; List <String> itemList = new List <String>(); itemList = FetchList(TPerson, "*", Conditions); switch (Convert.ToInt32(itemList[9])) { case 1: //secretary Secretary _sec = new Secretary(); _sec.USERNAME = itemList[0]; _sec.PASSWORD = itemList[1]; _sec.ID = itemList[2]; _sec.FIRSTNAME = itemList[3]; _sec.LASTNAME = itemList[4]; _sec.MAIL = itemList[5]; _sec.PHONE = itemList[6]; _sec.GENDER = (Gender)(Convert.ToInt32(itemList[7])); _sec.DEPT = (Department)(Convert.ToInt32(itemList[8])); //-------------------------------------------------------------------------------------------// itemList = FetchList(TEmployee, "*", "id = " + _sec.ID); //-------------------------------------------------------------------------------------------// _sec.SALARY = Convert.ToSingle(itemList[1]); _sec.DEGREE = (Degree)(Convert.ToInt32(itemList[3])); _sec.JOB = (Job)(Convert.ToInt32(itemList[4])); _emp = _sec; break; case 2: //tutor Tutor _tut = new Tutor(); _tut.USERNAME = itemList[0]; _tut.PASSWORD = itemList[1]; _tut.ID = itemList[2]; _tut.FIRSTNAME = itemList[3]; _tut.LASTNAME = itemList[4]; _tut.MAIL = itemList[5]; _tut.PHONE = itemList[6]; _tut.GENDER = (Gender)(Convert.ToInt32(itemList[7])); _tut.DEPT = (Department)(Convert.ToInt32(itemList[8])); //-------------------------------------------------------------------------------------------// itemList = FetchList(TEmployee, "*", "id = " + _tut.ID); //-------------------------------------------------------------------------------------------// _tut.SALARY = Convert.ToSingle(itemList[1]); _tut.decrypt_courses(itemList[2]); _tut.DEGREE = (Degree)(Convert.ToInt32(itemList[3])); _tut.JOB = (Job)(Convert.ToInt32(itemList[4])); _emp = _tut; break; case 3: //lecturer Lecturer _lect = new Lecturer(); _lect.USERNAME = itemList[0]; _lect.PASSWORD = itemList[1]; _lect.ID = itemList[2]; _lect.FIRSTNAME = itemList[3]; _lect.LASTNAME = itemList[4]; _lect.MAIL = itemList[5]; _lect.PHONE = itemList[6]; _lect.GENDER = (Gender)(Convert.ToInt32(itemList[7])); _lect.DEPT = (Department)(Convert.ToInt32(itemList[8])); //-------------------------------------------------------------------------------------------// itemList = FetchList(TEmployee, "*", "id = " + _lect.ID); //-------------------------------------------------------------------------------------------// _lect.SALARY = Convert.ToSingle(itemList[1]); _lect.decrypt_courses(itemList[2]); _lect.DEGREE = (Degree)(Convert.ToInt32(itemList[3])); _lect.JOB = (Job)(Convert.ToInt32(itemList[4])); _emp = _lect; break; case 4: //dept head HeadDept _hoad = new HeadDept(); _hoad.USERNAME = itemList[0]; _hoad.PASSWORD = itemList[1]; _hoad.ID = itemList[2]; _hoad.FIRSTNAME = itemList[3]; _hoad.LASTNAME = itemList[4]; _hoad.MAIL = itemList[5]; _hoad.PHONE = itemList[6]; _hoad.GENDER = (Gender)(Convert.ToInt32(itemList[7])); _hoad.DEPT = (Department)(Convert.ToInt32(itemList[8])); //-------------------------------------------------------------------------------------------// itemList = FetchList(TEmployee, "*", "id = " + _hoad.ID); //-------------------------------------------------------------------------------------------// _hoad.SALARY = Convert.ToSingle(itemList[1]); _hoad.DEGREE = (Degree)(Convert.ToInt32(itemList[3])); _hoad.JOB = (Job)(Convert.ToInt32(itemList[4])); _emp = _hoad; break; } return(_emp); }
public override double CalculateOverallLecturerTimeDedicatedToLecture(Lecturer lecturer, Lecture lecture) { return(base.CalculateOverallLecturerTimeDedicatedToLecture(lecturer, lecture) * overallLectureTimeCoefficient); }
private bool IsLecturerSuitable(Lecturer lecturer) { return(lecturer.HasPHD && lecturer.Experience > requiredYearsOfExperience); }
public void SetLecturer(int id, Lecturer Lecturer) { Lecturers.Add(id, Lecturer); }
public override double CalculateOverallLecturerTimeDedicatedToLecture(Lecturer lecturer, Lecture lecture) { return(base.CalculateOverallLecturerTimeDedicatedToLecture(lecturer, lecture) + afterHoursConsultationDuration); }