protected void OnCandidateStudyDeleteClicked(object sender, EventArgs e) { LinkButton lnkItem = (LinkButton)sender; int canFormationID = int.Parse(lnkItem.CommandArgument); CandidateTraining deleteItem = new CandidateTraining(canFormationID); CandidateTrainingRepository repo = new CandidateTrainingRepository(); repo.Delete(deleteItem); BindStudyGridOfCurrentCandidate(null); }
private CandidateTraining GetCadidateTraining() { CandidateTraining saveItem = new CandidateTraining(); if(SessionManager.CurrentCandidate != null) saveItem.CandidateID = SessionManager.CurrentCandidate.CandidateId; if (!string.IsNullOrEmpty(ddlPeriodeFrom.SelectedValue) && !string.IsNullOrEmpty(ddlPeriodeTo.SelectedValue)) { saveItem.Period = ddlPeriodeFrom.SelectedValue + "-" + ddlPeriodeTo.SelectedValue; } else { saveItem.Period = txtPeriodeString.Text; } if (!string.IsNullOrEmpty(ddlTraining.SelectedValue)) saveItem.FormationID = int.Parse(ddlTraining.SelectedValue); else saveItem.FormationID = null; saveItem.Diplome = txtDiploma.Text.Trim(); if (!string.IsNullOrEmpty(ddlLevel.SelectedValue)) saveItem.StudyLevelID = int.Parse(ddlLevel.SelectedValue); else saveItem.StudyLevelID = null; saveItem.School = txtSchool.Text.Trim(); return saveItem; }