Using Using Using Using Using Using Using Using Using Using Using Namespace Public Partial Class Static Int Static String
Using Using Using Using Using Using Using Using Using Using Using Namespace Public Partial Class Static Int Static String
Using Using Using Using Using Using Using Using Using Using Using Namespace Public Partial Class Static Int Static String
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Capa_Presentacion
{
public partial class FrmCredito : Form
{
static int[] letra = { 3, 6, 9, 12 };
static string[] productos =
{"Lavadora","Refrigeradora","Licuadora","Extractora","Radio","DVD","BluRay"};
double tsubtotal=0;
double tinteres=0;
public FrmCredito()
{
InitializeComponent();
}
void mostrarFecha()
{
lblFecha.Text = DateTime.Now.ToShortDateString();
}
void mostrarHora()
{
lblHora.Text = DateTime.Now.ToShortTimeString();
}
objCre.Producto = cboProducto.Text;
objCre.Cantidad = int.Parse(txtCantidad.Text);
ListViewItem fila = new ListViewItem(objCre.getX().ToString());
fila.SubItems.Add(objCre.Producto);
fila.SubItems.Add(objCre.Cantidad.ToString());
fila.SubItems.Add(objCre.asignarPrecio().ToString("C"));
fila.SubItems.Add(objCre.calculaSubtotal().ToString());
lvDetalle.Items.Add(fila);
tsubtotal += objCre.calculaSubtotal();
lblNeto.Text = tsubtotal.ToString("0.00");
double y = li.calculaMontoMensual(tsubtotal,x);
tinteres = y;
int letras = int.Parse(cboLetras.Text);
switch (letras)
{
case 3: montoLetras(3); break;
case 6: montoLetras(6); break;
case 9: montoLetras(9); break;
case 12: montoLetras(12); break;
}
}
void montoLetras(int le)
{
double monto = tinteres;
double x=0;
lvDetalle1.Items.Clear();
for (int i = 1; i <= le; i++)
{
ListViewItem fila = new ListViewItem(i.ToString());
fila.SubItems.Add(monto.ToString("C"));
lvDetalle1.Items.Add(fila);
x += monto;
}
lblInteres.Text = x.ToString("C");
}
}
}