Beispiel #1
0
        //listar creditos pagina 2, registro de pagos
        private void DatosCre()
        {
            DataTable datos = new DataTable();
            int       atras = Convert.ToInt32(cre.dias_atraso(CboPresta.Text, DtpPago.Value.Date.ToString("yyyy/MM/dd")));

            //TxtInteres.Text = inteori.ToString();
            datos         = cre.cantcre(CboPresta.Text, DtpPago.Value.ToString());
            TxtMonto.Text = datos.Rows[0][0].ToString();
            decimal saldocap    = Convert.ToDecimal(datos.Rows[0][1].ToString());
            decimal inte        = Convert.ToDecimal(TxtInteres.Text);
            decimal monto       = Convert.ToDecimal(TxtMonto.Text);
            decimal interes     = Convert.ToDecimal(TxtInteres.Text);
            decimal interestemp = 0;

            TxtMonto.Text   = TxtMonto.Text;
            TxtSaldo.Text   = Convert.ToString(saldocap);
            TxtSaldInt.Text = datos.Rows[0][5].ToString();
            TxtVenc.Text    = datos.Rows[0][2].ToString();
            TxtTipo.Text    = datos.Rows[0][3].ToString();
            // TxtAtraso.Text = cre.dias_atraso(CboPresta.Text,DtpPago .Value.ToString ("yyyy/MM/dd"));
            if (Convert.ToDecimal(TxtSaldInt.Text) > 0)
            {
                interestemp = Convert.ToDecimal(TxtSaldInt.Text);
            }
            TxtTotalTod.Text = Convert.ToString(Convert.ToDecimal(TxtSaldo.Text) + interestemp);
            TxtFechConc.Text = datos.Rows[0][6].ToString();
            TxtTasa.Text     = datos.Rows[0][7].ToString() + "%";
            TxtPlazo.Text    = (datos.Rows[0][8].ToString());
            if (TxtTipo.Text == "1")
            {
                TxtTipo.Text = "Diario";
                int total = cre.diasnopag(CboPresta.Text, DtpPago.Value.ToString("yyyy/MM/dd"), datos.Rows[0][6].ToString());
                TxtAtraso.Text = total.ToString() + " Día(s)";
            }
            else if (TxtTipo.Text == "2")
            {
                TxtTipo.Text = "Diario-Interes";
                int total = cre.diasnopag(CboPresta.Text, DtpPago.Value.ToString("yyyy/MM/dd"), datos.Rows[0][6].ToString());
                TxtAtraso.Text = total.ToString() + " Día(s)";
            }
            else if (TxtTipo.Text == "3")
            {
                TxtTipo.Text = "Mesual-Fijo";
                int total = cre.diasnopag(CboPresta.Text, DtpPago.Value.ToString("yyyy/MM/dd"), datos.Rows[0][6].ToString());
                TxtAtraso.Text = total + " Día(s)";
            }
            else if (TxtTipo.Text == "4")
            {
                TxtTipo.Text = "Mesual-SobreSaldo";
                int total = cre.diasnopag(CboPresta.Text, DtpPago.Value.ToString("yyyy/MM/dd"), datos.Rows[0][6].ToString());
                TxtAtraso.Text = total + " Día(s)";
            }

            DataTable aldia = new DataTable();

            aldia           = cre.saldosdias(CboPresta.Text, DtpPago.Value.ToString("yyyy/MM/dd"));
            TxtCapital.Text = aldia.Rows[0][0].ToString();
            TxtInteres.Text = aldia.Rows[0][1].ToString();
            decimal intere = 0;

            if (Convert.ToDecimal(aldia.Rows[0][1]) > 0)
            {
                intere = Convert.ToDecimal(aldia.Rows[0][1]);
            }
            decimal capi = 0;

            if (Convert.ToDecimal(aldia.Rows[0][0]) > 0)
            {
                capi = Convert.ToDecimal(aldia.Rows[0][0]);
            }

            TxtCuotaD.Text = (capi + intere).ToString();
        }