private void Submit_bt_Click(object sender, EventArgs e)
        {
            var resume = new Resume_details
            {
                Education_level       = edu_tb.Text,
                Contact_number        = cont_tb.Text,
                Hobbies               = hobby_tb.Text,
                Email                 = email_tb.Text,
                PriorWork_Experiences = exper_tb.Text,
                Qualifications        = qualifica_tb.Text
            };

            _db.Resume_details.Add(resume);
            _db.SaveChanges();


            lb_id.Text = resume.id.ToString();

            ;

            var Id      = int.Parse(lb_id.Text);
            var vacancy = _db.Vacancy_details.FirstOrDefault(q => q.id == Id);

            //   _db.SaveChanges();

            // _db.Job_Applications_details.Add(this, vacancy, resume);
            _db.SaveChanges();

            MessageBox.Show("you have sucessfully applied for position");
        }
        private void Submit_bt_Click(object sender, EventArgs e)
        {
            if (iseditmode == true)
            {
                try
                {
                    var Id     = int.Parse(lb_id.Text);
                    var resume = _db.Resume_details.FirstOrDefault(q => q.id == Id);
                    resume.Education_level       = edu_tb.Text;
                    resume.Contact_number        = cont_tb.Text;
                    resume.Hobbies               = hobby_tb.Text;
                    resume.Email                 = email_tb.Text;
                    resume.PriorWork_Experiences = exper_tb.Text;
                    resume.Qualifications        = qualifica_tb.Text;
                    //resume.Jobseeker_details_id = ID;
                    // _db.Resume_details.Add
                    _db.SaveChanges();

                    MessageBox.Show("Resume was successfully Edited");

                    Close();
                }
                catch (Exception)
                {
                    MessageBox.Show("error");
                }
            }
            else
            {
                try
                {
                    var add_resume = new Resume_details
                    {
                        Education_level       = edu_tb.Text,
                        Contact_number        = cont_tb.Text,
                        Hobbies               = hobby_tb.Text,
                        Email                 = email_tb.Text,
                        PriorWork_Experiences = exper_tb.Text,
                        Qualifications        = qualifica_tb.Text,
                        // Jobseeker_details_id = ID
                    };

                    _db.Resume_details.Add(add_resume);
                    _db.SaveChanges();

                    MessageBox.Show("Resume was successfully added");

                    Close();
                }
                catch (Exception)
                {
                    MessageBox.Show("error");

                    // throw;
                }
            }
        }
Beispiel #3
0
        private void AddNewVacancy(object sender, EventArgs e)
        {
            var title    = JobTitle1.Text;
            var JobReq   = JobRequirement.Text;
            var Desc     = JobDescription.Text;
            var lvl      = JobLvl.Text;
            var empType  = employType.Text;
            var Deadline = DeadlineDate.Value;
            var Cate     = JobCategory.Text;


            if (string.IsNullOrWhiteSpace(title) || string.IsNullOrWhiteSpace(JobReq) || string.IsNullOrWhiteSpace(Desc) || string.IsNullOrWhiteSpace(lvl) || string.IsNullOrWhiteSpace(empType) || string.IsNullOrWhiteSpace(Cate))
            {
                // IsValid = false;
                MessageBox.Show("Fill out allw fields");
            }
            else
            {
                var vacancy_detal_details = new Vacancy_details
                {
                    Job_title        = title,
                    Job_Discription  = Desc,
                    Job_Requirements = JobReq,
                    Job_level        = lvl,
                    Employment_type  = empType,
                    Submit_deadline  = Deadline,
                    Job_category     = Cate,
                    Employers_id     = emp_id
                };

                _db.Vacancy_details.Add(vacancy_detal_details);
                _db.SaveChanges();
                MessageBox.Show("Vacancy have been saved");
            }
        }
