Exemplo n.º 1
0
    // Catalogos
    protected void Carga_Catalogos()
    {
        try
        {
            // Carrera
            dtDatos = Filtros.Carrera(0);
            if (dtDatos.Rows.Count > 0)
            {
                DdlCarrera.Items.Add(new ListItem("Selecciona"));
                foreach (DataRow row in dtDatos.Rows)
                {
                    DdlCarrera.Items.Add(new ListItem(row[1].ToString()));
                }
            }

            // Periodo Escolar
            dtDatos = Filtros.PeriodoEscolar(0);
            if (dtDatos.Rows.Count > 0)
            {
                DdlPeriodo.Items.Add(new ListItem("Selecciona"));
                foreach (DataRow row in dtDatos.Rows)
                {
                    DdlPeriodo.Items.Add(new ListItem(row[3].ToString()));
                }
            }

            // Ingreso Egreso
            DdlIngresoEgreso.Items.Clear();

            iCom_BusinessLogic.Concepto oBL = new iCom_BusinessLogic.Concepto();

            dtFiltro = oBL.ConsultarIE();

            if (dtFiltro.Rows.Count > 0)
            {
                DdlIngresoEgreso.DataSource     = dtFiltro;
                DdlIngresoEgreso.DataTextField  = "IE";
                DdlIngresoEgreso.DataValueField = "id";
                DdlIngresoEgreso.DataBind();
            }
        }
        catch (Exception ex)
        {
            ResgitraLog(ex.Message);
            return;
        }
    }
Exemplo n.º 2
0
    protected void DdlIngresoEgreso_SelectedIndexChanged(object sender, EventArgs e)
    {
        DdlConcepto.Items.Clear();

        if (int.Parse(DdlIngresoEgreso.SelectedValue.ToString()) == -1)
        {
            ResgitraLog("Selecciona Ingreo o Egreso");
            DdlIngresoEgreso.Focus();
            return;
        }

        try
        {
            iCom_BusinessEntity.Concepto oBE = new iCom_BusinessEntity.Concepto();
            iCom_BusinessLogic.Concepto  oBL = new iCom_BusinessLogic.Concepto();

            oBE.tipo = false;

            if (DdlIngresoEgreso.SelectedValue.ToString() == "0")
            {
                oBE.ingresoegreso = false;
            }
            else
            {
                oBE.ingresoegreso = true;
            }

            dtFiltro = oBL.ConsultarConceptoIE(oBE);

            if (dtFiltro.Rows.Count > 0)
            {
                DdlConcepto.DataSource     = dtFiltro;
                DdlConcepto.DataTextField  = "nombreconcepto";
                DdlConcepto.DataValueField = "idconcepto";
                DdlConcepto.DataBind();

                // Lo convierto a JSON
                sConceptos = DataTableToJSONWithJSONNet(dtFiltro);
            }
        }
        catch (Exception ex)
        {
            ResgitraLog(ex.Message);
            return;
        }
    }