示例#1
0
 public InvigilatorHeuristic(Staff staff)
 {
     this.staff             = staff;
     this.heuristic         = 0;
     this.possibleCanditate = null;
 }
示例#2
0
 public InvigilatorHeuristic()
 {
     this.staff             = new Staff();
     this.heuristic         = 0;
     this.possibleCanditate = null;
 }
示例#3
0
文件: StaffDA.cs 项目: cslim1996/FYP
        public List <Staff> searchReliefInvigilators(DateTime date, string session)
        {
            List <Staff> reliefInvigilatorsList = new List <Staff>();

            try
            {
                /*Step 2: Create Sql Search statement and Sql Search Object*/
                strSearch = "Select S.name, S.gender, S.isMuslim, S.StaffID, S.title, S.position, S.facultyCode, S.department, S.isTakingSTSPhD, S.typeOfEmploy, S.NoOfSatSession, S.NoAsQuarantineInvi, S.NoAsReliefInvi, S.NoOfExtraSession, S.isChiefInvi, S.isInviAbove2Years From dbo.Staff S, Timeslot T, dbo.InvigilationDuty I Where S.typeOfEmploy = 'F' and T.Date = @Date And T.Session = @Session And T.TimeslotID = I.TimeslotID And I.StaffID = S.StaffID And I.CatOfInvi = 'Relief' Or I.CatOfInvi = 'Quarantine'";
                cmdSearch = new SqlCommand(strSearch, conn);

                cmdSearch.Parameters.AddWithValue("@Date", date);
                cmdSearch.Parameters.AddWithValue("@Session", session);

                /*Step 3: Execute command to retrieve data*/
                SqlDataReader dtr = cmdSearch.ExecuteReader();

                /*Step 4: Get result set from the query*/
                if (dtr.HasRows)
                {
                    while (dtr.Read())
                    {
                        string staffID = dtr["StaffID"].ToString();
                        MaintainInvigilationDutyControl maintainInvigilationDutyControl = new MaintainInvigilationDutyControl();
                        bool isMuslim          = false;
                        bool isTakingSTSPhD    = false;
                        bool isChiefInvi       = false;
                        bool isInviAbove2Years = false;
                        if (dtr["isMuslim"].ToString().Equals("Y"))
                        {
                            isMuslim = true;
                        }
                        else
                        {
                            isMuslim = false;
                        }
                        if (dtr["isTakingSTSPhD"].ToString().Equals("Y"))
                        {
                            isTakingSTSPhD = true;
                        }
                        else
                        {
                            isTakingSTSPhD = false;
                        }
                        if (dtr["isChiefInvi"].ToString().Equals("Y"))
                        {
                            isChiefInvi = true;
                        }
                        else
                        {
                            isChiefInvi = false;
                        }
                        if (dtr["isInviAbove2Years"].ToString().Equals("Y"))
                        {
                            isInviAbove2Years = true;
                        }
                        else
                        {
                            isInviAbove2Years = false;
                        }
                        Staff reliefInvigilator = new Staff(dtr["name"].ToString(), char.Parse(dtr["gender"].ToString()), isMuslim, dtr["StaffID"].ToString(),
                                                            dtr["title"].ToString(), dtr["position"].ToString(), dtr["facultyCode"].ToString(), dtr["department"].ToString(),
                                                            isTakingSTSPhD, char.Parse(dtr["typeOfEmploy"].ToString()), int.Parse(dtr["NoOfSatSession"].ToString()),
                                                            int.Parse(dtr["NoAsQuarantineInvi"].ToString()), int.Parse(dtr["NoAsReliefInvi"].ToString()), int.Parse(dtr["NoOfExtraSession"].ToString()),
                                                            isChiefInvi, isInviAbove2Years, new List <string>(), new List <Exemption>(), maintainInvigilationDutyControl.searchInvigilationDuty(staffID));
                        maintainInvigilationDutyControl.shutDown();

                        MaintainExemptionControl maintainExemptionControl = new MaintainExemptionControl();
                        reliefInvigilator.ExemptionList = maintainExemptionControl.searchExemptionList(staffID);
                        maintainExemptionControl.shutDown();
                        reliefInvigilatorsList.Add(reliefInvigilator);
                    }
                }
                dtr.Close();
            }
            catch (SqlException)
            {
                throw;
            }
            for (int i = 0; i < reliefInvigilatorsList.Count; i++)
            {
                reliefInvigilatorsList[i].PaperCodeExamined = searchPaperExamined(reliefInvigilatorsList[i].StaffID);
            }
            return(reliefInvigilatorsList);
        }
