Exemple #1
0
        public static void EnsureCreation()
        {
            //try {
            SQLOperations.MessageExceptions = true;
            SQLOperations.ThrowExceptions   = true;
            //SQLOperations.NonQuery("Erro ao criar banco de dados.", $"create database if not exists {Name};");
            Pessoas.p.CreateTable();
            Pacientes.CreateTable();
            Funcionarios.CreateTable();
            Medicos.CreateTable();
            Recepcionista.CreateTable();
            Tecnico_Enfermagem.CreateTable();
            (new Administradores()).GetCT()();
            TempPacientes.CreateTable();
            ListaEspera.CreateTable();
            Salas.CreateTable();
            Paciente_Sala.CreateTable();
            Convenios.CreateTable();
            ProcedimentosLab.CreateTable();
            ProcedimentoConvenio.CreateTable();
            PacienteProcedimentos.CreateTable();
            Enderecos.CreateTable();
            Anexos.CreateTable();
            Especializacoes.CreateTable();
            MedicoEspecializacoes.CreateTable();
            Agendamentos.CreateTable();
            AgendamentoPaciente.CreateTable();
            AgendamentoTempPaciente.CreateTable();
            AgendamentoFuncionario.CreateTable();
            ListaEspera_Funcionario.CreateTable();
            ListaEspera_Especializacao.CreateTable();
            Historico_Consultas.CreateTable();
            Historico_ProcedimentosLab.CreateTable();
            Pagamentos.CreateTable();
            //Fonoaudiologos.CreateTable();
            Nutricionistas.CreateTable();
            Psicologos.CreateTable();
            Ausentes.CreateTable();

            /*} catch (Exception ex) {
             *  MessageBox.Show(ex.Message);
             * }
             * finally {*/
            SQLOperations.ThrowExceptions = false;
            //}
        }
Exemple #2
0
        public static Convenios Select(int id)
        {
            var c = new MySqlCommand();

            c.CommandText =
                $"select {nameof(Convenio)} " +
                $"from {Name} " +
                $"where {nameof(ID)} = @id;";
            c.Parameters.AddWithValue("@id", id);
            Convenios convenio = null;

            QueryR("Erro ao obter convênio.", c, (r) => {
                if (r.Read())
                {
                    convenio = new Convenios()
                    {
                        ID       = id,
                        Convenio = r.GetString(0)
                    };
                }
            });
            return(convenio);
        }