Exemple #1
0
        protected void CargarDatosPregunta()
        {
            SIGE.Negocio.FormacionDesarrollo.PeriodoNegocio      nPeriodos     = new SIGE.Negocio.FormacionDesarrollo.PeriodoNegocio();
            SPE_OBTIENE_FYD_PREGUNTAS_ADICIONALES_PERIODO_Result vLstPreguntas = nPeriodos.ObtienePreguntasAdicionales(vIdPeriodo, vIdPregunta).FirstOrDefault();

            if (vLstPreguntas != null)
            {
                if (vLstPreguntas.XML_PREGUNTA != null)
                {
                    XElement vXmlPregunta = XElement.Parse(vLstPreguntas.XML_PREGUNTA);
                    txtClave.Text   = vXmlPregunta.Attribute("ID_CAMPO").Value.ToString();
                    txtNombre.Text  = vLstPreguntas.NB_PREGUNTA;
                    txtTooltip.Text = vXmlPregunta.Attribute("NB_TOOLTIP").Value.ToString();
                    cmbTipoControl.SelectedValue = vXmlPregunta.Attribute("CL_TIPO").Value.ToString();



                    MostrarDiv(vXmlPregunta.Attribute("CL_TIPO").Value.ToString(), vXmlPregunta);

                    if (vLstPreguntas.CL_CUESTIONARIO_OBJETIVO == "OTROS")
                    {
                        btnCuestionarioOtros.Checked = true;
                    }
                    else if (vLstPreguntas.CL_CUESTIONARIO_OBJETIVO == "AUTOEVALUACION")
                    {
                        btnCuestionarioAutoevaluacion.Checked = true;
                    }
                    else
                    {
                        btnCuestionarioAmbos.Checked = true;
                    }
                }
            }
        }
Exemple #2
0
        protected bool ValidarPregunta()
        {
            SIGE.Negocio.FormacionDesarrollo.PeriodoNegocio             nPeriodos     = new SIGE.Negocio.FormacionDesarrollo.PeriodoNegocio();
            List <SPE_OBTIENE_FYD_PREGUNTAS_ADICIONALES_PERIODO_Result> vLstPreguntas = nPeriodos.ObtienePreguntasAdicionales(pIdPeriodo: vIdPeriodo);

            foreach (var item in vLstPreguntas)
            {
                XElement vXmlPregunta = XElement.Parse(item.XML_PREGUNTA);
                string   vClPregunta  = (vXmlPregunta.Attribute("ID_CAMPO").Value.ToString());

                if (vIdPregunta == null)
                {
                    if (vClPregunta == txtClave.Text)
                    {
                        return(false);
                    }
                }
                else
                {
                    if (vClPregunta == txtClave.Text && item.ID_PREGUNTA_ADICIONAL != vIdPregunta)
                    {
                        return(false);
                    }
                }
            }

            return(true);
        }
Exemple #3
0
        protected void btnSiguiente_Click(object sender, EventArgs e)
        {
            if (ptipo.Equals("PROGRAMACAPACITACION"))
            {
                if (!pClaveToken.Equals(""))
                {
                    if (vIdPrograma != null)
                    {
                        if (txtClave.Text.ToString().Equals(pClaveToken))
                        {
                            ProgramaNegocio nPrograma             = new ProgramaNegocio();
                            var             vprogramaCapacitacion = nPrograma.ObtieneProgramasCapacitacion(pIdPrograma: vIdPrograma).FirstOrDefault();
                            if (vprogramaCapacitacion != null)
                            {
                                DocumentoAutorizarNegocio nDocumento = new DocumentoAutorizarNegocio();

                                SPE_OBTIENE_C_AUTORIZACION_DCTO_EMPLEADO_Result vDocumento = new SPE_OBTIENE_C_AUTORIZACION_DCTO_EMPLEADO_Result();

                                vDocumento = nDocumento.ObtieneEmpleadoDocumentoAutorizacion(pFlAutorizacion: pFolioAutorizacion).FirstOrDefault();

                                if (vDocumento != null)
                                {
                                    if (vDocumento.CL_ESTADO.ToUpper().Equals("POR AUTORIZAR"))
                                    {
                                        Response.Redirect("~/FYD/EvaluacionCompetencia/AutorizaProgramaCapacitacion.aspx?ID=" + vIdPrograma + "&TOKEN=" + pFolioAutorizacion);
                                    }
                                    else
                                    {
                                        UtilMensajes.MensajeResultadoDB(RadWindowManager1, "El documento ya fue autorizado o rechazado y no se puede modificar.", E_TIPO_RESPUESTA_DB.ERROR);
                                    }
                                }
                                else
                                {
                                    UtilMensajes.MensajeResultadoDB(RadWindowManager1, "El documento no existe.", E_TIPO_RESPUESTA_DB.ERROR);
                                }
                            }
                        }
                        else
                        {
                            UtilMensajes.MensajeResultadoDB(RadWindowManager1, "Las contraseñas no coinciden.", E_TIPO_RESPUESTA_DB.ERROR);
                        }
                    }

                    if (vIdPeriodo != null)
                    {
                        if (txtClave.Text.ToString().Equals(pClaveToken))
                        {
                            SIGE.Negocio.FormacionDesarrollo.PeriodoNegocio nPrograma = new SIGE.Negocio.FormacionDesarrollo.PeriodoNegocio();
                            DocumentoAutorizarNegocio nDocumento = new DocumentoAutorizarNegocio();
                            var DocumentoAutorizar = nDocumento.ObtieneEmpleadoDocumentoAutorizacion(pFlAutorizacion: pFolioAutorizacion).FirstOrDefault();
                            var vPeriodo           = nPrograma.ObtienePeriodoEvaluacion(vIdPeriodo.Value);
                            if (vPeriodo != null)
                            {
                                if (DocumentoAutorizar.CL_ESTADO == "Autorizado")
                                {
                                    UtilMensajes.MensajeResultadoDB(RadWindowManager1, "Ya se ha capturado una respuesta a esta autorización.", E_TIPO_RESPUESTA_DB.ERROR);
                                }
                                else
                                {
                                    Response.Redirect("~/FYD/EvaluacionCompetencia/AutorizarPeriodoEvaluacion.aspx?IdPeriodo=" + vIdPeriodo + "&TOKEN=" + pFolioAutorizacion);
                                }
                            }
                        }
                        else
                        {
                            UtilMensajes.MensajeResultadoDB(RadWindowManager1, "Las contraseñas no coinciden.", E_TIPO_RESPUESTA_DB.ERROR);
                        }
                    }
                }
            }
        }
