Пример #1
0
        protected void ButtonAddGlicemia_Click(object sender, EventArgs e)
        {
            Panel_com_dois_botoes.Visible = true;

            //Limpar todos os campos
            TextBoxUnidades.Text     = "";
            TextBox_Observacoes.Text = "";
            TextBox_valor.Text       = "";
            DropDownListInsolina.ClearSelection();
            guardarGlicemia       = 0;
            ViewState["glicemia"] = guardarGlicemia;


            conexao.Open();
            DataSet data = new DataSet();

            comando.CommandText = "Select Datahora_add Data_Hora, Valor_Glicemia Glicemia, Insulina, Unidades_Administradas, Observacoes from Dados_Glicemia where Id_Doente = '" + username + "' order by Datahora_add asc";
            comando.CommandType = CommandType.Text;

            using (OracleDataAdapter dataAdapter = new OracleDataAdapter())
            {
                dataAdapter.SelectCommand = comando;
                dataAdapter.Fill(data);

                GridViewGlicemia.DataSource = data;
                GridViewGlicemia.DataBind();
            }
            conexao.Close();
        }
Пример #2
0
        protected void ButtonVer_Total_Click(object sender, EventArgs e)
        {
            panelDoente.Visible = false;
            panelDados.Visible  = true;

            conexao.Open();
            comando.CommandText = "SELECT Nome_Doente FROM Doente WHERE Numero_Utente = '" + TextBox_Procurar.Text + "'";
            TextBoxnome.Text    = Convert.ToString(comando.ExecuteScalar());

            DataSet data = new DataSet();

            comando.CommandText = "Select Datahora_add Data_Hora, Valor_Glicemia Glicemia, Insulina, Unidades_Administradas, Observacoes from Dados_Glicemia where Id_Doente = '" + username + "' order by DataHora_Add asc";
            comando.CommandType = CommandType.Text;

            using (OracleDataAdapter dataAdapter = new OracleDataAdapter())
            {
                dataAdapter.SelectCommand = comando;
                dataAdapter.Fill(data);

                GridViewGlicemia.DataSource = data;
                GridViewGlicemia.DataBind();
            }
            conexao.Close();
        }