Ejemplo n.º 1
0
        private void yes_btn_Click(object sender, EventArgs e)
        {
            if (_userType == Type.Employer)
            {
                EmployerRatesController rateController     = new EmployerRatesController();
                EmployerController      employerController = new EmployerController();
                Employer emp = employerController.Select(_myId);

                var jobs = _employerControl.Positions.Items;

                foreach (Job j in jobs)
                {
                    EmployerRates rate = null;
                    if (_employerControl.Positions.CheckedItems.Contains(j))
                    {
                        rate = new EmployerRates()
                        {
                            Employer_Id  = _myId,
                            JobSeeker_Id = _jobSeeker.Id,
                            Job_Id       = j.Id,
                            Rate         = true
                        };
                    }
                    else
                    {
                        rate = new EmployerRates()
                        {
                            Employer_Id  = _myId,
                            JobSeeker_Id = _jobSeeker.Id,
                            Job_Id       = j.Id,
                            Rate         = false
                        };
                    }
                    rateController.Insert(rate);
                }

                ResetEmployerViewFields();
                EmployersView();
            }
            if (_userType == Type.JobSeeker)
            {
                JobSeekerRatesController rateController      = new JobSeekerRatesController();
                JobSeekerController      jobSeekerController = new JobSeekerController();
                JobSeeker      jobSeeker = jobSeekerController.Select(_myId);
                JobSeekerRates rate      = new JobSeekerRates()
                {
                    JobSeeker_Id = _myId,
                    Job_Id       = _job.Id,
                    Rate         = true
                };
                rateController.Insert(rate);
                ResetJobSeekerViewFields();
                JobSeekersView();
            }
        }
Ejemplo n.º 2
0
        private void EmployersView()
        {
            try
            {
                EmployerRatesController empRatesContr = new EmployerRatesController();
                while (empRatesContr.ExistsRate(_myId, _jobSeekers.Take(1).Single().Id))
                {
                    _jobSeekers = _jobSeekers.Skip(1).ToList();
                }
                _jobSeeker = _jobSeekers.Take(1).Single();

                _employerControl.JobSeekerName    = string.Format("{0} {1}", _jobSeeker.Profile.FirstName, _jobSeeker.Profile.LastName);
                _employerControl.ContactData      = _jobSeeker.Profile.ContactData;
                _employerControl.ShortDescription = _jobSeeker.Profile.ShortDescription;
                _employerControl.WorkExperience   = _jobSeeker.Profile.WorkExperience;
                _employerControl.Education        = _jobSeeker.Profile.Education;

                SkillController skillController = new SkillController();
                var             skills          = skillController.GetSkills(_jobSeeker.Profile.JobSeeker_Id);
                foreach (Skill skill in skills)
                {
                    _employerControl.Skills.Items.Add(new ListViewItem(skill.Skill1));
                }


                JobController jobController = new JobController();
                var           jobs          = jobController.GetJobs().Where(x => x.Employer_Id == _myId);

                foreach (Job j in jobs)
                {
                    _employerControl.Positions.Items.Add(j);
                }

                _jobSeekers = _jobSeekers.Skip(1).ToList();
            }
            catch (Exception ex)
            {
                Trace.WriteLine(ex.Message);
                MessageBox.Show("No more Job Seekers!");
                Dispose();
            }
        }
Ejemplo n.º 3
0
        public Image SetCompanysRate(int job_id, int jobSeeker_id)
        {
            EmployerRatesController empRatesController = new EmployerRatesController();
            var empRates = empRatesController.GetRates();


            bool value;

            if (empRatesController.ExistsRateByJob(job_id, jobSeeker_id))
            {
                value = empRates.SingleOrDefault(x => x.Job_Id == job_id && x.JobSeeker_Id == jobSeeker_id).Rate;
                if (value == true)
                {
                    return(_yesImg);
                }
                if (value == false)
                {
                    return(_noImg);
                }
            }

            return(_maybeImg);
        }
Ejemplo n.º 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            EmployerRatesController empRatesController = new EmployerRatesController();

            empRatesController.DeleteAllRates(_myId);
        }