Exemplo n.º 1
0
    /// <summary>
    /// Save candidate evaluation
    /// </summary>
    /// <param name="candidate"></param>
    private void SaveCandidateEvaluation(Candidate candidate)
    {
        bool isNew = false;
        CandidateEvaluation evaluation = null;
        if (SessionManager.CandidateEvaluation != null)
        {
            evaluation = SessionManager.CandidateEvaluation;
        }
        else
        {
            isNew = true;
            evaluation = new CandidateEvaluation();
            evaluation.CandidateID = candidate.CandidateId;
        }

        evaluation.PresentationEvaluation = txtPresentationEval.Text.Trim();
        evaluation.GlobalEvaluation = txtGlobal.Text.Trim();
        evaluation.ExpressionEvaluation = txtVerbal.Text.Trim();
        evaluation.VariousMatters = txtOtherEval.Text.Trim();
        evaluation.SelfEvaluation = txtAutonomy.Text.Trim();
        evaluation.MotivationEvaluation = txtMotivationEval.Text.Trim();
        evaluation.PersonalityEvaluation = txtPersonality.Text.Trim();
        evaluation.French = Convert.ToInt16(ddlFrenchLang.SelectedValue);
        evaluation.German = Convert.ToInt16(ddlGermanLang.SelectedValue);
        evaluation.Dutch = Convert.ToInt16(ddlDutchLang.SelectedValue);
        evaluation.Spanish = Convert.ToInt16(ddlSpainishLang.SelectedValue);
        evaluation.English = Convert.ToInt16(ddlEnglishLang.SelectedValue);
        evaluation.Italian = Convert.ToInt16(ddlItalianLang.SelectedValue);

        //Other language:
        evaluation.AdditionLanguage = ddlOtherLang.SelectedValue;
        if (evaluation.AdditionLanguage != null)
        {
            evaluation.AdditionLanguageScore = Convert.ToInt16(ddlOtherLangSkill.SelectedValue);
        }

        CandidateEvaluationRepository repo = new CandidateEvaluationRepository();
        if (isNew)
            repo.InsertNewEvaluation(evaluation);
        else
            repo.Update(evaluation);
        SessionManager.CandidateEvaluation = evaluation;
    }
Exemplo n.º 2
0
    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();
            }
        }
    }