示例#1
0
    protected bool Carga_Historia(int idusuario)
    {
        iCom_BusinessEntity.Cuenta oBE = new iCom_BusinessEntity.Cuenta();
        iCom_BusinessLogic.Cuenta  oBL = new iCom_BusinessLogic.Cuenta();

        oBE.idusuario = idusuario;

        try
        {
            dtDatos = oBL.Consultar(oBE);

            if (dtDatos.Rows.Count > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        catch (Exception ex)
        {
            ResgitraLog(ex.Message);
            return(false);
        }
    }
示例#2
0
    // Guardar
    protected void BtnGuardar_Click(object sender, EventArgs e)
    {
        if (!bGuardar)
        {
            ResgitraLog("Datos ya guardados.");
            return;
        }

        // Guarda la cuenta $ del alumno
        try
        {
            iCom_BusinessEntity.Cuenta oBE = new iCom_BusinessEntity.Cuenta();
            iCom_BusinessLogic.Cuenta  oBL = new iCom_BusinessLogic.Cuenta();

            oBE.idusuario   = int.Parse(Application["idusuario"].ToString());
            oBE.idconcepto  = int.Parse((DdlConcepto.SelectedValue.ToString()));
            oBE.importe     = decimal.Parse(txtImporte.Text.ToString());
            oBE.iddescuento = int.Parse((DdlDescuento.SelectedValue.ToString()));

            oBE.descuento = Convert.ToDecimal(string.IsNullOrEmpty(txtDescuentoMoneda.Text) ? (decimal?)null : Convert.ToInt32(txtDescuentoMoneda.Text));

            oBE.pctdescuento = Convert.ToDecimal(string.IsNullOrEmpty(txtDescuentoPorcentaje.Text) ? (decimal?)null : Convert.ToInt32(txtDescuentoPorcentaje.Text));

            oBE.total = decimal.Parse(txtTotal.Text.ToString());

            oBL.Insertar(oBE);

            ResgitraLog("Datos guardados");
            BtnGUardar.Enabled = false;
            bGuardar           = false;
            return;
        }
        catch (Exception ex)
        {
            ResgitraLog(ex.Message);
            return;
        }
    }
示例#3
0
    protected void  Carga_Datos_Filtro()
    {
        try
        {
            if (Application["idusuario"].ToString() != "0")
            {
                iCom_BusinessEntity.Cuenta oBE = new iCom_BusinessEntity.Cuenta();
                iCom_BusinessLogic.Cuenta  oBL = new iCom_BusinessLogic.Cuenta();

                oBE.idusuario = int.Parse(Application["idusuario"].ToString());

                dtDatos = oBL.ConsultarFiltro(oBE);

                if (dtDatos.Rows.Count > 0)
                {
                    gvDatos.DataSource = dtDatos;
                    gvDatos.DataBind();
                    return;
                }
                else
                {
                    ResgitraLog("No hay datos");
                    return;
                }
            }
            else
            {
                Response.Redirect("~/app/Login/Login.aspx");
            }
        }
        catch (Exception ex)
        {
            ResgitraLog(ex.Message);
            return;
        }
    }