Exemple #4
0
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            XElement vXmlCampo = new XElement("CAMPO");

            if (txtClave.Text != "" && txtNombre.Text != "")
            {
                string vClTipoCampo = cmbTipoControl.SelectedValue;

                vXmlCampo.SetAttributeValue("CL_TIPO", vClTipoCampo);
                vXmlCampo.SetAttributeValue("ID_CAMPO", txtClave.Text);
                vXmlCampo.SetAttributeValue("NB_CAMPO", txtNombre.Text);
                vXmlCampo.SetAttributeValue("NB_TOOLTIP", txtTooltip.Text);

                if (ValidarPregunta())
                {
                    switch (vClTipoCampo)
                    {
                    case "TEXTBOX":
                        vXmlCampo.SetAttributeValue("NO_LONGITUD", txtTextboxLongitud.Text);
                        vXmlCampo.SetAttributeValue("NO_ANCHO", int.Parse(txtTextboxLongitud.Text) * 2);
                        vXmlCampo.SetAttributeValue("NO_VALOR_DEFECTO", txtTextboxDefault.Text);

                        if (int.Parse(txtTextboxLongitud.Text) > 200)
                        {
                            vXmlCampo.SetAttributeValue("NO_ANCHO", txtTextboxLongitud.Text);
                            vXmlCampo.SetAttributeValue("FG_MULTILINEA", "1");
                        }
                        else
                        {
                            vXmlCampo.SetAttributeValue("NO_LARGO", 30);
                            vXmlCampo.SetAttributeValue("NO_ANCHO", int.Parse(txtTextboxLongitud.Text) * 3);
                            vXmlCampo.SetAttributeValue("FG_MULTILINEA", "0");
                        }

                        break;

                    case "DATEPICKER":
                    case "DATEAGE":
                        if (txtDateDefault.SelectedDate != null)
                        {
                            vXmlCampo.SetAttributeValue("NO_VALOR_DEFECTO", ((DateTime)txtDateDefault.SelectedDate).ToString("dd/MM/yyyy"));
                        }
                        break;

                    case "COMBOBOX":
                        vXmlCampo.SetAttributeValue("ID_CATALOGO", cmbComboboxCatalogo.SelectedValue);
                        vXmlCampo.SetAttributeValue("NO_VALOR_DEFECTO", cmbComboboxDefault.SelectedValue);
                        break;

                    case "MASKBOX":
                        vXmlCampo.SetAttributeValue("NO_ANCHO", 100);
                        vXmlCampo.SetAttributeValue("NB_MASCARA", txtMaskboxMascara.Text);
                        break;

                    case "NUMERICBOX":
                        vXmlCampo.SetAttributeValue("NO_DECIMALES", txtNumericboxDecimales.Text);
                        vXmlCampo.SetAttributeValue("NO_ENTEROS", txtNumericboxEnteros.Text);
                        vXmlCampo.SetAttributeValue("NO_ANCHO", String.Format("{0:N0},{1:N0}", txtNumericboxEnteros.Value + txtNumericboxDecimales.Value, txtNumericboxDecimales.Value));
                        vXmlCampo.SetAttributeValue("NO_VALOR_DEFECTO", (decimal)txtNumericboxDefault.Value);
                        break;

                    case "CHECKBOX":
                        vXmlCampo.SetAttributeValue("NO_VALOR_DEFECTO", chkCheckboxDefault.Checked ? "1" : "0");
                        break;
                    }

                    //XElement vXmlPreguntasAdicionales = new XElement("PREGUNTAS_ADICIONALES");
                    //vXmlPreguntasAdicionales.Add(lstCampoAdicional.Items.Where(w => !w.Value.Equals(String.Empty)).Select(s => new XElement("PREGUNTA", new XAttribute("ID_CAMPO", s.Value))));

                    SIGE.Negocio.FormacionDesarrollo.PeriodoNegocio nPeriodo = new SIGE.Negocio.FormacionDesarrollo.PeriodoNegocio();

                    E_CL_CUESTIONARIO_OBJETIVO vClCuestionarioObjetivo = E_CL_CUESTIONARIO_OBJETIVO.AMBOS;

                    if (btnCuestionarioAutoevaluacion.Checked)
                    {
                        vClCuestionarioObjetivo = E_CL_CUESTIONARIO_OBJETIVO.AUTOEVALUACION;
                    }

                    if (btnCuestionarioOtros.Checked)
                    {
                        vClCuestionarioObjetivo = E_CL_CUESTIONARIO_OBJETIVO.OTROS;
                    }

                    string vClTipoTransaccion = "I";
                    if (vIdPregunta != null)
                    {
                        vClTipoTransaccion = "A";
                    }

                    E_RESULTADO vResultado = nPeriodo.InsertaPreguntasAdicionales(vIdPeriodo, vIdPregunta, txtNombre.Text, vXmlCampo, vClCuestionarioObjetivo.ToString(), vClUsuario, vNbPrograma, vClTipoTransaccion);
                    string      vMensaje   = vResultado.MENSAJE.Where(w => w.CL_IDIOMA.Equals(vClIdioma.ToString())).FirstOrDefault().DS_MENSAJE;

                    UtilMensajes.MensajeResultadoDB(rwmAlertas, vMensaje, vResultado.CL_TIPO_ERROR, pCallBackFunction: "generateDataForParent");
                }
                else
                {
                    if (vClIdioma != E_IDIOMA_ENUM.ES.ToString())
                    {
                        TraduccionIdiomaTextoNegocio        oNegocio             = new TraduccionIdiomaTextoNegocio();
                        SPE_OBTIENE_TRADUCCION_TEXTO_Result vLstTextosTraduccion = oNegocio.ObtieneTraduccion(pCL_TEXTO: "vCB_ValidaClaveNombre", pCL_MODULO: "FYD", pCL_PROCESO: "EC_PREGUNTASADICIONALES", pCL_IDIOMA: "PORT").FirstOrDefault();
                        if (vLstTextosTraduccion != null)
                        {
                            UtilMensajes.MensajeResultadoDB(rwmAlertas, vLstTextosTraduccion.DS_TEXTO, E_TIPO_RESPUESTA_DB.ERROR, pCallBackFunction: "");
                        }
                    }
                    else
                    {
                        UtilMensajes.MensajeResultadoDB(rwmAlertas, "Ya existe un registro con esta clave.", E_TIPO_RESPUESTA_DB.ERROR, pCallBackFunction: "");
                    }
                }
            }

            else
            {
                if (vClIdioma != E_IDIOMA_ENUM.ES.ToString())
                {
                    TraduccionIdiomaTextoNegocio        oNegocio             = new TraduccionIdiomaTextoNegocio();
                    SPE_OBTIENE_TRADUCCION_TEXTO_Result vLstTextosTraduccion = oNegocio.ObtieneTraduccion(pCL_TEXTO: "vCB_ValidaPregunta", pCL_MODULO: "FYD", pCL_PROCESO: "EC_PREGUNTASADICIONALES", pCL_IDIOMA: "PORT").FirstOrDefault();
                    if (vLstTextosTraduccion != null)
                    {
                        UtilMensajes.MensajeResultadoDB(rwmAlertas, vLstTextosTraduccion.DS_TEXTO, E_TIPO_RESPUESTA_DB.ERROR, pCallBackFunction: "");
                    }
                }
                else
                {
                    UtilMensajes.MensajeResultadoDB(rwmAlertas, "La clave y el título del campo son requeridos.", E_TIPO_RESPUESTA_DB.ERROR, pCallBackFunction: "");
                }
            }
        }