Beispiel #1
0
        // To check whether given vacancy reached 120% candidates of required candidates
        public bool filledstatus_20percent(int VacancyID)
        {
            List <ICandidateProfile> lstCandidateProfile = display_candidate_toPC();
            int count = 0, CandidatesRequired = 0;

            for (int i = 0; i < lstCandidateProfile.Count; i++)
            {
                if (lstCandidateProfile.ElementAt(i).get_VacancyID == VacancyID)
                {
                    count++;
                }
            }

            VacancyManager  objVacancy = new VacancyManager();
            List <IVacancy> lstVacancy = objVacancy.GetVacancy();

            for (int i = 0; i < lstVacancy.Count; i++)
            {
                if (lstVacancy.ElementAt(i).get_VacancyID == VacancyID)
                {
                    CandidatesRequired = lstVacancy.ElementAt(i).get_NoOfPositions;
                }
            }

            if (count >= 1.2 * (CandidatesRequired))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #2
0
        // To check whether given vacancy is before required by date
        public bool filledstatus_bydate_TestID(int VacancyID)
        {
            DateTime RequiredByDate = DateTime.MinValue, currentdate = DateTime.Now;

            VacancyManager  objVacancyManager = new VacancyManager();
            List <IVacancy> lstVacancy        = objVacancyManager.GetVacancy();

            for (int i = 0; i < lstVacancy.Count; i++)
            {
                if (lstVacancy.ElementAt(i).get_VacancyID == VacancyID)
                {
                    RequiredByDate = lstVacancy.ElementAt(i).get_RequiredByDate;
                    break;
                }
            }



            TimeSpan time_span = new TimeSpan();

            time_span = RequiredByDate - currentdate;


            if (time_span.Days > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #3
0
        // To add candidates.
        public int AddCandidateProfile(ICandidateProfile cand)
        {
            try
            {
                ICandidateDB   objCandidateDB    = CandidateDBFactory.Create_CandidateDB();
                VacancyManager objvacancymanager = new VacancyManager();

                if (filledstatus_50percent(cand.get_VacancyID) == false)
                {
                    if (filledstatus_bydate(cand.get_VacancyID) == false)
                    {
                        objCandidateDB.save(cand);
                        return(1);
                    }
                    else if ((filledstatus_bydate(cand.get_VacancyID) == true) && (filledstatus_20percent(cand.get_VacancyID) == true))
                    {
                        objvacancymanager.updateStatus(cand.get_VacancyID, 2);
                        return(3);
                    }
                    else
                    {
                        return(0);
                    }
                }
                else if ((filledstatus_50percent(cand.get_VacancyID) == true) && (filledstatus_bydate(cand.get_VacancyID) == true))
                {
                    objvacancymanager.updateStatus(cand.get_VacancyID, 2);
                    return(2);
                }
                else
                {
                    return(0);
                }
            }
            catch (Exception EX)
            {
                Console.WriteLine(EX);
                return(0);
            }
        }
Beispiel #4
0
        public int  CheckDetails(int TestAdminID, int VacancyID, DateTime WrittenTestDate, DateTime TechnicalTestDate, DateTime HRInterviewDate)
        {
            int exist = Validate_VacancyID(TestAdminID, VacancyID);

            if (exist == 1)
            {
                return(1);
            }
            else if (exist == 2)
            {
                return(2);
            }

            VacancyManager  objVacancyManager = new VacancyManager();
            List <IVacancy> ListVacancy       = new  List <IVacancy>();

            ListVacancy = objVacancyManager.GetVacancy();

            foreach (IVacancy objVacancy in ListVacancy)
            {
                if (VacancyID == objVacancy.get_VacancyID)
                {
                    RequiredByDate = objVacancy.get_RequiredByDate;
                }
            }
            if (WrittenTestDate < DateTime.Now)
            {
                return(3);
            }
            else if (TechnicalTestDate < DateTime.Now)
            {
                return(4);
            }
            else if (HRInterviewDate < DateTime.Now)
            {
                return(5);
            }
            else if (WrittenTestDate == TechnicalTestDate)
            {
                return(6);
            }
            else if (TechnicalTestDate == HRInterviewDate)
            {
                return(7);
            }
            else if (HRInterviewDate == WrittenTestDate)
            {
                return(8);
            }
            else if (WrittenTestDate == TechnicalTestDate && TechnicalTestDate == HRInterviewDate)
            {
                return(9);
            }
            else if (WrittenTestDate > RequiredByDate)
            {
                return(10);
            }
            else if (TechnicalTestDate > RequiredByDate)
            {
                return(11);
            }
            else if (HRInterviewDate > RequiredByDate)
            {
                return(12);
            }
            else if (WrittenTestDate > TechnicalTestDate)
            {
                return(13);
            }
            else if (TechnicalTestDate > HRInterviewDate)
            {
                return(14);
            }
            else if (WrittenTestDate > HRInterviewDate)
            {
                return(15);
            }
            else if (TechnicalTestDate < WrittenTestDate.AddDays(2))
            {
                return(16);
            }
            else if (HRInterviewDate < TechnicalTestDate.AddDays(2))
            {
                return(17);
            }
            else
            {
                return(0);
            }
        }