示例#4
0
文件: StaffDA.cs 项目: cslim1996/FYP
        public List <Staff> searchLecturer(DateTime date, string session, string faculty, string categoryOfInvigilator, bool isFacultyCheckOnly, double totalLoadOfDutyForEach)
        {
            List <Staff>            staffList = new List <Staff>();
            List <InvigilationDuty> invigilationDutiesList = new List <InvigilationDuty>();
            string     strSearch = "";
            SqlCommand cmdSearch;

            try
            {
                /*Step 2: Create Sql Search statement and Sql Search Object*/
                if (!isFacultyCheckOnly)
                {
                    if (categoryOfInvigilator.Equals("InviAbove2Years"))
                    {
                        strSearch = "Select S.name, S.gender, S.isMuslim, S.StaffID, S.title, S.position, S.facultyCode, S.department, S.isTakingSTSPhD, S.typeOfEmploy, S.NoOfSatSession, S.NoAsQuarantineInvi, S.NoAsReliefInvi, S.NoOfExtraSession, S.isChiefInvi, S.isInviAbove2Years From dbo.Staff S, dbo.InvigilationDuty I, dbo.Timeslot T Where S.typeOfEmploy = 'F' and S.isInviAbove2Years = 'Y' and isChiefInvi = 'N' and S.FacultyCode = @Faculty and T.Date = @Date And T.Session != @Session And T.TimeslotID = I.TimeslotID And I.StaffID = S.StaffID Group by S.name, S.gender, S.isMuslim, S.StaffID, S.title, S.position, S.facultyCode, S.department, S.isTakingSTSPhD, S.typeOfEmploy, S.NoOfSatSession, S.NoAsQuarantineInvi, S.NoAsReliefInvi, S.NoOfExtraSession, S.isChiefInvi, S.isInviAbove2Years Having COUNT(InvigilationDutyID) < @TotalLoad";
                    }
                    else if (categoryOfInvigilator.Equals("Invigilators"))
                    {
                        strSearch = "Select S.name, S.gender, S.isMuslim, S.StaffID, S.title, S.position, S.facultyCode, S.department, S.isTakingSTSPhD, S.typeOfEmploy, S.NoOfSatSession, S.NoAsQuarantineInvi, S.NoAsReliefInvi, S.NoOfExtraSession, S.isChiefInvi, S.isInviAbove2Years From dbo.Staff S, dbo.InvigilationDuty I, dbo.Timeslot T Where S.typeOfEmploy = 'F' and (isInvi = 'Y' or S.isInviAbove2Years = 'Y') and isChiefInvi = 'N' and S.FacultyCode = @Faculty and T.Date = @Date And T.Session != @Session And T.TimeslotID = I.TimeslotID And I.StaffID = S.StaffID Group by S.name, S.gender, S.isMuslim, S.StaffID, S.title, S.position, S.facultyCode, S.department, S.isTakingSTSPhD, S.typeOfEmploy, S.NoOfSatSession, S.NoAsQuarantineInvi, S.NoAsReliefInvi, S.NoOfExtraSession, S.isChiefInvi, S.isInviAbove2Years Having COUNT(InvigilationDutyID) < @TotalLoad";
                    }
                    else if (categoryOfInvigilator.Equals("Chief"))
                    {
                        strSearch = "Select S.name, S.gender, S.isMuslim, S.StaffID, S.title, S.position, S.facultyCode, S.department, S.isTakingSTSPhD, S.typeOfEmploy, S.NoOfSatSession, S.NoAsQuarantineInvi, S.NoAsReliefInvi, S.NoOfExtraSession, S.isChiefInvi, S.isInviAbove2Years From dbo.Staff S, dbo.InvigilationDuty I, dbo.Timeslot T Where S.typeOfEmploy = 'F' and S.isChiefInvi = 'Y' and S.FacultyCode = @Faculty and T.Date = @Date And T.Session != @Session And T.TimeslotID = I.TimeslotID And I.StaffID = S.StaffID Group by S.name, S.gender, S.isMuslim, S.StaffID, S.title, S.position, S.facultyCode, S.department, S.isTakingSTSPhD, S.typeOfEmploy, S.NoOfSatSession, S.NoAsQuarantineInvi, S.NoAsReliefInvi, S.NoOfExtraSession, S.isChiefInvi, S.isInviAbove2Years Having COUNT(InvigilationDutyID) < @TotalLoad";
                    }
                }
                else
                {
                    if (categoryOfInvigilator.Equals("InviAbove2Years"))
                    {
                        strSearch = "Select S.name, S.gender, S.isMuslim, S.StaffID, S.title, S.position, S.facultyCode, S.department, S.isTakingSTSPhD, S.typeOfEmploy, S.NoOfSatSession, S.NoAsQuarantineInvi, S.NoAsReliefInvi, S.NoOfExtraSession, S.isChiefInvi, S.isInviAbove2Years From dbo.Staff S, dbo.InvigilationDuty I, dbo.Timeslot T Where S.typeOfEmploy = 'F' and S.isInviAbove2Years = 'Y' and isChiefInvi = 'N' and S.FacultyCode = @Faculty and T.Date = @Date And T.Session = @Session And T.TimeslotID != I.TimeslotID And I.StaffID = S.StaffID Group by S.name, S.gender, S.isMuslim, S.StaffID, S.title, S.position, S.facultyCode, S.department, S.isTakingSTSPhD, S.typeOfEmploy, S.NoOfSatSession, S.NoAsQuarantineInvi, S.NoAsReliefInvi, S.NoOfExtraSession, S.isChiefInvi, S.isInviAbove2Years Having COUNT(InvigilationDutyID) < @TotalLoad";
                    }
                    else if (categoryOfInvigilator.Equals("Invigilators"))
                    {
                        strSearch = "Select S.name, S.gender, S.isMuslim, S.StaffID, S.title, S.position, S.facultyCode, S.department, S.isTakingSTSPhD, S.typeOfEmploy, S.NoOfSatSession, S.NoAsQuarantineInvi, S.NoAsReliefInvi, S.NoOfExtraSession, S.isChiefInvi, S.isInviAbove2Years From dbo.Staff S, dbo.InvigilationDuty I, dbo.Timeslot T Where S.typeOfEmploy = 'F' and (isInvi = 'Y' or S.isInviAbove2Years = 'Y') and isChiefInvi = 'N' and S.FacultyCode = @Faculty and T.Date = @Date And T.Session = @Session And T.TimeslotID != I.TimeslotID And I.StaffID = S.StaffID Group by S.name, S.gender, S.isMuslim, S.StaffID, S.title, S.position, S.facultyCode, S.department, S.isTakingSTSPhD, S.typeOfEmploy, S.NoOfSatSession, S.NoAsQuarantineInvi, S.NoAsReliefInvi, S.NoOfExtraSession, S.isChiefInvi, S.isInviAbove2Years Having COUNT(InvigilationDutyID) < @TotalLoad";
                    }
                    else if (categoryOfInvigilator.Equals("Chief"))
                    {
                        strSearch = "Select S.name, S.gender, S.isMuslim, S.StaffID, S.title, S.position, S.facultyCode, S.department, S.isTakingSTSPhD, S.typeOfEmploy, S.NoOfSatSession, S.NoAsQuarantineInvi, S.NoAsReliefInvi, S.NoOfExtraSession, S.isChiefInvi, S.isInviAbove2Years From dbo.Staff S, dbo.InvigilationDuty I, dbo.Timeslot T Where S.typeOfEmploy = 'F' and S.isChiefInvi = 'Y' and S.FacultyCode = @Faculty and T.Date = @Date And T.Session = @Session And T.TimeslotID != I.TimeslotID And I.StaffID = S.StaffID Group by S.name, S.gender, S.isMuslim, S.StaffID, S.title, S.position, S.facultyCode, S.department, S.isTakingSTSPhD, S.typeOfEmploy, S.NoOfSatSession, S.NoAsQuarantineInvi, S.NoAsReliefInvi, S.NoOfExtraSession, S.isChiefInvi, S.isInviAbove2Years Having COUNT(InvigilationDutyID) < @TotalLoad";
                    }
                }

                cmdSearch = new SqlCommand(strSearch, conn);
                cmdSearch.Parameters.AddWithValue("@Faculty", faculty);
                cmdSearch.Parameters.AddWithValue("@Date", date);
                cmdSearch.Parameters.AddWithValue("@Session", session);
                cmdSearch.Parameters.AddWithValue("@TotalLoad", totalLoadOfDutyForEach);

                /*Step 3: Execute command to retrieve data*/
                SqlDataReader dtr = cmdSearch.ExecuteReader();

                /*Step 4: Get result set from the query*/
                if (dtr.HasRows)
                {
                    while (dtr.Read())
                    {
                        string staffID = dtr["StaffID"].ToString();
                        MaintainInvigilationDutyControl maintainInvigilationDutyControl = new MaintainInvigilationDutyControl();
                        bool isMuslim          = false;
                        bool isTakingSTSPhD    = false;
                        bool isChiefInvi       = false;
                        bool isInviAbove2Years = false;
                        if (dtr["isMuslim"].ToString().Equals("Y"))
                        {
                            isMuslim = true;
                        }
                        else
                        {
                            isMuslim = false;
                        }
                        if (dtr["isTakingSTSPhD"].ToString().Equals("Y"))
                        {
                            isTakingSTSPhD = true;
                        }
                        else
                        {
                            isTakingSTSPhD = false;
                        }
                        if (dtr["isChiefInvi"].ToString().Equals("Y"))
                        {
                            isChiefInvi = true;
                        }
                        else
                        {
                            isChiefInvi = false;
                        }
                        if (dtr["isInviAbove2Years"].ToString().Equals("Y"))
                        {
                            isInviAbove2Years = true;
                        }
                        else
                        {
                            isInviAbove2Years = false;
                        }
                        Staff staff = new Staff(dtr["name"].ToString(), char.Parse(dtr["gender"].ToString()), isMuslim, dtr["StaffID"].ToString(),
                                                dtr["title"].ToString(), dtr["position"].ToString(), dtr["facultyCode"].ToString(), dtr["department"].ToString(),
                                                isTakingSTSPhD, char.Parse(dtr["typeOfEmploy"].ToString()), int.Parse(dtr["NoOfSatSession"].ToString()),
                                                int.Parse(dtr["NoAsQuarantineInvi"].ToString()), int.Parse(dtr["NoAsReliefInvi"].ToString()), int.Parse(dtr["NoOfExtraSession"].ToString()),
                                                isChiefInvi, isInviAbove2Years, new List <string>(), new List <Exemption>(), maintainInvigilationDutyControl.searchInvigilationDuty(staffID));
                        maintainInvigilationDutyControl.shutDown();

                        MaintainExemptionControl maintainExemptionControl = new MaintainExemptionControl();
                        staff.ExemptionList = maintainExemptionControl.searchExemptionList(staffID);
                        maintainExemptionControl.shutDown();
                        staffList.Add(staff);
                    }
                }
                dtr.Close();
            }
            catch (SqlException)
            {
                throw;
            }
            return(staffList);
        }
