Пример #1
0
 // GET: Arquivo
 public ActionResult ExibirImagem(int id)
 {
     using (PacienteContexto db = new PacienteContexto())
     {
         var arquivoRetorno = db.Pacientes.Find(id);
         return(File(arquivoRetorno.Imagem, arquivoRetorno.ImagemTipo));
     }
 }
Пример #2
0
        public ActionResult Pesquisa()
        {
            using (var db = new PacienteContexto())
            {
                var _paciente = db.Pacientes.OrderBy(c => c.Nome).ThenBy(m => m.Sobrenome).ToList();
                var data      = new Paciente()
                {
                    Pacientes = _paciente
                };

                return(View(data));
            }
        }
Пример #3
0
        public ActionResult Pesquisa(Paciente _paciente)
        {
            using (var db = new PacienteContexto())
            {
                var pacientePesquisa = from pacienterec in db.Pacientes
                                       where ((_paciente.Nome == null) || (pacienterec.Nome == _paciente.Nome)) &&
                                       ((_paciente.CPF == null) || (pacienterec.CPF == _paciente.CPF.Trim())) &&
                                       ((_paciente.Dentista == null) || (pacienterec.Dentista == _paciente.Dentista))
                                       orderby pacienterec.Nome ascending
                                       select new
                {
                    PacienteID = pacienterec.PacienteID,
                    Nome       = pacienterec.Nome,
                    Sobrenome  = pacienterec.Sobrenome,
                    Endereço   = pacienterec.Endereço,
                    Email      = pacienterec.Email,
                    Telefone   = pacienterec.Telefone,
                    Whatsapp   = pacienterec.Whatsapp,
                    RG         = pacienterec.RG,
                    CPF        = pacienterec.CPF,
                    Indicação  = pacienterec.Indicação,
                    Dentista   = pacienterec.Dentista
                };
                List <Paciente> listaPaciente = new List <Paciente>();

                foreach (var reg in pacientePesquisa)
                {
                    Paciente pacientevalor = new Paciente();
                    pacientevalor.PacienteID = reg.PacienteID;
                    pacientevalor.Nome       = reg.Nome;
                    pacientevalor.Sobrenome  = reg.Sobrenome;
                    pacientevalor.Endereço   = reg.Endereço;
                    pacientevalor.Email      = reg.Email;
                    pacientevalor.Telefone   = reg.Telefone;
                    pacientevalor.Whatsapp   = reg.Whatsapp;
                    pacientevalor.RG         = reg.RG;
                    pacientevalor.CPF        = reg.CPF;
                    pacientevalor.Indicação  = reg.Indicação;
                    pacientevalor.Dentista   = reg.Dentista;
                    listaPaciente.Add(pacientevalor);
                }
                _paciente.Pacientes = listaPaciente;
                return(View(_paciente));
            }
        }
Пример #4
0
 public PacientesController(PacienteContexto contexto)
 {
     _context = contexto;
 }
Пример #5
0
 public PacienteRepositorio(PacienteContexto pacienteContexto)
 {
     this.contexto = pacienteContexto;
 }