Beispiel #1
0
        protected void btnDelete_Click(object sender, ImageClickEventArgs e)
        {
            ImageButton Delete = (ImageButton)sender;
            string      IDVal  = Delete.CommandArgument;
            int         id     = int.Parse(IDVal);

            HEWDataContext context = new HEWDataContext();

            Model.Vacancy nVacancy = context.Vacancies.SingleOrDefault(i => i.ID == id);
            context.Vacancies.DeleteOnSubmit(nVacancy);
            context.SubmitChanges();
            gvCareers.DataBind();
        }
Beispiel #2
0
        private void RenderVacancyItem(int vacancyItem)
        {
            Model.Vacancy vacancyObj = Model.Repositories.CareersRepository.GetVacancy(vacancyItem);
            if (vacancyObj == null)
            {
                Response.Redirect("Default.aspx");
            }

            txtVacancy.Text             = vacancyObj.Vacancy1;
            ddlCategories.SelectedValue = vacancyObj.CategoryID.ToString();
            txtLocation.Text            = vacancyObj.Location;
            txtDescription.Text         = vacancyObj.JobDescription;
            txtSkills.Text        = vacancyObj.RequiredSkills;
            txtOpenings.Text      = vacancyObj.Openings.ToString();
            txtOpeningDate.Text   = vacancyObj.OpeningDate.ToString("dd/MM/yyyy");
            cbIsPublished.Checked = vacancyObj.IsPublished;
        }