Exemple #1
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;
        }
    }
Exemple #2
0
    protected void ddlIngresoEgreso_SelectedIndexChanged(object sender, EventArgs e)
    {
        {
            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 = true;

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

                dtDatos = oBL.ConsultarConceptoIE(oBE);

                if (dtDatos.Rows.Count > 0)
                {
                    gvDatos.DataSource = dtDatos;
                    gvDatos.DataBind();
                    return;
                }
            }
            catch (Exception ex)
            {
                ResgitraLog(ex.Message);
                return;
            }
        }
    }