Beispiel #1
0
        static void Main(string[] args)
        {
            Pacientes p = new Pacientes();
            p.GravaScriptPacientes();

            numerosMicroareas num = new numerosMicroareas();
            num.gravaScript();
            Console.WriteLine(".\n.\n.\n.Pressione <enter> para sair");
            Console.ReadLine();
        }
Beispiel #2
0
        /// <summary>
        /// Retorna Lista de Usuarios Cadastrados
        /// </summary>
        /// <returns>Prontuario, Nome, Logradouro, Numero, Comp, Bairro</returns>
        public List<Pacientes> RetornaListaPacientes()
        {
            var listPacientes = new List<Pacientes>();
            var x = new Pacientes();

            try
            {
                ConexaoFirebird banco = new ConexaoFirebird();
                DataTable tbUsuarios = banco.RetornaTabelaUsuariosCadastrados();
                foreach (DataRow Linha in tbUsuarios.Rows)
                {
                    x.Prontuario = int.Parse(Linha[0].ToString()); ;
                    x.Nome = Linha[2].ToString();
                    //x.DataNascimento = DateTime.Parse(Linha[5].ToString());
                    x.Logradouro = Linha[19].ToString() + " " + Linha[20].ToString();

                    var num = Linha[21].ToString();
                    bool invalid = false;
                    foreach (char c in num) { if (c < 48 || c > 57) { invalid = true; break; } }
                    if (!invalid && num != "")
                        x.Numero = int.Parse(Linha[21].ToString());

                    x.Complemento = Linha[22].ToString();
                    x.Bairro = Linha[18].ToString();
                    x.NomeMae = Linha[13].ToString();
                    listPacientes.Add(x);
                    x = new Pacientes();
                }
                return listPacientes;

            }
            catch (Exception)
            {

                throw;
            }

            return listPacientes;
        }