private void LoadEvaluationTabData(Candidate candidate) { ParamLangueRepository languageRepo = new ParamLangueRepository(); ddlOtherLang.DataValueField = "LangueID"; ddlOtherLang.DataTextField = "LangueID"; ddlOtherLang.DataSource = languageRepo.FindAll(); ddlOtherLang.DataBind(); for (int i = 0; i <= 5; i++) { ddlFrenchLang.Items.Add(new RadComboBoxItem( ResourceManager.GetString("languageSkillLevel" + i), i.ToString())); ddlDutchLang.Items.Add(new RadComboBoxItem( ResourceManager.GetString("languageSkillLevel" + i), i.ToString())); ddlEnglishLang.Items.Add(new RadComboBoxItem( ResourceManager.GetString("languageSkillLevel" + i), i.ToString())); ddlGermanLang.Items.Add(new RadComboBoxItem( ResourceManager.GetString("languageSkillLevel" + i), i.ToString())); ddlSpainishLang.Items.Add(new RadComboBoxItem( ResourceManager.GetString("languageSkillLevel" + i), i.ToString())); ddlItalianLang.Items.Add(new RadComboBoxItem( ResourceManager.GetString("languageSkillLevel" + i), i.ToString())); ddlOtherLangSkill.Items.Add(new RadComboBoxItem( ResourceManager.GetString("languageSkillLevel" + i), i.ToString())); } if (candidate != null) { CandidateEvaluationRepository candidateEvalRepo = new CandidateEvaluationRepository(); CandidateEvaluation evaluation = candidateEvalRepo.GetCandidateEvaluation(candidate.CandidateId); if (evaluation != null) { SessionManager.CandidateEvaluation = evaluation; txtPresentationEval.Text = evaluation.PresentationEvaluation; txtGlobal.Text = evaluation.GlobalEvaluation; txtVerbal.Text = evaluation.ExpressionEvaluation; txtOtherEval.Text = evaluation.VariousMatters; txtAutonomy.Text = evaluation.SelfEvaluation; txtMotivationEval.Text = evaluation.MotivationEvaluation; txtPersonality.Text = evaluation.PersonalityEvaluation; ddlOtherLang.SelectedValue = evaluation.AdditionLanguage; if (evaluation.French.HasValue) ddlFrenchLang.SelectedValue = evaluation.French.Value.ToString(); if (evaluation.German.HasValue) ddlGermanLang.SelectedValue = evaluation.German.Value.ToString(); if (evaluation.Dutch.HasValue) ddlDutchLang.SelectedValue = evaluation.Dutch.Value.ToString(); if (evaluation.Spanish.HasValue) ddlSpainishLang.SelectedValue = evaluation.Spanish.Value.ToString(); if (evaluation.English.HasValue) ddlEnglishLang.SelectedValue = evaluation.English.Value.ToString(); if (evaluation.Italian.HasValue) ddlItalianLang.SelectedValue = evaluation.Italian.Value.ToString(); if (evaluation.AdditionLanguageScore.HasValue) ddlOtherLangSkill.SelectedValue = evaluation.AdditionLanguageScore.Value.ToString(); } } }
protected void OnLanguageDeleteClicked(object sender, EventArgs e) { LinkButton lnkItem = (LinkButton)sender; string languageID = lnkItem.CommandArgument; ParamLangue deleteItem = new ParamLangue(languageID); ParamLangueRepository repo = new ParamLangueRepository(); repo.Delete(deleteItem); BindGridData(); gridLanguage.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (SessionManager.CurrentUser == null) { Common.RedirectToLoginPage(this); return; } else if (!IsPostBack) { FillLabelLanguage(); if (Request.QueryString["LanguageID"] != null) { string languageID = Request.QueryString["LanguageID"]; ParamLangue language = new ParamLangueRepository().GetLanguageByID(languageID); txtLanguageID.Text = language.LangueID; txtLabel.Text = language.Label; } } }
private void BindGridData() { ParamLangueRepository repo = new ParamLangueRepository(); gridLanguage.DataSource = repo.GetAllLanguages(); }
protected void OnBtnSaveClicked(object sender, EventArgs e) { ParamLangueRepository repo = new ParamLangueRepository(); ParamLangue saveItem = new ParamLangue(); saveItem.LangueID = txtLanguageID.Text; saveItem.Label = txtLabel.Text; if (Request.QueryString["LanguageID"] == null) { //Insert new record ParamLangue oldItem = repo.GetLanguageByID(txtLanguageID.Text); if (oldItem == null) repo.InserNewLanguage(saveItem); else { string message = ResourceManager.GetString("itemAlreadyExist"); string script1 = "<script type=\"text/javascript\">"; script1 += " alert(\"" + message + "\");"; script1 += " </script>"; if (!ClientScript.IsClientScriptBlockRegistered("redirectUser")) ClientScript.RegisterStartupScript(this.GetType(), "redirectUser", script1); } } else { if (Request.QueryString["LanguageID"] == txtLanguageID.Text) { repo.Update(saveItem); } else { ParamLangue oldItem = repo.GetLanguageByID(Request.QueryString["LanguageID"]); if (oldItem.NumberIDUsed <= 0) { repo.Delete(oldItem); repo.InserNewLanguage(saveItem); } else { string message = ResourceManager.GetString("messageLanguageBeingUsed"); string script1 = "<script type=\"text/javascript\">"; script1 += " alert(\"" + message + "\");"; script1 += " </script>"; if (!ClientScript.IsClientScriptBlockRegistered("redirectUser")) ClientScript.RegisterStartupScript(this.GetType(), "redirectUser", script1); } } } string script = "<script type=\"text/javascript\">"; script += " OnBtnSaveClientClicked();"; script += " </script>"; if (!ClientScript.IsClientScriptBlockRegistered("redirectUser")) ClientScript.RegisterStartupScript(this.GetType(), "redirectUser", script); }