Ejemplo n.º 1
0
    protected void btnCompleteVacancy_Click(object sender, EventArgs e)
    {
        string vacancyWithTitle = "";
        try
        {
            if (DropDVacancyProcessed.SelectedValue != "-1")
            {
                vacancyWithTitle = DropDVacancyProcessed.SelectedItem.Text;
            }
            else
            {
                lblSelectVacmsg.Visible = true;
                return;
            }
        }
        catch (Exception)
        {
            lblSelectVacmsg.Visible = true;
            lblSelectVacmsg.Text = "Something went wrong. Please contact your administrator";
            return;
        }
        readInputsAndInitVariables();
        
        PanelVacList.Visible = false;
        PanelConfirmVacancyComplete.Visible = true;
        btnConfirmComplete.Visible = true;
        PanelCurrentVacancySelected.Visible = false;
        EmpInfoRatingPanel.Visible = false;


        //Verify if vacancy complete is possible.
        VacancyEvaluationForm evaluationForm = new VacancyEvaluationForm();
        evaluationForm.VacancyNo = vacancyNo.Trim();
        evaluationForm.VacancyDate = VacancyDate.Trim();
        VacancyRegistrationAndEvaluationManager manager = new VacancyRegistrationAndEvaluationManager(evaluationForm);
        TransactionResponse response = manager.getNotEvaluatedApplicantsForSecondPhase(Convert.ToInt32(isGenOrGSpecificForm));

        if (response.isSuccessful())
        {
            lblVacancyComplete.Text = "<span style='size:XX-Large'>Vacancy to complete :" +
                vacancyWithTitle + "</span><br/><br/>" + response.getMessage() + "<br/><br/>";
            btnCancel.Text = "NO NOT NOW";
        }
        else
        {
            string listOfNotEvaluatedApplicant = (string)response.Data;
            lblVacancyComplete.Text = "<span style='size:XX-Large'> Vacancy to complete : "
            + vacancyWithTitle + "</span><br/><br/> <b>Not evaluated applicant(s) EID: </b>"
            + listOfNotEvaluatedApplicant + "<br/><br/>";

            btnCancel.Text = "OK";
            btnConfirmComplete.Visible = false;
            displayMessageToTheUser(response);
        }

    }