Esempio n. 1
0
        protected void FunCargarDeudas()
        {
            _dts = new PagoCarteraDAO().FunGetPagoCartera(1, int.Parse(DdlCedente.SelectedValue),
                                                          int.Parse(ViewState["CodCatalogo"].ToString()), lblIdentificacion.InnerText, "", "", "", "0", "", "", "", "",
                                                          0, 0, 0, 0, "", _conexion);

            if (_dts != null)
            {
                ViewState["saldo"] = _dts.Tables[0].Rows[0]["SumSaldo"].ToString();

                if (_dts.Tables[0].Rows.Count > 0)
                {
                    _dtb                    = _dts.Tables[0];
                    _totalDeuda             = decimal.Parse(_dtb.Compute("Sum(SumDeuda)", "").ToString());
                    _totalSaldo             = decimal.Parse(_dtb.Compute("Sum(SumSaldo)", "").ToString());
                    lblTotalDeuda.InnerText = "$" + string.Format("{0:n}", _totalDeuda);
                    lblTotalSaldo.InnerText = "$" + string.Format("{0:n}", _totalSaldo);
                }

                GrdvDeudas.DataSource = _dts;
                GrdvDeudas.DataBind();
            }
        }
Esempio n. 2
0
        protected void BtnBuscar_Click(object sender, EventArgs e)
        {
            try
            {
                if (DdlCedente.SelectedValue == "0")
                {
                    new FuncionesDAO().FunShowJSMessage("Seleccione Cedente..!", this);
                    return;
                }

                if (DdlCatalogo.SelectedValue == "0")
                {
                    new FuncionesDAO().FunShowJSMessage("Seleccione Catálogo/Producto..!", this);
                    return;
                }

                if (string.IsNullOrEmpty(TxtBuscarPor.Text.Trim()))
                {
                    new FuncionesDAO().FunShowJSMessage("Ingrese Dato de consulta..!", this);
                    return;
                }

                if (DdlBuscarPor.SelectedValue == "I")
                {
                    _tipocliente = 0;
                }
                else
                {
                    _tipocliente = 2;
                }

                ImgAgregar.Enabled           = false;
                Lblerror.Text                = "";
                lblCliente.InnerText         = "";
                lblIdentificacion.InnerText  = "";
                lblEstado.InnerText          = "";
                lblEstadoOperacion.InnerText = "";
                lblTotalDeuda.InnerText      = "";
                lblTotalPago.InnerText       = "";
                lblTotalSaldo.InnerText      = "";
                GrdvDeudas.DataSource        = null;
                GrdvDeudas.DataBind();
                GrdvDatos.DataSource = null;
                GrdvDatos.DataBind();

                ViewState["tipoCliente"]   = _tipocliente;
                ViewState["tipoOperacion"] = _tipooperacion;

                _dts = new PagoCarteraDAO().FunGetPagoCartera(_tipocliente, int.Parse(DdlCedente.SelectedValue),
                                                              int.Parse(ViewState["CodCatalogo"].ToString()), TxtBuscarPor.Text.Trim(), TxtBuscarPor.Text.Trim(),
                                                              "", "", "0", "", "", "", "", 0, 0, 0, 1, "", _conexion);

                if (_dts != null && _dts.Tables[0].Rows.Count > 0)
                {
                    lblCliente.InnerText        = _dts.Tables[0].Rows[0]["Cliente"].ToString();
                    lblIdentificacion.InnerText = _dts.Tables[0].Rows[0]["Identificacion"].ToString();
                    FunCargarDeudas();
                }
                else
                {
                    new FuncionesDAO().FunShowJSMessage("No existen datos..!", this);
                }
                FunLimpiarCampos();
            }
            catch (Exception ex)
            {
                Lblerror.Text = ex.ToString();
            }
        }