Esempio n. 1
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");
            }
        }
 public Submit_jobapplication(BrowseJobs browseJobs, Vacancy_details vacancy, int id, int vacanId)
 {
     InitializeComponent();
     _db    = new Jobapp_dbEntities();
     _jbsId = id;
     VId    = vacanId;
     //MessageBox.Show($"fsdfs: {_jbsId}");
 }
 public void Populate(Vacancy_details change_vacancy)
 {
     // MessageBox.Show($"{vacan_id}");
     // var change_vacancy = _db.Vacancy_details.FirstOrDefault(q => q.id == vacan_id);
     lb_id.Text    = change_vacancy.id.ToString();
     JobTitle.Text = change_vacancy.Job_title;
     JobDesc.Text  = change_vacancy.Job_Discription;
     JobReq.Text   = change_vacancy.Job_Requirements;
     JobLevel.Text = change_vacancy.Job_level;
     EmpType.Text  = change_vacancy.Employment_type;
     Deadline.Text = change_vacancy.Submit_deadline.ToString();
     JobCat.Text   = change_vacancy.Job_category;
 }
 public Submit_jobapplication(BrowseJobs browseJobs, Vacancy_details vacancy)
 {
     InitializeComponent();
     _db = new Jobapp_dbEntities();
 }
 public EditVacancy(Vacancy_details change_vacancy)
 {
     InitializeComponent();
     _db = new Jobapp_dbEntities();
     Populate(change_vacancy);
 }