Beispiel #1
0
        private void carregarGrid(ClinicaMedicaEntities4 conexao)
        {
            var lista = conexao.Paciente.ToList();

            GridPaciente.DataSource = lista;
            GridPaciente.DataBind();
        }
Beispiel #2
0
        private void carregarGrid(ClinicaMedicaEntities4 conexao)
        {
            var lista = conexao.Medicos.ToList();

            gridexame.DataSource = lista;
            gridexame.DataBind();
        }
        private void carregaexame(ClinicaMedicaEntities4 conexao)
        {
            var exame = conexao.Exame.ToList();

            ddlexame.DataSource     = exame;
            ddlexame.DataTextField  = "Tipo";
            ddlexame.DataValueField = "ID";
            ddlexame.DataBind();
        }
        private void carregamedico(ClinicaMedicaEntities4 conexao)
        {
            var medico = conexao.Medicos.ToList();

            ddlmedico.DataSource     = medico;
            ddlmedico.DataTextField  = "Nome";
            ddlmedico.DataValueField = "CRM";
            ddlmedico.DataBind();
        }
        private void carregapaciente(ClinicaMedicaEntities4 conexao)
        {
            var pacientes = conexao.Paciente.ToList();

            ddlpaciente.DataSource     = pacientes;
            ddlpaciente.DataTextField  = "Nome";
            ddlpaciente.DataValueField = "CPF";
            ddlpaciente.DataBind();
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         ClinicaMedicaEntities4 conexao = new ClinicaMedicaEntities4();
         carregarGrid(conexao);
         carregapaciente(conexao);
         carregaexame(conexao);
         carregamedico(conexao);
     }
 }
Beispiel #7
0
        protected void btnlogin_Click(object sender, EventArgs e)
        {
            string usuario = txtusuario.Text;
            string senha   = txtsenha.Text;

            ClinicaMedicaEntities4 conexao = new ClinicaMedicaEntities4();
            Usuario user = conexao.Usuario.FirstOrDefault(linha => linha.Login.Equals(usuario) && linha.Senha.Equals(senha));

            if (user != null)
            {
                Response.Redirect("Principal.aspx");
            }
        }
Beispiel #8
0
        protected void btncadastrar_Click(object sender, EventArgs e)
        {
            ClinicaMedicaEntities4 conexao = new ClinicaMedicaEntities4();

            Exame exame = new Exame();

            exame.Tipo  = txttipo.Text;
            exame.Valor = Convert.ToInt32(txtvalor.Text);

            conexao.Exame.Add(exame);
            conexao.SaveChanges();

            Limpar();

            carregarGrid(conexao);
        }
        protected void btncadastrar_Click(object sender, EventArgs e)
        {
            ClinicaMedicaEntities4 conexao = new ClinicaMedicaEntities4();
            Consultas c = new Consultas();

            c.Data        = Convert.ToDateTime(txtdata.Text);
            c.FK_Exame    = Convert.ToInt32(ddlexame.Text);
            c.FK_Medico   = Convert.ToDecimal(ddlmedico.Text);
            c.FK_Paciente = Convert.ToDecimal(ddlpaciente.Text);

            conexao.Consultas.Add(c);
            conexao.SaveChanges();

            Limpar();
            carregarGrid(conexao);
        }
Beispiel #10
0
        protected void btnalterar_Click1(object sender, EventArgs e)
        {
            if (GridPaciente.SelectedValue != null)
            {
                ClinicaMedicaEntities4 conexao = new ClinicaMedicaEntities4();
                int id = Convert.ToInt32(GridPaciente.SelectedValue.ToString());

                Paciente a = conexao.Paciente.FirstOrDefault(linha => linha.CPF.ToString().Equals(id.ToString()));

                txtnome.Text     = a.Nome;
                txtcpf.Text      = a.CPF.ToString();
                txtemail.Text    = a.Email;
                txtendereco.Text = a.Endereco;
                txtrg.Text       = a.RG.ToString();
                txttel.Text      = a.Telefone.ToString();
            }
        }
Beispiel #11
0
        protected void btncadastrar_Click(object sender, EventArgs e)
        {
            ClinicaMedicaEntities4 conexao = new ClinicaMedicaEntities4();

            Medicos m = new Medicos();

            m.CRM      = Convert.ToDecimal(txtcrm.Text);
            m.Nome     = txtnome.Text;
            m.CPF      = Convert.ToDecimal(txtcpf.Text);
            m.RG       = Convert.ToDecimal(txtrg.Text);
            m.Telefone = Convert.ToDecimal(txttel.Text);
            m.Email    = txtemail.Text;

            conexao.Medicos.Add(m);
            conexao.SaveChanges();

            Limpar();

            carregarGrid(conexao);
        }
Beispiel #12
0
        protected void btncadastrar_Click(object sender, EventArgs e)
        {
            ClinicaMedicaEntities4 conexao = new ClinicaMedicaEntities4();

            Paciente p = new Paciente();

            p.Nome     = txtnome.Text;
            p.CPF      = Convert.ToDecimal(txtcpf.Text);
            p.Endereco = txtendereco.Text;
            p.Email    = txtemail.Text;
            p.Telefone = Convert.ToDecimal(txttel.Text);
            p.RG       = Convert.ToDecimal(txtrg.Text);

            conexao.Paciente.Add(p);
            conexao.SaveChanges();

            Limpar();

            carregarGrid(conexao);
        }
Beispiel #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ClinicaMedicaEntities4 conexao = new ClinicaMedicaEntities4();

            carregarGrid(conexao);
        }