Beispiel #4
0
        private void del_bt_Click(object sender, EventArgs e)
        {
            var ID             = (int)vacancy.SelectedRows[0].Cells["id"].Value;
            var change_vacancy = _db.Vacancy_details.FirstOrDefault(q => q.id == ID);

            _db.Vacancy_details.Remove(change_vacancy);
            _db.SaveChanges();
            MessageBox.Show("Delete was successful");
        }
Beispiel #5
0
        private void Create_emp_bt_Click(object sender, EventArgs e)
        {
            try
            {
                var company_name           = compan_name_tb.Text;
                var company_background     = companinfo_tb.Text;
                var company_location       = compan_loca_tb.Text;
                var company_contact_number = company_contact_tb.Text;
                var workforce     = int.Parse(work_force_tb.Text);
                var company_email = company_email_tb.Text;
                var industry_type = industry_type_tb.Text;
                var password      = password_tb.Text;



                if (string.IsNullOrWhiteSpace(company_name) || string.IsNullOrWhiteSpace(company_email) || string.IsNullOrWhiteSpace(company_background) || string.IsNullOrWhiteSpace(company_location) || string.IsNullOrWhiteSpace(company_contact_number) || string.IsNullOrWhiteSpace(industry_type))
                {
                    // IsValid = false;
                    MessageBox.Show("Error, required fields were not populated");
                }
                if (workforce == 0)
                {
                    MessageBox.Show("Error, required fields were not populated");
                }
                else
                {
                    var hashed_password = Utils.HashedPassword(password);

                    var Employer_details = new Employer_details
                    {
                        Company_name           = company_name,
                        Company_background     = company_background,
                        Company_locatiion      = company_location,
                        Campany_contact_number = company_contact_number,
                        Workforce_number       = workforce,
                        Company_Email          = company_email,
                        Industry_type          = industry_type,
                        Password = hashed_password
                    };

                    _db.Employer_details.Add(Employer_details);
                    _db.SaveChanges();

                    MessageBox.Show("Registration was successful");

                    this.Close();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                //throw;
            }
        }
Beispiel #6
0
        private void Submit_bt_Click(object sender, EventArgs e)
        {
            try
            {
                var Education_level       = edu_tb.Text;
                var Contact_number        = cont_tb.Text;
                var Hobbies               = hobby_tb.Text;
                var Email                 = email_tb.Text;
                var PriorWork_Experiences = exper_tb.Text;
                var Qualifications        = qualifica_tb.Text;

                // var vacancy_id = v
                var Resume_details = new Resume_details
                {
                    Education_level       = Education_level,
                    Contact_number        = Contact_number,
                    Hobbies               = Hobbies,
                    Email                 = Email,
                    PriorWork_Experiences = PriorWork_Experiences,
                    Qualifications        = Qualifications
                };

                _db.Resume_details.Add(Resume_details);
                _db.SaveChanges();

                var resume_id = Resume_details.id;


                var Job_Applications_details = new Job_Applications_details
                {
                    resume_id = resume_id,
                };

                _db.Job_Applications_details.Add(Job_Applications_details);
                _db.SaveChanges();
            }
            catch (Exception)
            {
                // throw;
            }
        }
Beispiel #7
0
        private void SaveChangesVacancy(object sender, EventArgs e)
        {
            var vac = _db.Vacancy_details.FirstOrDefault(q => q.id == vacan_id);

            vac.Job_title        = JobTitle.Text;
            vac.Job_Discription  = JobDesc.Text;
            vac.Job_Requirements = JobReq.Text;
            vac.Job_level        = JobLevel.Text;
            vac.Employment_type  = EmpType.Text;
            //Deadline.Value = vacancy.Submit_deadline;
            vac.Job_category = JobCat.Text;

            _db.SaveChanges();
        }
        private void Register_bt_Click(object sender, EventArgs e)
        {
            try
            {
                var First_name = textBox_fname.Text;
                var Last_name  = textBox_lname.Text;
                int age        = int.Parse(textBox_age.Text);
                var User_name  = textBox_username.Text;
                var password   = textBox_createpass.Text;
                var IsValid    = true;



                if (string.IsNullOrWhiteSpace(First_name) || string.IsNullOrWhiteSpace(Last_name) || string.IsNullOrWhiteSpace(User_name) || string.IsNullOrWhiteSpace(password))
                {
                    IsValid = false;
                    MessageBox.Show("Error, required fields were not populated");
                }
                if (age <= 0 || age < 18)
                {
                    IsValid = false;
                    MessageBox.Show("Too young for this application");
                }

                if (IsValid)
                {
                    var hashed_password = Utils.HashedPassword(password);


                    var jobJobseeker_detail = new Jobseeker_details
                    {
                        First_name    = First_name,
                        Last_name     = Last_name,
                        User_Name     = User_name,
                        Jobseeker_age = age,
                        Password      = hashed_password
                    };

                    _db.Jobseeker_details.Add(jobJobseeker_detail);
                    _db.SaveChanges();

                    MessageBox.Show("Registration was successful");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                // throw;
            }
        }
        private void SaveChangesVacancy(object sender, EventArgs e)
        {
            var Id  = int.Parse(lb_id.Text);
            var vac = _db.Vacancy_details.FirstOrDefault(q => q.id == Id);

            vac.Job_title        = JobTitle.Text;
            vac.Job_Discription  = JobDesc.Text;
            vac.Job_Requirements = JobReq.Text;
            vac.Job_level        = JobLevel.Text;
            vac.Employment_type  = EmpType.Text;
            vac.Submit_deadline  = Deadline.Value;
            vac.Job_category     = JobCat.Text;

            _db.SaveChanges();

            MessageBox.Show("Vacancy was sucessfully updated");
            Close();
        }
Beispiel #10
0
        private void Delete_bt_Click(object sender, EventArgs e)
        {
            try
            {
                var ID     = (int)dgv_resumeview.SelectedRows[0].Cells["ID"].Value;
                var resume = _db.Resume_details.FirstOrDefault(q => q.id == ID);

                _db.Resume_details.Remove(resume);
                _db.SaveChanges();
                MessageBox.Show("Delete was successful");

                dgv_resumeview.Refresh();
            }
            catch (Exception)
            {
                MessageBox.Show("error");
                // throw;
            }
        }
        private void Submit_bt_Click(object sender, EventArgs e)
        {
            try
            {
                var id = int.Parse(lb_id.Text);
                var Job_Applications_details = _db.Job_Applications_details.FirstOrDefault(q => q.id == id);

                Job_Applications_details.Application_status = Status_tb.Text;
                _db.SaveChanges();

                MessageBox.Show("Resume was successfully Edited");

                Close();
            }
            catch (Exception)
            {
                MessageBox.Show("error");
            }
        }
        private void Submit_bt_Click(object sender, EventArgs e)
        {
            try
            {
                // var JobSkrTable = new Resume_details();
                var Data          = _db.Resume_details.FirstOrDefault(q => q.id == 3);
                var JobseekerData = _db.Resume_details.FirstOrDefault(q => q.Jobseeker_details_id == _jbsId);
                var ResumeId      = JobseekerData.id;

                // int ResumeId = Data.id;

                var Applicant = new Job_Applications_details
                {
                    resume_id          = ResumeId,
                    Jobseeker_id       = _jbsId,
                    vacancy_id         = VId,
                    Application_status = "Pending"
                };

                _db.Job_Applications_details.Add(Applicant);
                _db.SaveChanges();
                MessageBox.Show("Job application was successfull");
                this.Close();
                // lb_id.Text = resume.id.ToString();


                var Id      = int.Parse(lb_id.Text);
                var vacancy = _db.Vacancy_details.FirstOrDefault(q => q.id == Id);

                //   _db.SaveChanges();

                // _db.Job_Applications_details.Add(this, vacancy, resume);
                // _db.SaveChanges();*/
            }
            catch (Exception)
            {
                MessageBox.Show("Job application was successfull");
                // throw;
            }
        }