コード例 #1
0
        internal void RegistrarDevolucao()
        {
            Console.Clear();
            MostrarEmprestimosAbertos();

            Console.WriteLine("Digite a id do emprestimo que deseja registrar devolução: ");
            int idSelecionado;

            Int32.TryParse(Console.ReadLine(), out idSelecionado);

            int idExitente = controladorEmprestimo.VerificaId(idSelecionado);

            if (idExitente == 0)
            {
                Console.WriteLine("Id não encontrado, tente novamente!!");
                Console.ReadLine();
            }
            else
            {
                Emprestimo emprestimo;

                emprestimo = controladorEmprestimo.SelecionarEmprestimoPorId(idSelecionado);

                emprestimo.Status        = false;
                emprestimo.DataDevolucao = DateTime.Now.ToLocalTime();

                Console.WriteLine("Devolução registrada com sucesso!");
            }
        }