示例#5
0
文件: StaffDA.cs 项目: cslim1996/FYP
        public List <Staff> searchLecturer(string input, string criteria)
        {
            List <Staff>            staffList = new List <Staff>();
            List <InvigilationDuty> invigilationDutiesList = new List <InvigilationDuty>();
            string     strSearch;
            SqlCommand cmdSearch;

            try
            {
                if (criteria.Equals("faculty"))
                {
                    /*Step 2: Create Sql Search statement and Sql Search Object*/
                    strSearch = "Select S.name, S.gender, S.isMuslim, S.StaffID, S.title, S.position, S.facultyCode, S.department, S.isTakingSTSPhD, S.typeOfEmploy, S.NoOfSatSession, S.NoAsQuarantineInvi, S.NoAsReliefInvi, S.NoOfExtraSession, S.isChiefInvi, S.isInviAbove2Years From dbo.Staff S Where S.typeOfEmploy = 'F' and S.typeOfEmploy = 'F' and S.faculty = @Faculty";
                    cmdSearch = new SqlCommand(strSearch, conn);

                    cmdSearch.Parameters.AddWithValue("@Faculty", input);
                }
                else if (criteria.Equals("examAsInvi"))
                {
                    strSearch = "Select S.name, S.gender, S.isMuslim, S.StaffID, S.title, S.position, S.facultyCode, S.department, S.isTakingSTSPhD, S.typeOfEmploy, S.NoOfSatSession, S.NoAsQuarantineInvi, S.NoAsReliefInvi, S.NoOfExtraSession, S.isChiefInvi, S.isInviAbove2Years From dbo.Staff S, dbo.PaperExamined P Where S.typeOfEmploy = 'F' and P.CourseCode = @CourseCode And S.StaffID = P.StaffID And S.isExam = 'Y' And (S.isInvi = 'Y' or S.isInviAbove2Years = 'Y') And isChiefInvi = 'N'";
                    cmdSearch = new SqlCommand(strSearch, conn);

                    cmdSearch.Parameters.AddWithValue("@CourseCode", input);
                }
                else if (criteria.Equals("examAsChief"))
                {
                    strSearch = "Select S.name, S.gender, S.isMuslim, S.StaffID, S.title, S.position, S.facultyCode, S.department, S.isTakingSTSPhD, S.typeOfEmploy, S.NoOfSatSession, S.NoAsQuarantineInvi, S.NoAsReliefInvi, S.NoOfExtraSession, S.isChiefInvi, S.isInviAbove2Years From dbo.Staff S, dbo.PaperExamined P Where S.typeOfEmploy = 'F' and P.CourseCode = @CourseCode And S.StaffID = P.StaffID And S.isExam = 'Y' And isChiefInvi = 'Y'";
                    cmdSearch = new SqlCommand(strSearch, conn);

                    cmdSearch.Parameters.AddWithValue("@CourseCode", input);
                }
                else if (criteria.Equals("categoryOfInvigilator") && input.Equals("Chief"))
                {
                    strSearch = "Select S.name, S.gender, S.isMuslim, S.StaffID, S.title, S.position, S.facultyCode, S.department, S.isTakingSTSPhD, S.typeOfEmploy, S.NoOfSatSession, S.NoAsQuarantineInvi, S.NoAsReliefInvi, S.NoOfExtraSession, S.isChiefInvi, S.isInviAbove2Years From dbo.Staff S Where S.typeOfEmploy = 'F' and S.isChiefInvi = 'Y'";
                    cmdSearch = new SqlCommand(strSearch, conn);
                }
                else if (criteria.Equals("categoryOfInvigilator") && input.Equals("InviAbove2Years"))
                {
                    strSearch = "Select S.name, S.gender, S.isMuslim, S.StaffID, S.title, S.position, S.facultyCode, S.department, S.isTakingSTSPhD, S.typeOfEmploy, S.NoOfSatSession, S.NoAsQuarantineInvi, S.NoAsReliefInvi, S.NoOfExtraSession, S.isChiefInvi, S.isInviAbove2Years From dbo.Staff S Where S.typeOfEmploy = 'F' and S.isInviAbove2Years = 'Y' and isChiefInvi = 'N'";
                    cmdSearch = new SqlCommand(strSearch, conn);
                }
                else if (criteria.Equals("categoryOfInvigilator") && input.Equals("Invigilator"))
                {
                    strSearch = "Select S.name, S.gender, S.isMuslim, S.StaffID, S.title, S.position, S.facultyCode, S.department, S.isTakingSTSPhD, S.typeOfEmploy, S.NoOfSatSession, S.NoAsQuarantineInvi, S.NoAsReliefInvi, S.NoOfExtraSession, S.isChiefInvi, S.isInviAbove2Years From dbo.Staff S Where S.typeOfEmploy = 'F' and (isInvi = 'Y' or S.isInviAbove2Years = 'Y') and isChiefInvi = 'N'";
                    cmdSearch = new SqlCommand(strSearch, conn);
                }
                else if (criteria.Equals("isMuslim") && input.Equals("Muslim"))
                {
                    strSearch = "Select S.name, S.gender, S.isMuslim, S.StaffID, S.title, S.position, S.facultyCode, S.department, S.isTakingSTSPhD, S.typeOfEmploy, S.NoOfSatSession, S.NoAsQuarantineInvi, S.NoAsReliefInvi, S.NoOfExtraSession, S.isChiefInvi, S.isInviAbove2Years From dbo.Staff S Where S.typeOfEmploy = 'F' and (isInvi = 'Y' or S.isInviAbove2Years = 'Y') and isChiefInvi = 'N' and S.isMuslim = 'Y'";
                    cmdSearch = new SqlCommand(strSearch, conn);
                }
                else
                {
                    strSearch = "Select S.name, S.gender, S.isMuslim, S.StaffID, S.title, S.position, S.facultyCode, S.department, S.isTakingSTSPhD, S.typeOfEmploy, S.NoOfSatSession, S.NoAsQuarantineInvi, S.NoAsReliefInvi, S.NoOfExtraSession, S.isChiefInvi, S.isInviAbove2Years From dbo.Staff S Where S.typeOfEmploy = 'F'";
                    cmdSearch = new SqlCommand(strSearch, conn);
                }

                /*Step 3: Execute command to retrieve data*/
                SqlDataReader dtr = cmdSearch.ExecuteReader();

                /*Step 4: Get result set from the query*/
                if (dtr.HasRows)
                {
                    while (dtr.Read())
                    {
                        string staffID = dtr["StaffID"].ToString();
                        MaintainInvigilationDutyControl maintainInvigilationDutyControl = new MaintainInvigilationDutyControl();
                        bool isMuslim          = false;
                        bool isTakingSTSPhD    = false;
                        bool isChiefInvi       = false;
                        bool isInviAbove2Years = false;
                        if (dtr["isMuslim"].ToString().Equals("Y"))
                        {
                            isMuslim = true;
                        }
                        else
                        {
                            isMuslim = false;
                        }
                        if (dtr["isTakingSTSPhD"].ToString().Equals("Y"))
                        {
                            isTakingSTSPhD = true;
                        }
                        else
                        {
                            isTakingSTSPhD = false;
                        }
                        if (dtr["isChiefInvi"].ToString().Equals("Y"))
                        {
                            isChiefInvi = true;
                        }
                        else
                        {
                            isChiefInvi = false;
                        }
                        if (dtr["isInviAbove2Years"].ToString().Equals("Y"))
                        {
                            isInviAbove2Years = true;
                        }
                        else
                        {
                            isInviAbove2Years = false;
                        }
                        Staff staff = new Staff(dtr["name"].ToString(), char.Parse(dtr["gender"].ToString()), isMuslim, dtr["StaffID"].ToString(),
                                                dtr["title"].ToString(), dtr["position"].ToString(), dtr["facultyCode"].ToString(), dtr["department"].ToString(),
                                                isTakingSTSPhD, char.Parse(dtr["typeOfEmploy"].ToString()), int.Parse(dtr["NoOfSatSession"].ToString()),
                                                int.Parse(dtr["NoAsQuarantineInvi"].ToString()), int.Parse(dtr["NoAsReliefInvi"].ToString()), int.Parse(dtr["NoOfExtraSession"].ToString()),
                                                isChiefInvi, isInviAbove2Years, new List <string>(), new List <Exemption>(), maintainInvigilationDutyControl.searchInvigilationDuty(staffID));
                        maintainInvigilationDutyControl.shutDown();

                        MaintainExemptionControl maintainExemptionControl = new MaintainExemptionControl();
                        staff.ExemptionList = maintainExemptionControl.searchExemptionList(staffID);
                        maintainExemptionControl.shutDown();
                        staffList.Add(staff);
                    }
                }
                dtr.Close();
            }
            catch (SqlException)
            {
                throw;
            }
            return(staffList);
        }
