Exemplo n.º 1
0
        //SELECT -- Contar Obitos ----------------------------------------------------------------------------------------------------------------------------------
        public void ContarObito(string InicioCount, string FimCount)
        {
            InicioCount = InicioCount.Substring(6, 4) + "-" + InicioCount.Substring(3, 2) + "-" + InicioCount.Substring(0, 2);
            InicioCount = ConexaoDB.putAspas(InicioCount);
            FimCount    = FimCount.Substring(6, 4) + "-" + FimCount.Substring(3, 2) + "-" + FimCount.Substring(0, 2);
            FimCount    = ConexaoDB.putAspas(FimCount);
            string SQLComand = "SELECT COUNT(Obitos_ID) FROM controle_de_obitos.obitos WHERE Data_do_Obito BETWEEN " + InicioCount + " AND " + FimCount + " ;";

            ComandBD.ComandSelectToBD(SQLComand, ShowCountedObitos);
        }
Exemplo n.º 2
0
 //SELECT -- Ver Dados dos Obitos ----------------------------------------------------------------------------------------------------------------------------------
 private void listBoxVerObitos_MouseDoubleClick(object sender, MouseEventArgs e)
 {
     if (listBoxVerObitos.SelectedItem != null)
     {
         string id_consult          = listBoxVerObitos.SelectedItem.ToString().Substring(0, 2).Trim();
         string id_consultWithAspas = ConexaoDB.putAspas(id_consult);
         string SQLComand           = "SELECT User_Name, Nome_Do_Paciente, Data_do_Obito, DO_Number, Data_de_Nascimento_do_Paciente, Causa_Do_Obito, Doctor_Name, Tipo_De_Obito FROM obitos WHERE Obitos_ID = " + id_consultWithAspas + ";";
         ComandBD.ComandSelectToBD(SQLComand, ShowObitoData);
     }
 }
Exemplo n.º 3
0
        //SELECT -- Mostra Obitos ----------------------------------------------------------------------------------------------------------------------------------
        public void VizualizarObitos()
        {
            if (listBoxVerObitos.Items.Count > 0)
            {
                listBoxVerObitos.Items.Clear();
            }
            string SQLComand = "SELECT Obitos_ID, Nome_Do_Paciente, Doctor_Name, DO_Number FROM obitos;";

            ComandBD.ComandSelectToBD(SQLComand, Add_Obitos_ToListBox);
        }
Exemplo n.º 4
0
        //SELECT -- Mostra DOs Disponiveis para Cancelar ---------------------------------------------------------------------------------------------------------------------------
        public void findDOsDisponiveisParaCancelar()
        {
            if (listBoxDOsParaCancelar.Items.Count > 0)
            {
                listBoxDOsParaCancelar.Items.Clear();
            }

            string SQLComand = "SELECT Numero_da_DO FROM declaracao_de_obitos WHERE Status_da_DO = 1;";

            ComandBD.ComandSelectToBD(SQLComand, Add_Numero_da_DO_DisponivelParaCancelarToListBox);
        }
Exemplo n.º 5
0
        private void btnPesquisaDOsPROAIM_Click(object sender, EventArgs e)
        {
            if (listBoxVizualizarDOsPROAIM.Items.Count > 0 || listBoxLevarAoPROAIM.Items.Count > 0)
            {
                listBoxVizualizarDOsPROAIM.Items.Clear();
                listBoxLevarAoPROAIM.Items.Clear();
            }
            string comandoSQL = "SELECT Numero_da_DO FROM declaracao_de_obitos WHERE Status_da_DO = 3 AND PROAIM = 1";

            ComandBD.ComandSelectToBD(comandoSQL, Add_Numero_da_DO_ToListBox);
        }
Exemplo n.º 6
0
        public void makeLogin()
        {
            string userWithAspas = ConexaoDB.putAspas(Login.user);
            string SQLComand     = "SELECT User_Name, Name, passwd, Access FROM user_data WHERE User_Name =" + userWithAspas;

            ComandBD.ComandSelectToBD(SQLComand, RetrievUserData);
            if (Login.found == 0)
            {
                MessageBox.Show("Usuário não encontrado");
            }
            if (Login.verified)
            {
                MainScreen mainScreen = new MainScreen();
                mainScreen.StartPosition       = FormStartPosition.CenterScreen;
                LoginScreen.ActiveForm.Visible = false;
                mainScreen.ShowDialog();
            }
        }
Exemplo n.º 7
0
        public void PesquisaObitos(string valor, string Pesquisa, string Inicio, string Fim)
        {
            string SQLComand = SQLComandSearchType(valor, Pesquisa, Inicio, Fim);

            ComandBD.ComandSelectToBD(SQLComand, Add_Obitos_Pesquisados_ToListBox);
        }