//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); } }
//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); }
//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); }
private void btnRegistraMedico_Click(object sender, EventArgs e) { if (txtBoxUsuario.Text != String.Empty) { string user_delete = ConexaoDB.putAspas(txtBoxUsuario.Text); string SQLCommand = "DELETE FROM `controle_de_obitos`.`user_data` WHERE (`User_Name` = " + user_delete + ");"; ComandBD.ComandDeleteToBD(SQLCommand); txtBoxUsuario.Text = String.Empty; } }
private void btnExcluirDO_Click(object sender, EventArgs e) { if (txtNumeroDaDO.Text != String.Empty) { string do_delete = ConexaoDB.putAspas(txtNumeroDaDO.Text); string SQLCommand = "DELETE FROM `controle_de_obitos`.`declaracao_de_obitos` WHERE (`Numero_da_DO` = " + do_delete + ");"; ComandBD.ComandDeleteToBD(SQLCommand); txtNumeroDaDO.Text = String.Empty; } }
//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); }
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); }
private void btnRegistraMedico_Click(object sender, EventArgs e) { if (txtBoxNomeDoMédico.Text != String.Empty && txtBoxCRM.Text != String.Empty) { string nameDoctor = ConexaoDB.putAspas(txtBoxNomeDoMédico.Text); string crmDoctor = ConexaoDB.putAspas(txtBoxCRM.Text); string SQLComand = "INSERT INTO `controle_de_obitos`.`doctor` (`Nome_do_Medico`, `CRM`) VALUES(" + nameDoctor + "," + crmDoctor + ");"; ComandBD.ComandInsertToBD(SQLComand); txtBoxCRM.Text = String.Empty; txtBoxNomeDoMédico.Text = String.Empty; } else { MessageBox.Show("Preencha os dois Campos!"); } }
private void btnRegistraMedico_Click(object sender, EventArgs e) { if (txtBoxNomeDoPaciente.Text != String.Empty && txtBoxNumeroDaDO.Text != String.Empty) { string nome_delete = ConexaoDB.putAspas(txtBoxNomeDoPaciente.Text); string do_delete = ConexaoDB.putAspas(txtBoxNumeroDaDO.Text); string SQLCommand = "DELETE FROM `controle_de_obitos`.`obitos` WHERE (`Nome_Do_Paciente` = " + nome_delete + " && `DO_Number` = " + do_delete + " );"; ComandBD.ComandDeleteToBD(SQLCommand); txtBoxNomeDoPaciente.Text = String.Empty; txtBoxNumeroDaDO.Text = String.Empty; } else { MessageBox.Show("Preencha os dois campos!"); } }
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(); } }
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); }