Example #1
0
        private void btn_Salvar_Click(object sender, EventArgs e)
        {
            lerDados();
            con.conectar();
            String sql = "Insert into tb_consulta (id,id_paciente,id_dentista,motivo,diagnostico,receita,motivo_retorno,dt_consulta,dt_retorno) " +
                         "values (  " +
                         objConsulta.Id + " , " +
                         objConsulta.IdPaciente + " , " +
                         objConsulta.IdDentista + " , '" +
                         objConsulta.Motivo + "' , '" +
                         objConsulta.Diagnostico + "' , '" +
                         objConsulta.Receita + "' , '" +
                         objConsulta.Retorno + "'  ,convert(date,'" + objConsulta.DTConsulta.ToShortDateString() + "', 103) " +
                         ",convert(date,'" + objConsulta.DTRetorno.ToShortDateString() + "', 103)) ";
            var ex = MessageBox.Show("Deseja Salvar informaçoes ?", "DenteBam", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (con.executar(sql) == 1)
            {
                MessageBox.Show("Dados salvos com sucesso!");
            }
            else
            {
                MessageBox.Show("Dados não foram salvos !");
            }
            atualizarGrid();
        }
Example #2
0
        private void btn_Salvar_Click_1(object sender, EventArgs e)
        {
            lerDados();
            con.conectar();
            String sql =
                "Insert into tb_dentista " +
                "values (  '" +
                objDentista.Nome + "' , '" +
                objDentista.Cro + "' , '" +
                objDentista.Sexo + "' , " +
                objDentista.instagram + " , " +
                objDentista.facebook + " , " +
                objDentista.twitter + " , " +
                objDentista.linkedin + ") ";
            var ex = MessageBox.Show("Deseja Salvar informaçoes ?", "DenteBam", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (con.executar(sql) == 1)
            {
                MessageBox.Show("Dados salvos com sucesso!");
            }
            else
            {
                MessageBox.Show("Dados não foram salvos !");
            }
            atualizarGrid();
        }
Example #3
0
        public static void EditarDentista(Dentista dentista)
        {
            conexao conexao = new conexao();

            conexao.conectar();



            int linhas  = conexao.executar("UPDATE tb_dentista SET nome = '" + dentista.Nome + "' WHERE id =" + dentista.Id);
            int linhas1 = conexao.executar("UPDATE tb_dentista SET cro = '" + dentista.Cro + "' WHERE id =" + dentista.Id);
            int linhas2 = conexao.executar("UPDATE tb_dentista SET sexo = '" + dentista.Sexo + "' WHERE id =" + dentista.Id);
            int linhas3 = conexao.executar("UPDATE tb_dentista SET instagram = '" + dentista.instagram + "' WHERE id =" + dentista.Id);
            int linhas4 = conexao.executar("UPDATE tb_dentista SET linkedin = '" + dentista.linkedin + "' WHERE id =" + dentista.Id);
            int linhas5 = conexao.executar("UPDATE tb_dentista SET facebook = '" + dentista.facebook + "' WHERE id =" + dentista.Id);
            int linhas6 = conexao.executar("UPDATE tb_dentista SET twitter = '" + dentista.twitter + "' WHERE id =" + dentista.id);
        }
Example #4
0
        private void btn_SalvarP_Click_1(object sender, EventArgs e)
        {
            lerDados();
            con.conectar();
            String sql = "Insert into tb_paciente " +
                         "values (  '" + objPaciente.Nome + "' , '" + objPaciente.Cpf + "', '" + objPaciente.End + "' , '" + objPaciente.Tel + "',convert(date,'" + objPaciente.DTNasc.ToShortDateString() + "', 103)) ";

            Console.WriteLine(sql);
            if (con.executar(sql) == 1)
            {
                MessageBox.Show("Dados salvos com sucesso!");
            }
            else
            {
                MessageBox.Show("Dados não foram salvos !");
            }
            atualizarGrid();
        }