Пример #1
0
        private void CargarDatosAdicionales(OtrosDatosBenef otrosDatosBenef, decimal documento, decimal beneficio)
        {
            lblMarcaLuzFza.Text = (otrosDatosBenef.mLuzyFuerza == null || otrosDatosBenef.mLuzyFuerza.ToString() == "N") ? "No Informado" : (otrosDatosBenef.mLuzyFuerza.ToString() == "S") ? otrosDatosBenef.daCondEspecial + " - " + otrosDatosBenef.descCondEspecial : "";
            lblMarcaRetiro.Text = (otrosDatosBenef.daRetiro + " - " + otrosDatosBenef.descRetiro);
            lblTipoDocente.Text = (otrosDatosBenef.cTipoDocente.ToString() != null) ? (otrosDatosBenef.daCondEspecial + " - " + otrosDatosBenef.descCondEspecial) : "";
            if ((Servicios.ConsultarCantBeneficios(documento).cantBenef) == 1)
            {
                lblBenefIgualDoc.Text = "NO";
            }
            else
            {
                lblBenefIgualDoc.Text = "SI";
            }
            lblFAumLeyComun.Text = (otrosDatosBenef.fAumLeyComun.Year < 1900) ? "" : otrosDatosBenef.fAumLeyComun.ToString("dd/MM/yyyy");
            lblFAumLeyEsp.Text   = otrosDatosBenef.fAumLeyEsp.ToString("dd/MM/yyyy");
            lblSumaHaber.Text    = otrosDatosBenef.iHabBasico.ToString();
            lblHaberMax.Text     = (otrosDatosBenef.iHabMax.ToString() == null) ? otrosDatosBenef.iHabBasico.ToString() : (otrosDatosBenef.iHabMax.ToString() == "0") ? otrosDatosBenef.iHabBasico.ToString() : otrosDatosBenef.iHabMax.ToString();
            if ((Servicios.ConsultarEmbargos(beneficio).digCuil) == 0)
            {
                lblPresEmbCtasAns.Text = "NO";
            }
            else
            {
                lblPresEmbCtasAns.Text = "SI";
            }
            //lblFApropCuil.Text = "NO ESTA EN DATO O EN SELECT";
            lblCondicAlta.Text   = otrosDatosBenef.condAlta;
            lblMarcaDec2196.Text = otrosDatosBenef.codDec2196.ToString();
            lblAfjp.Text         = otrosDatosBenef.codAfjp.ToString();

            //if (otrosDatosBenef.codDec2196 > 0) { lblMarcaDec2196.Text = Servicios.ConsultarDecreto2196(otrosDatosBenef.codDec2196.ToString()); }
        }
Пример #2
0
        protected void gv_Beneficios_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            Int32 index = Convert.ToInt32(e.CommandArgument);

            if (e.CommandName.Equals("Select"))
            {
                GridViewRow row;
                if (gv_Beneficios.PageIndex == 0)
                {
                    row = gv_Beneficios.Rows[index];
                }
                else
                {
                    Int32 totalPag   = Convert.ToInt32(gv_Beneficios.PageCount);
                    Int32 itemActual = (totalPag - (totalPag - Convert.ToInt32(gv_Beneficios.PageIndex))) * Convert.ToInt32(gv_Beneficios.PageSize);
                    row = gv_Beneficios.Rows[index - itemActual];
                }
                DataKey key = gv_Beneficios.DataKeys[row.RowIndex];

                // Creo una ListItem
                ListItem beneficio = new ListItem();
                ListItem documento = new ListItem();

                beneficio.Text = Server.HtmlDecode(row.Cells[2].Text);
                documento.Text = Server.HtmlDecode(row.Cells[7].Text);

                // Obtengo el id de la entidad que se esta seleccionando
                DataBoundControl nroBenef = (DataBoundControl)gv_Beneficios.Rows[index].FindControl("beneficio");
                DataBoundControl nroDoc   = (DataBoundControl)gv_Beneficios.Rows[index].FindControl("nroDoc");


                DatosPersonaBenef datosPersonaBenef = Servicios.TraerDatosPersonaBenef(long.Parse(beneficio.Text));
                OtrosDatosBenef   otrosDatosBenef   = Servicios.TraerOtrosDatosBenef(long.Parse(beneficio.Text));
                RUBConceptosTot[] datosConceptos    = Servicios.ObtenerTodosConceptos(long.Parse(beneficio.Text));

                if (datosPersonaBenef.error.codError == 999 && otrosDatosBenef.error.codError == 999)
                {
                    this.Alertar("Error en el servicio. No se encontraron datos para el beneficio seleccionado");
                    log.Error(string.Format("No hay datos para el beneficio ingresado -> Error:{0}->", System.Diagnostics.TraceEventType.Error));
                    return;
                }
                else
                {
                    if (datosPersonaBenef.error.codError == 0 || otrosDatosBenef.error.codError == 0)
                    {
                        try
                        {
                            //cargo datos
                            CargarDatosPersona(datosPersonaBenef);
                            CargarDatosBeneficio(datosPersonaBenef);
                            CargarDatosAdicionales(otrosDatosBenef, decimal.Parse(documento.ToString()), decimal.Parse(beneficio.ToString()));
                            if (datosConceptos != null)
                            {
                                CargarConceptos(datosConceptos);
                            }
                            divDatosPersona.Style.Add("display", "block");
                            gv_Beneficios.Enabled             = false;
                            this.btnLimpiarResultado.Disabled = true;
                            divResultados.Style.Add("display", "block");
                            divCollapseBeneficios.Attributes.Add("class", "panel-info panel-collapse collapse");
                            divPrimarioBenef.Attributes.Add("class", "panel panel-info");
                        }
                        catch (Exception ex)
                        {
                            throw ex;
                        }
                    }
                    else
                    {   // dio otro error diferente a 999
                        this.Alertar(datosPersonaBenef.error.mensajeError);
                        log.Error(string.Format("No hay datos para el beneficio ingresado -> Error:{0}->", System.Diagnostics.TraceEventType.Error));
                        return;
                    }
                }
            }
        }