Exemple #1
0
        // GET: CompanyJob
        public ActionResult Index()
        {
            List <JobInformation> jobInfoList = new List <JobInformation>();
            //Company Job via WebAPI
            var request     = new RestRequest("api/careercloud/company/v1/job");
            var response    = client.Execute <CompanyJobPoco>(request);
            var companyJobs = JsonConvert.DeserializeObject <IEnumerable <CompanyJobPoco> >(response.Content);

            foreach (var companyJob in companyJobs)
            {
                JobInformation jobInformation = new JobInformation();

                CompanyJobDescriptionPoco companyJobDescriptionPoco;

                jobInformation.profileCreated = companyJob.ProfileCreated;
                jobInformation.companyJobPoco = companyJob;


                CompanyJobDescriptionRepository companyJobDescriptionRepository = new CompanyJobDescriptionRepository();
                CompanyJobDescriptionLogic      companyJobDescriptionLogic      = new CompanyJobDescriptionLogic(companyJobDescriptionRepository);
                companyJobDescriptionPoco = companyJobDescriptionLogic.GetAll().Where(s => s.Job == companyJob.Id).FirstOrDefault();

                if (companyJobDescriptionPoco == null)
                {
                    continue;
                }

                jobInformation.jobName        = companyJobDescriptionPoco.JobName;
                jobInformation.jobDescription = companyJobDescriptionPoco.JobDescriptions;


                CompanyProfilePoco       companyProfilePoco;
                CompanyProfileRepository companyProfileRepository = new CompanyProfileRepository();
                CompanyProfileLogic      companyProfileLogic      = new CompanyProfileLogic(companyProfileRepository);
                companyProfilePoco = companyProfileLogic.GetAll().Where(s => s.Id == companyJob.Company).FirstOrDefault();

                if (companyProfilePoco == null)
                {
                    continue;
                }



                CompanyDescriptionPoco       companyDescriptionPoco;
                CompanyDescriptionRepository companyDescriptionRepository = new CompanyDescriptionRepository();
                CompanyDescriptionLogic      companyDescriptionLogic      = new CompanyDescriptionLogic(companyDescriptionRepository);
                companyDescriptionPoco = companyDescriptionLogic.GetAll().Where(s => s.Company == companyProfilePoco.Id).FirstOrDefault();

                if (companyDescriptionPoco == null)
                {
                    continue;
                }

                jobInformation.companyName = companyDescriptionPoco.CompanyName;
                jobInfoList.Add(jobInformation);
            }

            return(View(jobInfoList));
        }
Exemple #2
0
        public ActionResult JobsCreatedByCompany()
        {
            Guid companyId = (Guid)Session["Company"];

            CompanyJobRepository repository = new CompanyJobRepository();
            CompanyJobLogic      logic      = new CompanyJobLogic(repository);
            var companyJobs = logic.GetAll().Where(s => s.Company == companyId);

            List <JobInformation> jobInfoList = new List <JobInformation>();

            foreach (var companyJob in companyJobs)
            {
                JobInformation jobInformation = new JobInformation();

                CompanyJobDescriptionPoco companyJobDescriptionPoco;

                jobInformation.profileCreated = companyJob.ProfileCreated;
                jobInformation.companyJobPoco = companyJob;


                CompanyJobDescriptionRepository companyJobDescriptionRepository = new CompanyJobDescriptionRepository();
                CompanyJobDescriptionLogic      companyJobDescriptionLogic      = new CompanyJobDescriptionLogic(companyJobDescriptionRepository);
                companyJobDescriptionPoco = companyJobDescriptionLogic.GetAll().Where(s => s.Job == companyJob.Id).FirstOrDefault();

                if (companyJobDescriptionPoco == null)
                {
                    continue;
                }

                jobInformation.jobName        = companyJobDescriptionPoco.JobName;
                jobInformation.jobDescription = companyJobDescriptionPoco.JobDescriptions;


                jobInfoList.Add(jobInformation);
            }

            return(View(jobInfoList));
        }