예제 #1
0
        public List <Applicant> ListRespectiveApplicants(ApplicantsDataAccess applicantsDataAccess)
        {
            if (IsStaffing())
            {
                return(applicantsDataAccess.GetAllApplicants());
            }
            else if (IsManager())
            {
                return(applicantsDataAccess.GetApplicantsByHiringManager(LoggedInEmployee.Name));
            }

            return(null);
        }
예제 #2
0
        public bool GetApplicantDetails(ApplicantsDataAccess applicantsDataAccess, ref Applicant applicant, int?id)
        {
            if (IsStaffing())
            {
                applicant = applicantsDataAccess.GetApplicantById(id);
                return(true);
            }
            else if (IsManager())
            {
                var app = applicantsDataAccess.GetApplicantById(id);
                if (app != null)
                {
                    var appsInTeam = applicantsDataAccess.GetApplicantsByHiringManager(LoggedInEmployee.Name);
                    if (appsInTeam.Exists(a => a.Id == app.Id))
                    {
                        applicant = app;
                    }
                    return(applicant.Id != 0);
                }
            }

            return(false);
        }