Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Emprestimo novoEmprestimo = new Emprestimo();
            novoEmprestimo.NomeAmigo = "Gabriele";
            novoEmprestimo.DataEmprestimo = DateTime.Now;
            novoEmprestimo.DataDevolucao = DateTime.Now.AddMonths(2);
            novoEmprestimo.ValorEmprestado = 1000;
            novoEmprestimo.TaxaJuros = 5;

            novoEmprestimo.CalcularNumeroParcelas();

            EmprestimoDao dao = new EmprestimoDao();

            dao.RegistrarNovoEmprestimo(novoEmprestimo);

            List<Emprestimo> emprestimos = dao.SelecionarTodosEmprestimos();

            CadastroConsole cadastroSelecionado = null;

            do
            {
                cadastroSelecionado = CadastroConsole.SelecionarCadastro();

                if (cadastroSelecionado != null)
                    cadastroSelecionado.MostrarMenu();

            } while (cadastroSelecionado != null);
        }
        public RecebimentoParcelaDialog(Emprestimo emprestimo ) : this()
        {
            labelAmigo.Text = emprestimo.NomeAmigo;
            labelValorJuro.Text = emprestimo.PercentualJuros.ToString();

            cmbParcela.Items.Clear();

            foreach (var item in emprestimo.Parcelas)
            {
                cmbParcela.Items.Add(item);
            }
        }
        public EmprestimoDetalhesDialog(Emprestimo emprestimo) : this()
        {
            labelNomeAmigo.Text = emprestimo.NomeAmigo;
            labelPrevisaoDevolucao.Text = emprestimo.DataDevolucao.ToString();
            labelDataInicio.Text = emprestimo.DataEmprestimo.ToString();
            labelTaxaJuros.Text = emprestimo.TaxaJuros.ToString();
            labelValorEmprestado.Text = emprestimo.ValorEmprestado.ToString();

            foreach (var parcela in emprestimo.Parcelas)
            {
                listParcelasJuro.Items.Add(parcela);
            }
        }