예제 #1
0
        /*/ private Cliente ObtenerCliente(string Documento)
         * {
         *  /* Cliente cli = null;
         *   List<Cliente> ListaClientes = new List<Cliente>();
         *   ListaClientes = db.Cliente.ToList();
         *   string documentoNro = txtCliente.Text;
         *   try
         *   {
         *       Cliente client = (Cliente)(from c in ListaClientes
         *                                  where (/*c.TipoDocumento == TipoDoc && c.Documento == documentoNro)
         *                                  select c).Single();
         *
         *       cli = client;
         *   }
         *   catch (Exception)
         *   {
         *
         *       MessageBox.Show("Cliente No existe");
         *   }
         *
         *   return cli;
         *
         * }*/



        /*private Solicitud_Credito ObtenerClienteMonto(int Monto)
         * {
         *  Solicitud_Credito sc = null;
         *  List<Solicitud_Credito> ListaSolicitudes = new List<Solicitud_Credito>();
         *  ListaSolicitudes = db.Solicitud_Credito.ToList();
         *  int MontoSolicitado = Convert.ToInt32(txtMonSolicitado.Text);
         *
         *  Solicitud_Credito solicitud = (Solicitud_Credito)(from s in ListaSolicitudes
         *                                                    where (/*c.TipoDocumento == TipoDoc && s.MontoSolicitado == MontoSolicitado)
         *                                                    select s).Single();
         *  sc = solicitud;
         *
         *  return sc;
         *
         * }*/


        private void btnGenerarCuotas_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                double Total           = 0;
                int    MontoSolicitado = Convert.ToInt32(txtMonSolicitado.Text.Replace(".", ""));
                double Interes         = Convert.ToDouble(txtInteres.Text);
                double InteresGenerado = 0;
                int    CantCuota       = Convert.ToInt32(txtCuotas.Text);
                Double MontoCuota;
                InteresGenerado         = MontoSolicitado * (Interes / 100);
                Total                   = MontoSolicitado + (MontoSolicitado * (Interes / 100));
                MontoCuota              = Math.Round((Total / CantCuota), 0);
                txtInteresGenerado.Text = String.Format(elGR, "{0:0,0}", InteresGenerado);
                Total                   = MontoCuota * CantCuota;
                // txtMonTotal.Text = String.Format(elGR, "{0:0,0}", Total);//FORMATEA EL MONTO TOTAL CON SEPARADOR DE MILES
                txtMonTotal.Text = Convert.ToString(Total);                                                        //txtSaldo.Text = txtMontoTotal.Text;

                for (int i = 0; i < CantCuota; i++)
                {
                    PrestamoDetalle prestamoDetalle = new PrestamoDetalle();
                    prestamoDetalle.NroCuota     = i;
                    prestamoDetalle.MontoDetalle = MontoCuota;
                    prestamoDetalle.SaldoDetalle = MontoCuota;
                    prestamoDetalle.estado       = EstadoPrestamo.No_pagado;
                    prestamoDetalle.Vencimiento  = dtpFecha.SelectedDate.Value.AddMonths(i);

                    // prestamo.ListaPrestamoDetalle.Add(prestamoDetalle);
                    PrestamoDetalle.Agregar(prestamoDetalle);
                }

                CargarGrilla2();
                grillado = true;
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message);
            }
        }
예제 #2
0
 void CargarGrilla2()
 {
     dgPrestamos.ItemsSource = null;
     dgPrestamos.ItemsSource = PrestamoDetalle.ObtenerPrestamoDetalle(); /*db.prestamo_detalle.ToList();*/
 }
예제 #3
0
 public static void Eliminar(PrestamoDetalle pd)
 {
     ListaPrestamoDetalle.Remove(pd);
 }
예제 #4
0
        public static void Agregar(PrestamoDetalle pd)
        {
            ListaPrestamoDetalle.Add(pd);

        }