示例#6
0
文件: StaffDA.cs 项目: cslim1996/FYP
        //invigilators only
        public List <Staff> getInvigilatorList()
        {
            List <Staff> staffList = new List <Staff>();

            try
            {
                /*Step 2: Create Sql Search statement and Sql Search Object*/
                strSearch = "Select * From dbo.Staff Where (isInvi = 'Y' or isInviAbove2Years = 'Y' or isChiefInvi ='Y') and TypeOfEmploy = 'F'";
                cmdSearch = new SqlCommand(strSearch, conn);

                /*Step 3: Execute command to retrieve data*/
                SqlDataReader dtr = cmdSearch.ExecuteReader();

                /*Step 4: Get result set from the query*/
                if (dtr.HasRows)
                {
                    while (dtr.Read())
                    {
                        bool?isTakingSTSPhD    = null;
                        bool?isMuslim          = null;
                        bool?isChiefInvi       = null;
                        bool?isInviAbove2years = null;
                        //convert isMuslim
                        if (Convert.ToChar(dtr["isMuslim"]).Equals('Y'))
                        {
                            isMuslim = true;
                        }
                        else if (Convert.ToChar(dtr["isMuslim"]).Equals('N'))
                        {
                            isMuslim = false;
                        }

                        if (Convert.ToChar(dtr["isTakingSTSPhD"]).Equals('Y'))
                        {
                            isTakingSTSPhD = true;
                        }
                        else if (Convert.ToChar(dtr["isTakingSTSPhD"]).Equals('N'))
                        {
                            isTakingSTSPhD = false;
                        }

                        if (Convert.ToChar(dtr["isChiefInvi"]).Equals('Y'))
                        {
                            isChiefInvi = true;
                        }
                        else if (Convert.ToChar(dtr["isChiefInvi"]).Equals('N'))
                        {
                            isChiefInvi = false;
                        }

                        if (Convert.ToChar(dtr["isInviAbove2Years"]).Equals('Y'))
                        {
                            isInviAbove2years = true;
                        }
                        else if (Convert.ToChar(dtr["isInviAbove2Years"]).Equals('N'))
                        {
                            isInviAbove2years = false;
                        }

                        Staff staff = new Staff(dtr["StaffID"].ToString(), isMuslim, isTakingSTSPhD,
                                                Convert.ToChar(dtr["typeOfEmploy"]), Convert.ToInt16(dtr["NoOfSatSession"]),
                                                Convert.ToInt16(dtr["noAsReliefInvi"]), Convert.ToInt16(dtr["NoOfExtraSession"]),
                                                isChiefInvi, isInviAbove2years, Convert.ToChar(dtr["Gender"]), Convert.ToChar(dtr["FacultyCode"]),
                                                Convert.ToInt16(dtr["NoOfEveningSession"]), Convert.ToInt16(dtr["NoAsQuarantineInvi"]));

                        staff.IsChief = Convert.ToChar(dtr["isChiefInvi"]);


                        staffList.Add(staff);
                    }
                    dtr.Close();
                }
            }
            catch (SqlException)
            {
                throw;
            }

            return(staffList);
        }