예제 #1
0
        public void get_equals_deve_retonar_false_caso_o_parametro_de_comparacao_seja_nulo_test()
        {
            var pacienteA = new Paciente { CPF = "123", Nome = "Paciente", Id = 1 };
            Paciente pacienteB = null;

            Assert.IsFalse(pacienteA.Equals(pacienteB));
        }
 public Agendamento(DateTime horario, Paciente paciente, int medicoId)
 {
     Id = Guid.NewGuid();
     Horario = horario;
     Paciente = paciente;
     MedicoId = medicoId;
 }
예제 #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        pacientes = new BL.SeguimientoPacientes();

            List<string> permisos = (List<string>)Session["Permisos_usuario"];
            bool permisoEncontrado = false;
            Paciente pac = new Paciente();

            foreach (string rol in permisos)
            {
                if (rol.Equals("pRepGen"))
                {
                    permisoEncontrado = true;
                    break;
                }
            }

            if (!permisoEncontrado)
            {
                //Si no tiene permiso redireccionamos
                //Response.Write("<script>alert('Usted no posee permisos suficientes para accesar a este recurso')</script>");
                Response.Redirect("NoAccess.aspx");
            }

        //RadioButtonList1.SelectedIndex = 0;
    }
예제 #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            Paciente objPaciente = new Paciente();

            objPaciente.setNombre(this.textNombre.Text);
            objPaciente.setApellido(this.textApellido.Text);
            objPaciente.setDni(this.textDni.Text);
            objPaciente.setIdObra(this.comprobarIdObra());
            objPaciente.setNacimiento(this.maskedNacimiento.Text);
            objPaciente.setCelular(this.maskedCelular.Text);
            objPaciente.setCiudad(this.comboCiudad.Text);
            objPaciente.setDireccion(this.textDireccion.Text);
            objPaciente.setMatricula(this.comprobarDoctor());

            if (objPaciente.existePaciente())
            {
                // EL PACIENTE EXISTE - SE VAN A ACTUALIZAR LOS DATOS PERSONALES
                objPaciente.ActualizarPaciente();
            }
            else
            {
                // EL PACIENTE NO EXISTE - SE CREA UNO NUEVO
                objPaciente.NuevoPaciente();
            }

            this.limpiarCampos();
        }
예제 #5
0
        public void get_equals_deve_retornar_true_com_os_mesmos_valores_e_instancias_diferentes_test()
        {
            var pacienteA = new Paciente { CPF = "123", Nome = "Paciente", Id = 1 };
            var pacienteB = new Paciente { CPF = "123", Nome = "Paciente", Id = 1 };

            Assert.IsTrue(pacienteA.Equals(pacienteB));
        }
예제 #6
0
        public void inicializar()
        {
            paciente = new Paciente { Nome = "Isaac" ,CPF = "01234567890",Nascimento = DateTime.Now,Sexo = new TipoSexo{Nome ="Masculino"} };

            pacientes = new Pacientes(Session);

            pacientes.Adicionar(paciente);
        }
예제 #7
0
 private void BtnGuardar_Click(object sender, EventArgs e)
 {
     Paciente paciente = new Paciente();
     paciente.Nombre = TxtNombre.Text;
     paciente.Apellido = TxtApellido.Text;
     paciente.IdObraSocial = 2;
     _pacienteService.Insert(paciente);
 }
예제 #8
0
        public void a_Criar_Banco_De_Dados_Por_Modelo()
        {
            pacientes = new Pacientes();

            paciente = new Paciente {CPF = "6576576", Nome = "Isaac"};

            pacientes.Adicionar(paciente);
        }
 private void frmAtendimentoMedico_Load(object sender, EventArgs e)
 {
     Paciente P = new Paciente();
     if (!File.Exists(@"Paciente.txt"))
     {
         AtualizaPacientes();
     }
 }
예제 #10
0
        public bool Validate(Paciente entity)
        {
            ValidationErros.Clear();

            if (!string.IsNullOrEmpty(entity.Nome) && entity.Nome.ToLower() == entity.Nome)
            {
                ValidationErros.Add(new KeyValuePair<string, string>("Nome do Paciente", "O Nome do paciente não pode ser todo minúsculo."));
            }

            return ValidationErros.Count == 0;
        }
예제 #11
0
        public FabricaDeAgendamento InformarPaciente(string cpf, string Nome)
        {
            PlanoDeSaude planoDeSaude = new PlanoDeSaude();
            planoDeSaude.CNPJ = "123456";
            planoDeSaude.RazaoSocial = "AAAA";
            Paciente paciente = new Paciente(cpf, Nome);
            paciente.InformarPlanoDeSaude(planoDeSaude);

            _Agendamento.InformarPaciente(paciente);
            return this;
        }
 public bool CreatePaciente(Paciente paciente)
 {
     LittleDatabaseEntities DB = new LittleDatabaseEntities();
     TheEverythingProject.Paciente p = new TheEverythingProject.Paciente();
     p.Nombre = paciente.Nombre;
     p.ApellidoPaterno = paciente.ApellidoPaterno;
     p.ApellidoMaterno = paciente.ApellidoMaterno;
     p.Sexo = paciente.Sexo.ToString();
     p.Telefono = paciente.Telefono;
     DB.Pacientes.Add(p);
     DB.SaveChanges();
     return true;
 }
예제 #13
0
        public ActionResult DadosGerais(Paciente paciente)
        {
            try
            {
                // TODO: Add insert logic here

                return RedirectToAction("DadosGeraisrrr");
            }
            catch
            {
                return Redirect("DadosGerais");
            }
        }
예제 #14
0
        private void Salvarbutton_Click(object sender, EventArgs e)
        {
            Paciente paciente = new Paciente();
            try
            {
                paciente.Cadastrar(int.Parse(CpftextBox.Text), NometextBox.Text, Convert.ToDateTime(DataNasctextBox.Text), TelefonetextBox.Text);

                MessageBox.Show("Paciente cadastrado.");
            }
            catch (Exception ex)
            {
                MessageBox.Show("Erro ao cadastrar o paciente: " + ex.Message);
            }
        }
예제 #15
0
        public List<Paciente> Get(Paciente searchPaciente)
        {
            List<Paciente> pacientes = new List<Paciente>();

            //TODO: Add you own data acess method here
            var repository = new PacienteRepositorio(new Context());
            pacientes = repository.GetPacientes();

            if (!string.IsNullOrEmpty(searchPaciente.Nome))
            {
                pacientes = pacientes.FindAll(p => p.Nome.ToLower().StartsWith(searchPaciente.Nome, StringComparison.CurrentCultureIgnoreCase));
            }

            return pacientes;
        }
        private static Paciente VerificaPaciente(int pacienteId, string pacienteName)
        {
            var entities = new Entities();

            var pacienteIdString = pacienteId.ToString();

            var pacientes = from p in entities.Paciente
                            where p.Codigo == pacienteIdString
                            select p;

            if (!pacientes.Any())
            {
                var novoPaciente = new Paciente { Codigo = pacienteId.ToString(), Nome = pacienteName };
                entities.Paciente.AddObject(novoPaciente);
                entities.SaveChanges();
                return novoPaciente;
            }
            return pacientes.First();
        }
예제 #17
0
        public void ComoAtendenteQueroCadastrarUmPacienteInconsistenteParaSistemaValidar()
        {
            //Arrange
            Paciente paciente = new Paciente("", " ");

            //Act
            paciente.InformarPlanoDeSaude(new PlanoDeSaude { CNPJ = "456", RazaoSocial = "JBS Medical Services" });

            IPacientes dalPaciente = new DalPacienteFake();

            var retorno = dalPaciente.Gravar(paciente);
            var retorno2 = dalPaciente.RetornarPorCPF("12345");

            //Assert
            Assert.IsTrue(retorno);
            Assert.IsTrue(retorno2.CPF == "12345");
            Assert.IsTrue(retorno2.Nome == "Fabio Margarito", "Assert fail on Nome");
            Assert.IsTrue(retorno2.PlanoDeSaude.CNPJ == "456");
            Assert.IsTrue(retorno2.PlanoDeSaude.RazaoSocial == "JBS Medical Services");
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            List<string> permisos = (List<string>)Session["Permisos_usuario"];
            bool permisoEncontrado = false;
            Paciente pac = new Paciente();

            foreach (string rol in permisos)
            {
                if (rol.Equals("pSegPac"))
                {
                    permisoEncontrado = true;
                    break;
                }
            }

            if (!permisoEncontrado)
            {
                //Si no tiene permiso redireccionamos
                //Response.Write("<script>alert('Usted no posee permisos suficientes para accesar a este recurso')</script>");
                Response.Redirect("NoAccess.aspx");
            }

            if (!IsPostBack)
            {
                if (!pac.isDoctor(Session.Contents["nombre_usuario"].ToString()))
                    cargarDoctores();
                else
                    cargarDoctor();
            }

            ceFechaFinal.SelectedDate = DateTime.Now;
            ceFechaInicio.SelectedDate = DateTime.Now;
        }
        catch (Exception error)
        {
            Session["Error_Msg"] = error.Message;
            Response.Redirect("~/Error.aspx", true);
        }
    }
        //Convierte una Entity de NHibernate en un objeto DTO, sus propiedades basicas
        //y utiliza el metodo Transformer de sus objetos mas complejos
        public static PacienteDTO EntityToDTO(Paciente pPaciente)
        {
            PacienteDTO pReturn = new PacienteDTO();
            pReturn.ID = pPaciente.ID;
            pReturn.Nombre = pPaciente.Nombre;
            pReturn.Apellido = pPaciente.Apellido;
            pReturn.Direccion = pPaciente.Direccion;
            pReturn.FechaNacimiento = pPaciente.FechaNacimiento;
            pReturn.NumDocumento = pPaciente.NumDocumento;
            pReturn.Sexo = pPaciente.Sexo;
            pReturn.IdObraSocial = pPaciente.IdObraSocial;
            if (pPaciente.IdObraSocialLookup != null)
                pReturn.IdObraSocialLookup = TransformerObraSocial.EntityToDTO(pPaciente.IdObraSocialLookup);
            //Audifonos
            if (pPaciente.Audifonos != null)
            {
                foreach (AudifonoPaciente pObj in pPaciente.Audifonos)
                {
                    pReturn.Audifonos.Add(TransformerAudifonoPaciente.EntityToDTO(pObj));
                }
            }
            //HistoriasClinicas
            if (pPaciente.HistoriaClinicas != null)
            {
                foreach (HistoriaClinica pObj in pPaciente.HistoriaClinicas)
                {
                    pReturn.HistoriaClinicas.Add(TransformerHistoriaClinica.EntityToDTO(pObj));
                }
            }
            //Moldes
            if (pPaciente.Moldes != null)
            {
                foreach (MoldePaciente pObj in pPaciente.Moldes)
                {
                    pReturn.Moldes.Add(TransformerMoldePaciente.EntityToDTO(pObj));
                }
            }

            return pReturn;
        }
예제 #20
0
        public bool Insert(Paciente entity)
        {
            bool ret = false;
            ret = Validate(entity);

            if (ret)
            {
                // TODO: Create INSERT code here
                try
                {
                    var repository = new PacienteRepositorio(new Context());
                    repository.InserirPaciente(entity);
                    repository.Salvar();
                }
                catch (Exception)
                {
                }

            }

            return ret;
        }
예제 #21
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            Fisioterapeuta f = new Fisioterapeuta();
            f.Nome = "Fisioterapeuta1";

            using (var ctx = new Model1Container())
            {
                ctx.Set<Fisioterapeuta>().Add(f);
                ctx.SaveChanges();
            }

            Fisioterapeuta f2 = new Fisioterapeuta();
            using (var ctx = new Model1Container())
            {
                f2 = ctx.Set<Fisioterapeuta>().FirstOrDefault();
            }

            Paciente p = new Paciente();
            p.Nome = "Paciente1";
            //HERE ARE THE TRICK. I MANAGE THE ID OF THE RELATED ENTITIE, I DONT LET THIS WORK FOR EF.
            p.FisioterapeutaId = f2.Id;

            using (var ctx = new Model1Container())
            {
                ctx.Set<Paciente>().Add(p);
                ctx.SaveChanges();
            }

            List<Fisioterapeuta> lstFisio = new List<Fisioterapeuta>();
            List<Paciente> lstPaciente = new List<Paciente>();
            using (var ctx = new Model1Container())
            {
                lstFisio = ctx.Set<Fisioterapeuta>().ToList();
                lstPaciente = ctx.Set<Paciente>().ToList();
            }

            dgFisioterapeuta.ItemsSource = lstFisio;
            dgPaciente.ItemsSource = lstPaciente;
        }
    private void cargarDoctores()
    {
        try
        {
            BL.Empleados doctores = new BL.Empleados();
            Usuarios usuarios = new Usuarios();
            Paciente pac = new Paciente();

            List<string> usuariosTemp = usuarios.RetrieveUserNames();
            List<string> usersDocs = new List<string>();
            List<long> ids = new List<long>();
            List<string> nombres = new List<string>();
            List<string> apellido = new List<string>();
            List<string> segundoApellido = new List<string>();

            foreach (string doc in usuariosTemp)
            {
                if (pac.isDoctor(doc))
                {
                    ids.Add(usuarios.retriveEmpId(doc));
                    usersDocs.Add(doc);
                }
            }

            foreach (long codigo in ids)
            {
                nombres.Add(doctores.obtenerNombresDoctores(codigo));
                apellido.Add(doctores.obtenerApellidoDoctores(codigo));
                segundoApellido.Add(doctores.obtenerSegundoApellidoDoctores(codigo));
            }

            ListItem temporal = new ListItem();
            temporal.Text = "--- Todos ---";
            temporal.Value = "todos";
            temporal.Selected = true;
            ddlDoctor.Items.Add(temporal);

            for (int i = 0; i < nombres.Count; i++)
            {
                ListItem item = new ListItem();
                item.Text = nombres[i] + " " + apellido[i] + " " + segundoApellido[i];
                item.Value = usersDocs[i].ToString();
                ddlDoctor.Items.Add(item);
            }
        }
        catch (Exception error)
        {
            Session["Error_Msg"] = error.Message;
            Response.Redirect("~/Error.aspx", true);
        }
    }
예제 #23
0
 public void AtualizaPaciente(Paciente paciente)
 {
     _context.Entry(paciente).State = EntityState.Modified;
 }
예제 #24
0
 public void Cadastrar(Paciente NovoPac)
 {
     ctx.Pacientes.Add(NovoPac);
     ctx.SaveChanges();
 }
예제 #25
0
 public void Excluir(Paciente paciente)
 {
     connection.Execute(queryDelete, new { CODPACIENTE = paciente.Codigo });
 }
예제 #26
0
        public ActionResult Add(Usuario usuario, Paciente paciente, Psicologo psicologo, Administrador admin)
        {
            IRepository repository = new Model.Repository();
            int         id         = 0;
            string      strMensaje = "No se pudo actualizar la información, intentelo más tarde";
            bool        okResult   = false;

            if (usuario.IdUsuario > 0)
            {
                id = usuario.IdUsuario;
                Usuarios UpdatePaciente = repository.FindEntity <Usuarios>(c => c.IdUsuario == usuario.IdUsuario);
                var      Tipo           = repository.FindEntity <Usuarios>(c => c.IdUsuario == usuario.IdUsuario).TipoUsuario;
                if (Tipo == "Paciente")
                {
                    Paciente actualizar = new Paciente();
                    strMensaje = actualizar.actualizar(usuario, paciente);
                    okResult   = true;
                }
                else if (Tipo == "Psicologo")
                {
                    Psicologo actualizar = new Psicologo();
                    strMensaje = actualizar.actualizar(usuario, psicologo);
                    okResult   = true;
                }
                else if (Tipo == "Administrador")
                {
                    Administrador actualizar = new Administrador();
                    strMensaje = actualizar.Actualizar(usuario, admin);
                    okResult   = true;
                }
            }
            else
            {
                if (usuario.TipoUsuario == "Paciente")
                {
                    id = paciente.IdPaciente;
                    Paciente actualizar = new Paciente();
                    okResult   = true;
                    strMensaje = actualizar.crear(usuario, paciente);
                }

                else if (usuario.TipoUsuario == "Psicologo")
                {
                    id = psicologo.IdPsicologo;
                    Psicologo actualizar = new Psicologo();
                    okResult   = true;
                    strMensaje = actualizar.crear(usuario, psicologo);
                }

                else if (usuario.TipoUsuario == "Administrador")
                {
                    id = admin.IdAdministrador;
                    Administrador actualizar = new Administrador();
                    okResult   = true;
                    strMensaje = actualizar.crear(usuario, admin);
                }
            }
            return(Json(new Response {
                IsSuccess = okResult, Message = strMensaje, Id = id
            }, JsonRequestBehavior.AllowGet));
        }
예제 #27
0
        public List <Consulta> Consultar(ConsultaFiltro pFiltro)
        {
            List <Consulta> retorno = new List <Consulta>();

            try
            {
                AbrirConexao();

                //instrucao a ser executada
                String sqlQuery = "SELECT P.NOME AS NOME" +
                                  ", P.CPF AS CPF" +
                                  ", P.TELEFONE AS TELEFONE" +
                                  ", P.DATANASCIMENTO AS DATANASCIMENTO" +
                                  ", A.DATAHORA AS DATACONSULTA" +
                                  ", T.NOME AS NOMECTRATAMENTO" +
                                  ", S.DESCRICAO AS DESCSITUACAO" +
                                  " FROM ATENDIMENTO AS A" +
                                  " LEFT JOIN  PACIENTE AS P ON A.FK_PACIENTE_CPF = P.CPF" +
                                  " LEFT JOIN  SITUACAO AS S ON A.FK_SITUACAO_CODIGO = S.CODIGO" +
                                  " LEFT JOIN  TRATAMENTO AS T ON A.FK_TRATAMENTO_CODIGO = T.CODIGO" +
                                  " WHERE (A.DATAHORA >= @DATAINICIO" +
                                  "   AND  A.DATAHORA <= @DATAFIM)" +
                                  "   AND  P.NOME LIKE @NOMEPACIENTE" +
                                  "   AND  P.CPF LIKE @CPF" +
                                  " ORDER  BY A.DATAHORA";
                SqlCommand cmd = new SqlCommand(sqlQuery, SqlConn);

                cmd.Parameters.Add("@DATAINICIO", SqlDbType.DateTime).Value  = SiteUtil.FormatarData(pFiltro.DataInicio);
                cmd.Parameters.Add("@DATAFIM", SqlDbType.DateTime).Value     = SiteUtil.FormatarData(pFiltro.DataFim) + " 23:59:59";
                cmd.Parameters.Add("@NOMEPACIENTE", SqlDbType.VarChar).Value = "%" + pFiltro.NomePaciente + "%";

                if (0L.Equals(pFiltro.Cpf))
                {
                    cmd.Parameters.Add("@CPF", SqlDbType.VarChar).Value = "%%";
                }
                else
                {
                    cmd.Parameters.Add("@CPF", SqlDbType.VarChar).Value = "%" + pFiltro.Cpf + "%";
                }

                //executando a instrucao e colocando o resultado em um leitor
                SqlDataReader DbReader = cmd.ExecuteReader();
                //lendo o resultado da consulta
                while (DbReader.Read())
                {
                    Consulta consulta = new Consulta();
                    Paciente paciente = new Paciente
                    {
                        //acessando os valores das colunas do resultado
                        Nome     = DbReader.GetString(DbReader.GetOrdinal("NOME")),
                        Cpf      = DbReader.GetInt64(DbReader.GetOrdinal("CPF")),
                        Telefone = DbReader.GetInt64(DbReader.GetOrdinal("TELEFONE")),
                        Date     = DbReader.GetDateTime(DbReader.GetOrdinal("DATANASCIMENTO"))
                    };
                    consulta.Paciente     = paciente;
                    consulta.DataConsulta = DbReader.GetDateTime(DbReader.GetOrdinal("DATACONSULTA"));
                    Tratamento tratamento = new Tratamento
                    {
                        Nome = DbReader.GetString(DbReader.GetOrdinal("NOMECTRATAMENTO"))
                    };
                    consulta.Tratamento = tratamento;
                    Situacao situacao = new Situacao
                    {
                        Descricao = DbReader.GetString(DbReader.GetOrdinal("DESCSITUACAO"))
                    };
                    consulta.Situacao = situacao;
                    retorno.Add(consulta);
                }
                //fechando o leitor de resultados
                DbReader.Close();
                //liberando a memoria
                cmd.Dispose();
                //fechando a conexao
                FecharConexao();
                return(retorno);
            }
            catch (InvalidCastException Ex)
            {
                throw new Exception("Erro ao consultar dados do atendimento\n" + Ex.Message);
            }
            catch (SqlException Ex)
            {
                throw new Exception("Erro ao consultar dados do atendimento\n" + Ex.Message);
            }
            catch (IOException Ex)
            {
                throw new Exception("Erro ao consultar dados do atendimento\n" + Ex.Message);
            }
            catch (InvalidOperationException Ex)
            {
                throw new Exception("Erro ao consultar dados do atendimento\n" + Ex.Message);
            }
            finally
            {
                FecharConexao();
            }
        }
예제 #28
0
 public void InformarPaciente(Paciente paciente)
 {
     Paciente = paciente;
 }
예제 #29
0
 void FinAtencion(Paciente p, Medico m)
 {
     MessageBox.Show("termino la atencion de " + p + " por " + m);
 }
예제 #30
0
        public static void Initialize(SisConsultaContext context)
        {
            context.Database.EnsureCreated();

            // Look for any students.
            if (context.Pacientes.Any())
            {
                return;   // DB has been seeded
            }

            var pacientes = new Paciente[]
            {
                new Paciente {
                    NomePaciente = "Joao Vitor de Souza",
                    Cpf          = "089.833.719-00",
                    NumTelefone  = "(48)98855-5800",
                    Email        = "*****@*****.**",
                    Rua          = "Rua uruguai",
                    Numero       = 666,
                    Bairro       = "Nações",
                    Cidade       = "Itajai"
                },
                new Paciente {
                    NomePaciente = "Jonas",
                    Cpf          = "338.528.474-00",
                    NumTelefone  = "(48)98854-4119",
                    Email        = "*****@*****.**",
                    Rua          = "Rua Paraguai",
                    Numero       = 999,
                    Bairro       = "Nações",
                    Cidade       = "Itajai"
                },
                //new Paciente{FirstMidName="Nino",LastName="Olivetto",EnrollmentDate=DateTime.Parse("2005-09-01")}
            };

            foreach (Paciente s in pacientes)
            {
                context.Pacientes.Add(s);
            }
            context.SaveChanges();

            var medicos = new Medico[]
            {
                new Medico {
                    Nome          = "Ana Carolina Steiner Stüpp",
                    Email         = "*****@*****.**",
                    Especialidade = "Fonoaudiologia"
                }
            };

            foreach (Medico c in medicos)
            {
                context.Medicos.Add(c);
            }
            context.SaveChanges();

            var consultas = new Consulta[]
            {
                new Consulta {
                    MedicoID = 1, PacienteID = 1, DataConsulta = DateTime.Parse("2019-04-13 15:00:00"), DataFinalConsulta = DateTime.Parse("2019-04-13 16:00:00")
                }
            };

            foreach (Consulta e in consultas)
            {
                context.Consultas.Add(e);
            }
            context.SaveChanges();
        }
예제 #31
0
 public Paciente RetornarPorCPF(string s)
 {
     Paciente paciente = new Paciente("12345", "Fabio Margarito");
     paciente.InformarPlanoDeSaude(new PlanoDeSaude { CNPJ = "456", RazaoSocial = "JBS Medical Services" });
     return paciente;
 }
예제 #32
0
        protected override void Seed(Clinica.Models.ClinicaContext context)
        {
            // Odontologos
            Odontologo o1 = new Odontologo()

            {
                Id            = 1,
                Nombres       = "Dra.Pamela",
                Apellidos     = "Cea",
                Telefonos     = 123456789,
                Direcciones   = "Chiguayante",
                Region        = "VIII",
                Comuna        = "Lota",
                Correos       = "*****@*****.**",
                Sueldo        = 800000,
                Rut           = "16037888-5",
                IdTratamiento = 1,
                FechaIngreso  = DateTime.Now,
                Edad          = 30,
                //  Especialidad = "Endodoncia"
            };

            Odontologo o2 = new Odontologo()

            {
                Id            = 2,
                Nombres       = "Dra. Jazmin",
                Apellidos     = "Briones",
                Telefonos     = 123456789,
                Direcciones   = "Concepcion",
                Region        = "VIII",
                Comuna        = "Lota",
                Correos       = "*****@*****.**",
                Sueldo        = 800000,
                Rut           = "123456789",
                IdTratamiento = 1,
                FechaIngreso  = DateTime.Now,
                Edad          = 40,
                //      Especialidad = "Limpieza General"
            };

            Odontologo o3 = new Odontologo()

            {
                Id            = 3,
                Nombres       = "Dr.Maria",
                Apellidos     = "Urrutia",
                Telefonos     = 123456789,
                Direcciones   = "Santiago",
                Region        = "VIII",
                Comuna        = "Lota",
                Correos       = "*****@*****.**",
                Sueldo        = 800000,
                Rut           = "123456789",
                IdTratamiento = 1,
                FechaIngreso  = DateTime.Now,
                Edad          = 40,
                //    Especialidad = "Limpieza General"
            };

            Odontologo o4 = new Odontologo()

            {
                Id            = 4,
                Nombres       = "Dra.Carolina",
                Apellidos     = "Norambuena",
                Telefonos     = 123456789,
                Direcciones   = "Santiago",
                Region        = "VIII",
                Comuna        = "Lota",
                Correos       = "*****@*****.**",
                Sueldo        = 800000,
                Rut           = "123456789",
                IdTratamiento = 1,
                FechaIngreso  = DateTime.Now,
                Edad          = 40,
                //       Especialidad = "Limpieza General"
            };

            context.Odontologos.Add(o1);
            context.Odontologos.Add(o2);
            context.Odontologos.Add(o3);
            context.Odontologos.Add(o4);
            context.SaveChanges();



            // Tratamientos



            Tratamiento t1 = new Tratamiento()
            {
                Nombres       = "Endodoncia",
                Valor         = 80000,
                IdOdontologo  = 1,
                Codigos       = 00001,
                Descripcion   = "Tratamiento",
                Horarios      = DateTime.Now,
                FechaCreacion = DateTime.Now
            };

            Tratamiento t2 = new Tratamiento()
            {
                Nombres       = "Ortodoncia",
                Valor         = 150000,
                IdOdontologo  = 2,
                Codigos       = 00003,
                Descripcion   = "Tratamiento",
                Horarios      = DateTime.Now,
                FechaCreacion = DateTime.Now
            };
            Tratamiento t3 = new Tratamiento()
            {
                Nombres       = "Protesis",
                Valor         = 50000,
                IdOdontologo  = 3,
                Codigos       = 00003,
                Descripcion   = "Tratamiento",
                Horarios      = DateTime.Now,
                FechaCreacion = DateTime.Now
            };
            Tratamiento t4 = new Tratamiento()
            {
                Nombres       = "Limpieza ",
                Valor         = 150000,
                IdOdontologo  = 4,
                Codigos       = 00003,
                Descripcion   = "Tratamiento",
                Horarios      = DateTime.Now,
                FechaCreacion = DateTime.Now
            };

            context.Tratamientos.Add(t1);
            context.Tratamientos.Add(t2);
            context.Tratamientos.Add(t3);
            context.Tratamientos.Add(t4);
            context.SaveChanges();



            // Pacientes
            Paciente p1 = new Paciente()
            {
                Nombre    = "Danny",
                Apellido  = "Gutierrez",
                Rut       = "18.588.666-5",
                Edad      = 28,
                Correo    = "*****@*****.**",
                Region    = "VIII",
                Comuna    = "Lota",
                Direccion = "Alamos 203, Coronel",
                Telefono  = 965855214
            };
            Paciente p2 = new Paciente()
            {
                Nombre    = "Claudio",
                Apellido  = "Quezada",
                Rut       = "17.545.141-5",
                Edad      = 29,
                Correo    = "*****@*****.**",
                Region    = "VIII",
                Comuna    = "Lota",
                Direccion = "Boldos 323, Coronel",
                Telefono  = 412712413
            };
            Paciente p3 = new Paciente()
            {
                Nombre    = "Fabian",
                Apellido  = "Zenteno",
                Rut       = "18.588.666-5",
                Edad      = 28,
                Correo    = "*****@*****.**",
                Region    = "VIII",
                Comuna    = "Lota",
                Direccion = "Alamos 203, Coronel",
                Telefono  = 965855214
            };
            Paciente p4 = new Paciente()
            {
                Nombre    = "Juanito",
                Apellido  = "Perez",
                Rut       = "18.588.666-5",
                Edad      = 28,
                Correo    = "*****@*****.**",
                Region    = "VIII",
                Comuna    = "Lota",
                Direccion = "Alamos 203, Coronel",
                Telefono  = 965855214
            };

            context.Pacientes.Add(p1);
            context.Pacientes.Add(p2);
            context.Pacientes.Add(p3);
            context.Pacientes.Add(p4);
            context.SaveChanges();

            // Relacion Paciente Tratamiento

            PacienteTratamiento pt1 = new PacienteTratamiento()
            {
                PacienteId    = p1.Id,
                TratamientoId = t1.Id
            };

            PacienteTratamiento pt2 = new PacienteTratamiento()
            {
                PacienteId    = p1.Id,
                TratamientoId = t2.Id
            };
            PacienteTratamiento pt3 = new PacienteTratamiento()
            {
                PacienteId    = p2.Id,
                TratamientoId = t2.Id
            };

            PacienteTratamiento pt4 = new PacienteTratamiento()
            {
                PacienteId    = p3.Id,
                TratamientoId = t3.Id
            };

            PacienteTratamiento pt5 = new PacienteTratamiento()
            {
                PacienteId    = p4.Id,
                TratamientoId = t3.Id
            };

            context.RegistrosPT.Add(pt1);
            context.RegistrosPT.Add(pt2);
            context.RegistrosPT.Add(pt3);
            context.RegistrosPT.Add(pt4);
            context.RegistrosPT.Add(pt5);
            context.SaveChanges();



            //Boletas
            Boleta b1 = new Boleta()
            {
                NB = 001,
                //Nombre = "Pedro",
                //Apellido = "Molina",
                IdOdontologo  = 1,
                IdPaciente    = 1,
                IdTratamiento = 1,
                Fecha         = DateTime.Today,
                Fono          = 985475575,
                Valor         = 80000,
                Detalle       = "Endodoncia"
            };
            Boleta b2 = new Boleta()
            {
                NB = 002,
                //Nombre = "Daniel",
                //Apellido = "Montes",
                IdOdontologo  = 2,
                IdPaciente    = 2,
                IdTratamiento = 2,
                Fecha         = DateTime.Today,
                Fono          = 925478547,
                Valor         = 30000,
                Detalle       = "Limpieza"
            };

            Boleta b3 = new Boleta()
            {
                NB = 003,
                //   Nombre = "Francisca",
                // Apellido = "Molina",
                IdOdontologo  = 3,
                IdPaciente    = 2,
                IdTratamiento = 1,
                Fecha         = DateTime.Today,
                Fono          = 985475575,
                Valor         = 80000,
                Detalle       = "Endodoncia"
            };
            Boleta b4 = new Boleta()
            {
                NB = 004,
                //Nombre = "Roberto",
                //Apellido = "Molina",
                IdOdontologo  = 4,
                IdPaciente    = 1,
                IdTratamiento = 2,
                Fecha         = DateTime.Today,
                Fono          = 985475575,
                Valor         = 80000,
                Detalle       = "Endodoncia"
            };

            context.Boletas.Add(b1);
            context.Boletas.Add(b2);
            context.Boletas.Add(b3);
            context.Boletas.Add(b4);
            context.SaveChanges();

            // Registro de enfermedad
            BoletaPaciente bp1 = new BoletaPaciente()
            {
                PacienteId = p1.Id,
                BoletaId   = b1.Id,
            };
            BoletaPaciente bp2 = new BoletaPaciente()
            {
                PacienteId = p1.Id,
                BoletaId   = b2.Id,
            };
            BoletaPaciente bp3 = new BoletaPaciente()
            {
                PacienteId = p2.Id,
                BoletaId   = b2.Id,
            };

            context.Registros.Add(bp1);
            context.Registros.Add(bp2);
            context.Registros.Add(bp3);
            context.SaveChanges();


            //Citas
            Cita c1 = new Cita()
            {
                // Rut = "17.157.414-4",
                //Nombre = "Daniel",
                //Apellido = "Montes",
                IdPaciente    = 1,
                IdTratamiento = 1,


                Fecha        = DateTime.Now,
                IdOdontologo = 1,
                Telefono     = 412712413,
                Motivo       = "Limpieza",
            };
            Cita c2 = new Cita()
            {
                //  Rut = "12.345.678-1",
                // Nombre = "peters",
                //Apellido = "parras",
                IdPaciente    = 2,
                IdTratamiento = 1,
                Fecha         = DateTime.Now,
                IdOdontologo  = 2,
                Telefono      = 966585422,
                Motivo        = "Endodoncia",
            };
            Cita c3 = new Cita()
            {
                //   Rut = "99.999.999-9",
                // Nombre = "Daniela",
                //Apellido = "Montes",
                IdPaciente    = 3,
                IdTratamiento = 1,
                Fecha         = DateTime.Now,
                IdOdontologo  = 3,
                Telefono      = 412712413,
                Motivo        = "Limpieza",
            };
            Cita c4 = new Cita()
            {
                //   Rut = "55.555.555-5",
                // Nombre = "andrea",
                //Apellido = "Montes",
                IdPaciente    = 4,
                IdTratamiento = 1,
                Fecha         = DateTime.Now,
                IdOdontologo  = 4,
                Telefono      = 412712413,
                Motivo        = "Limpieza",
            };

            context.Citas.Add(c1);
            context.Citas.Add(c2);
            context.Citas.Add(c3);
            context.Citas.Add(c4);
            context.SaveChanges();


            // Relacion paciente Citas

            PacienteCita pc1 = new PacienteCita()
            {
                PacienteId = p1.Id,
                CitaId     = c1.Id
            };

            PacienteCita pc2 = new PacienteCita()
            {
                PacienteId = p1.Id,
                CitaId     = c2.Id
            };
            PacienteCita pc3 = new PacienteCita()
            {
                PacienteId = p2.Id,
                CitaId     = c2.Id
            };

            context.RegistrosPC.Add(pc1);

            context.RegistrosPC.Add(pc2);

            context.RegistrosPC.Add(pc3);
            context.SaveChanges();

            // Relacion odontologo citas
            OdontologoCita od1 = new OdontologoCita()
            {
                OdontologoId = o1.Id,
                CitaId       = c1.Id
            };

            OdontologoCita od2 = new OdontologoCita()
            {
                OdontologoId = o1.Id,
                CitaId       = c2.Id
            };

            OdontologoCita od3 = new OdontologoCita()
            {
                OdontologoId = o2.Id,
                CitaId       = c2.Id
            };

            context.RegistrosCi.Add(od1);
            context.RegistrosCi.Add(od2);
            context.RegistrosCi.Add(od3);
            context.SaveChanges();

            //Remuneraciones
            Remuneracion r1 = new Remuneracion()
            {
                // Nombre = "Andrea",
                // Apellido = "Garcia",


                IdOdontologo = 1,

                Monto = 800000,
            };
            Remuneracion r2 = new Remuneracion()
            {
                //   Nombre = "Jazmin",
                // Apellido = "Ramirez",
                IdOdontologo = 2,

                Monto = 800000,
            };

            Remuneracion r3 = new Remuneracion()
            {
                //   Nombre = "Alejandro",
                // Apellido = "Ramirez",
                IdOdontologo = 3,

                Monto = 800000,
            };

            Remuneracion r4 = new Remuneracion()
            {
                //    Nombre = "Claudia",
                //  Apellido = "Ramirez",
                IdOdontologo = 4,

                Monto = 800000,
            };

            context.Remuneraciones.Add(r1);
            context.Remuneraciones.Add(r2);
            context.Remuneraciones.Add(r3);
            context.Remuneraciones.Add(r4);
            context.SaveChanges();

            //Relacion odontologo Remuneraciones
            OdontologoRemu odr = new OdontologoRemu()
            {
                OdontologoId   = o1.Id,
                RemuneracionId = r1.Id
            };

            context.RegistrosRe.Add(odr);
            context.SaveChanges();
        }
 public Task <int> UpdateAsync(Paciente paciente)
 {
     _context.Update(paciente);
     return(_context.SaveChangesAsync());
 }
 public int Update(Paciente paciente)
 {
     _context.Update(paciente);
     return(_context.SaveChanges());
 }
예제 #35
0
 private void ActualizarListaPacientes()
 {
     lstPaciente.DataSource = null;
     lstPaciente.DataSource = Paciente.ObtenerPaciente();
 }
예제 #36
0
        private void backgroundWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            Operacion operacion =  (Operacion)Enum.Parse(typeof(Operacion), e.Argument.ToString());

            try
            {
                //Borrar
                Thread.Sleep(3000);

                switch (operacion)
                {
                    case Operacion.CARGAR_GRILLA:
                        _pacienteDTOList = _pacienteAssembler.CreateDTOArrayList(_pacienteService.GetAll());
                        break;
                    case Operacion.INSERTAR:
                        _paciente = _pacienteAssembler.CreateDomainObject(_pacienteDTO);
                        _pacienteService.Insert(_paciente);
                        break;
                    case Operacion.ELIMINAR:
                        //nada
                        break;
                    case Operacion.ACTUALIZAR:
                        _paciente = _pacienteAssembler.CreateDomainObject(_pacienteDTO);
                        _pacienteService.Update(_paciente);
                        break;
                    default:
                        //nada;
                        break;
                }
                //Setear operacion para el RunWorkerCompleted
                e.Result = operacion;
            }
            catch (Exception ex)
            {

            }
        }
 public Task <int> RemoveAsync(Paciente paciente)
 {
     _context.Pacientes.Remove(paciente);
     return(SaveChangesAsync());
 }
 public Task <int> AddAsync(Paciente paciente)
 {
     _context.Add(paciente);
     return(SaveChangesAsync());
 }
예제 #39
0
        /// <summary>
        /// Cria paciente
        /// </summary>
        /// <param name="paciente">paciente</param>
        public void Criar(Paciente paciente)
        {
            ctx.Pacientes.Add(paciente);

            ctx.SaveChanges();
        }
예제 #40
0
        public async Task <ActionResult> SavePaciente(Paciente paciente)
        {
            await repo.SavePacienteAsync(paciente);

            return(RedirectToAction("Index"));
        }
 public int Add(Paciente paciente)
 {
     _context.Add(paciente);
     return(SaveChanges());
 }
예제 #42
0
 public async Task <IActionResult> Post(Paciente paciente)
 {
     _repository.InserirPaciente(paciente);
     return(Ok("Paciente criado com sucesso"));
 }
예제 #43
0
        protected override void Seed(PlataformaIEB.Models.BancoDeDados context)
        {
            //  This method will be called after migrating to the latest version.

            //  You can use the DbSet<T>.AddOrUpdate() helper extension method
            //  to avoid creating duplicate seed data. E.g.
            //
            //    context.People.AddOrUpdate(
            //      p => p.FullName,
            //      new Person { FullName = "Andrew Peters" },
            //      new Person { FullName = "Brice Lambson" },
            //      new Person { FullName = "Rowan Miller" }
            //    );
            //

            Admin admin = new Admin();

            admin.Senha = Crypto.HashPassword("123");
            admin.Email = "[email protected]";
            admin.Nome  = "Administrador";
            context.Admins.Add(admin);


            Medico medico = new Medico();

            medico.CRM           = 123;
            medico.Email         = "[email protected]";
            medico.Nome          = "Médico";
            medico.Senha         = Crypto.HashPassword("123");
            medico.Especialidade = "Neuro";
            medico.Endereco      = "asdfad";
            medico.Instituicao   = " asdfsadfsadf";
            context.Medicos.Add(medico);


            Pesquisador pesquisa = new Pesquisador();

            pesquisa.Email  = "[email protected]";
            pesquisa.Nome   = "Loo";
            pesquisa.Lattes = "http://www.dsdf.com";
            pesquisa.Senha  = Crypto.HashPassword("123");
            context.Pesquisadores.Add(pesquisa);


            Paciente paciente = new Paciente();

            paciente.Nome        = "Paciente";
            paciente.Email       = "[email protected]";
            paciente.Senha       = Crypto.HashPassword("123");
            paciente.Nascimento  = DateTime.Parse("11/02/2009").Date;
            paciente.Responsavel = "João";
            paciente.Sexo        = "Masculino";
            context.Pacientes.Add(paciente);

            Variavel sexo = new Variavel();

            sexo.Nome = "Sexo";
            context.Variaveis.Add(sexo);

            Variavel idade = new Variavel();

            idade.Nome = "Idade";
            context.Variaveis.Add(idade);

            context.SaveChanges();
        }
예제 #44
0
 public async Task <IActionResult> Put(int id, Paciente paciente)
 {
     return(Ok("Status do paciente atualizado."));
 }
예제 #45
0
    protected void Page_Load(object sender, EventArgs e)
    {
        List <Convenio> listaConvenio = new List <Convenio>();
        Convenio        convenio1     = new Convenio("Sem Convenio", "Sem", "0", 0);
        Convenio        convenio2     = new Convenio("Bradesco", "Bra", "32542134", 1);
        Convenio        convenio3     = new Convenio("Itau", "Ita", "32542135", 2);
        Convenio        convenio4     = new Convenio("Caixa", "CX", "32542136", 3);
        Convenio        convenio5     = new Convenio("Unimed", "Uni", "32542137", 4);
        Convenio        convenio6     = new Convenio("Prax", "Prax", "32542139", 5);

        listaConvenio.Add(convenio1);
        listaConvenio.Add(convenio2);
        listaConvenio.Add(convenio3);
        listaConvenio.Add(convenio4);
        listaConvenio.Add(convenio5);
        listaConvenio.Add(convenio6);
        int contador = Convert.ToInt32(Application["contadorConvenio"]) + 5;

        Application["contadorConvenio"] = contador;
        Session["listaConvenio"]        = listaConvenio;

        List <Exame> listaExame = new List <Exame>();
        Exame        exame1     = new Exame("1", "Papanicolau", "");
        Exame        exame2     = new Exame("2", "Ultrassonagrafia", "");
        Exame        exame3     = new Exame("3", "Urina", "");
        Exame        exame4     = new Exame("4", "Fezes", "");
        Exame        exame5     = new Exame("5", "Sangue", "");

        listaExame.Add(exame1);
        listaExame.Add(exame2);
        listaExame.Add(exame3);
        listaExame.Add(exame4);
        listaExame.Add(exame5);
        Session["listaExame"] = listaExame;

        List <Prova_Especialidade> listaEspecialidade = new List <Prova_Especialidade>();
        Prova_Especialidade        especialidade0     = new Prova_Especialidade("Selecione", "", 0);
        Prova_Especialidade        especialidade1     = new Prova_Especialidade("Cardiologia", "", 1);
        Prova_Especialidade        especialidade2     = new Prova_Especialidade("Geriatria", "", 2);
        int contadorEspecialidade = Convert.ToInt32(Application["contadorEspecialidade"]) + 2;

        Application["contadorEspecialidade"] = contador;
        listaEspecialidade.Add(especialidade0);
        listaEspecialidade.Add(especialidade1);
        listaEspecialidade.Add(especialidade2);
        Session["listaEspecialidade"] = listaEspecialidade;

        List <Medico> listaMedico = new List <Medico>();
        Medico        medico1     = new Medico("Roberto", "rua 13", "343.434.340-30", "32323312", "Aracaju", "Sergipe", "00000", 2, especialidade1);
        Medico        medico2     = new Medico("Hugo", "rua 13", "343.434.341-31", "323233", "Aracaju", "Sergipe", "00001", 2, especialidade1);
        Medico        medico3     = new Medico("Pedro", "rua 13", "343.434.123-34", "323233", "Aracaju", "Sergipe", "00002", 2, especialidade2);
        Medico        medico4     = new Medico("Robert", "rua 13", "343.434.324-34", "323233", "Aracaju", "Sergipe", "00003", 2, especialidade2);
        Medico        medico5     = new Medico("Bruno", "rua 13", "343.434.432-34", "323233", "Aracaju", "Sergipe", "00004", 2, especialidade1);

        listaMedico.Add(medico1);
        listaMedico.Add(medico2);
        listaMedico.Add(medico3);
        listaMedico.Add(medico4);
        listaMedico.Add(medico5);
        especialidade1.ListaMedicos.Add(medico1);
        especialidade1.ListaMedicos.Add(medico2);
        especialidade1.ListaMedicos.Add(medico5);
        especialidade2.ListaMedicos.Add(medico3);
        especialidade2.ListaMedicos.Add(medico4);
        Session["listaMedicos"] = listaMedico;

        List <Paciente> listaPaciente = new List <Paciente>();
        Paciente        paciente1     = new Paciente("Dalmson", "rua 13", "343.434.340-30", "323233", "Aracaju", "Sergipe", new DateTime(1990, 10, 20), "masculino", convenio1);
        Paciente        paciente2     = new Paciente("Juliana", "rua 13", "343.434.340-31", "323233", "Aracaju", "Sergipe", new DateTime(1990, 10, 20), "masculino", convenio1);
        Paciente        paciente3     = new Paciente("Pedro", "rua 13", "343.434.340-32", "323233", "Aracaju", "Sergipe", new DateTime(1990, 10, 20), "masculino", convenio2);
        Paciente        paciente4     = new Paciente("Robert", "rua 13", "343.434.340-33", "323233", "Aracaju", "Sergipe", new DateTime(1990, 10, 20), "masculino", convenio2);

        listaPaciente.Add(paciente1);
        listaPaciente.Add(paciente2);
        listaPaciente.Add(paciente3);
        listaPaciente.Add(paciente4);

        Session["listaPaciente"] = listaPaciente;

        List <Atendimento> listaNormal       = new List <Atendimento>();
        List <Atendimento> listaPreferencial = new List <Atendimento>();
        Atendimento        atendimento1      = new Atendimento("1", "Preferencial");
        Atendimento        atendimento2      = new Atendimento("2", "Preferencial");
        Atendimento        atendimento3      = new Atendimento("3", "Preferencial");
        Atendimento        atendimento4      = new Atendimento("4", "Preferencial");
        Atendimento        atendimento5      = new Atendimento("5", "Preferencial");
        Atendimento        atendimento6      = new Atendimento("6", "Preferencial");
        Atendimento        atendimento7      = new Atendimento("7", "Preferencial");
        Atendimento        atendimento8      = new Atendimento("8", "Preferencial");
        Atendimento        atendimento9      = new Atendimento("9", "Normal");

        listaPreferencial.Add(atendimento1);
        listaPreferencial.Add(atendimento2);
        listaPreferencial.Add(atendimento3);
        listaPreferencial.Add(atendimento4);
        listaPreferencial.Add(atendimento5);
        listaPreferencial.Add(atendimento6);
        listaPreferencial.Add(atendimento7);
        listaPreferencial.Add(atendimento8);
        listaNormal.Add(atendimento9);
        Application["listaPreferencial"] = listaPreferencial;
        Application["listaNormal"]       = listaNormal;

        List <Consulta> listaConsulta = new List <Consulta>();
        Consulta        consulta1     = new Consulta(paciente1, medico1, convenio1, new DateTime(2015, 03, 31), "Manhã", 1, "Agendada");

        medico1.ListaConsulta.Add(consulta1);
        convenio1.ListaConsulta.Add(consulta1);
        paciente1.ListaConsulta.Add(consulta1);
        medico1.DicConsulta.Add(new DateTime(2015, 03, 31).ToShortDateString(), medico1.ListaConsulta);
        int contadorConsulta = Convert.ToInt32(Application["contadorConsulta"]) + 1;

        Application["contadorConsulta"] = contadorConsulta;
        listaConsulta.Add(consulta1);


        Session["listaConsulta"] = listaConsulta;

        List <RequisicaoExame> listaRequisicao = new List <RequisicaoExame>();
        RequisicaoExame        requisicao1     = new RequisicaoExame(paciente1, exame1, new DateTime(2015, 04, 30), "", 100, convenio1, 1);
        RequisicaoExame        requisicao2     = new RequisicaoExame(paciente2, exame2, new DateTime(2015, 04, 30), "", 100, convenio2, 2);
        RequisicaoExame        requisicao3     = new RequisicaoExame(paciente3, exame3, new DateTime(2015, 04, 30), "", 100, convenio3, 3);
        RequisicaoExame        requisicao4     = new RequisicaoExame(paciente4, exame4, new DateTime(2015, 04, 30), "", 100, convenio4, 4);

        listaRequisicao.Add(requisicao1);
        listaRequisicao.Add(requisicao2);
        listaRequisicao.Add(requisicao3);
        listaRequisicao.Add(requisicao4);
        int contadorRequisicao = Convert.ToInt32(Application["contadorRequisicao"]) + 4;

        Application["contadorRequisicao"] = contador;
        Session["listaRequisicao"]        = listaRequisicao;


        Response.Redirect("PesquisarPaciente.aspx");
    }
        public static IEnumerator TestDeleteExercise()
        {
            Flow.StaticLogin();

            yield return(new WaitForSeconds(0.5f));

            Pessoa.Insert("patient name1", "m", "1995-01-01", "6198732711", null);
            Pessoa.Insert("physio name1", "m", "1995-01-03", "6198732713", null);
            Fisioterapeuta.Insert(2, "abracadabra1", "demais1", null, null);
            Paciente.Insert(1, null);
            Movimento.Insert(1, "levantamento de peso", "asuhasu/caminhoy.com", null);
            Sessao.Insert(1, 1, "1940-10-10", null);

            var pacient  = Paciente.GetLast();
            var fisio    = Fisioterapeuta.GetLast();
            var moves    = Movimento.GetLast();
            var sessions = Sessao.GetLast();

            GlobalController.instance.user     = pacient;
            GlobalController.instance.admin    = fisio;
            GlobalController.instance.movement = moves;
            GlobalController.instance.session  = sessions;

            Flow.StaticMovementsToExercise();

            yield return(new WaitForSeconds(0.5f));

            createExercise.CreateExercise();

            var   device = @"^(.*?(\bDevice|SDK\b)[^$]*)$";
            Regex rgx1   = new Regex(device, RegexOptions.IgnoreCase);

            LogAssert.Expect(LogType.Error, rgx1);

            yield return(new WaitForSeconds(0.5f));

            DeleteExerciseButton.DeleteExercise();

            yield return(new WaitForSeconds(0.5f));

            int IdExercicio = GlobalController.instance.exercise.idExercicio;

            List <PontosRotuloPaciente> allPrps = PontosRotuloPaciente.Read();

            foreach (var prp in allPrps)
            {
                Assert.AreNotEqual(prp.idExercicio, IdExercicio);
            }

            var exers = Exercicio.Read();

            foreach (var exer in exers)
            {
                Assert.AreNotEqual(exer.idExercicio, IdExercicio);
            }

            string pathEx = string.Format("{0}/Exercicios/{1}", Application.dataPath, GlobalController.instance.exercise.pontosExercicio);
            bool   dir    = System.IO.File.Exists(pathEx);

            Assert.AreEqual(dir, false);
        }
예제 #47
0
        public async Task <ActionResult> CreatePaciente(Paciente paciente)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    var hoy = DateTime.Now.Date;
                    if (paciente.FechaNacimiento.Date > hoy)
                    {
                        TempData[Application.MessageViewBagName] = new GenericMessageViewModel
                        {
                            Message     = "La fecha de nacimiento no puede ser mayor que la fecha de Hoy.",
                            MessageType = GenericMessages.warning
                        };
                        return(RedirectToAction("CreatePaciente"));
                    }

                    if (paciente.ObraSocialId == null)
                    {
                        TempData[Application.MessageViewBagName] = new GenericMessageViewModel
                        {
                            Message     = "Error al validar los campos.",
                            MessageType = GenericMessages.danger
                        };
                        return(RedirectToAction("TurnosReservadosInicio"));
                    }

                    ObraSocial obraSocial = await db.ObrasSociales.FindAsync(paciente.ObraSocialId);

                    if (obraSocial == null)
                    {
                        TempData[Application.MessageViewBagName] = new GenericMessageViewModel
                        {
                            Message     = "No existe Obra Social.",
                            MessageType = GenericMessages.warning
                        };
                        return(RedirectToAction("TurnosReservadosInicio"));
                    }

                    if (paciente.NroAfiliado == null)
                    {
                        if (paciente.ObraSocialId != 1)
                        {
                            TempData[Application.MessageViewBagName] = new GenericMessageViewModel
                            {
                                Message     = "Debe cargar el número de afiliado.",
                                MessageType = GenericMessages.info
                            };
                            ViewBag.ObraSocialId = new SelectList(db.ObrasSociales, "Id", "Nombre", paciente.ObraSocialId);
                            return(View(paciente));
                        }
                        else if (paciente.ObraSocialId == 1)
                        {
                            TempData[Application.MessageViewBagName] = new GenericMessageViewModel
                            {
                                Message     = "Paciente guardado con exito.",
                                MessageType = GenericMessages.success
                            };
                        }
                    }
                    else
                    {
                        TempData[Application.MessageViewBagName] = new GenericMessageViewModel
                        {
                            Message     = "Paciente guardado con exito.",
                            MessageType = GenericMessages.success
                        };
                    }
                    db.Pacientes.Add(paciente);
                    await db.SaveChangesAsync();

                    return(RedirectToAction("ListaPacientes"));
                }
                else
                {
                    return(View(paciente));
                }
            }
            catch (Exception ex)
            {
                var err = $"Error al crear Paciente: {ex.Message}";
                TempData[Application.MessageViewBagName] = new GenericMessageViewModel
                {
                    Message     = err,
                    MessageType = GenericMessages.danger
                };
                return(RedirectToAction("ListaPacientes"));
            }
        }
        public static IEnumerator TestDeletePatient()
        {
            Flow.StaticLogin();
            Flow.StaticNewPatient();

            yield return(null);

            var objectPatient  = GameObject.Find("Patient Manager");
            var PatientManager = objectPatient.GetComponentInChildren <createPatient>();

            InputField aux = (InputField)PatientManager.GetMemberValue("namePatient");

            aux.text = "Fake Name";
            PatientManager.SetMemberValue("namePatient", aux);

            Text aux1 = (Text)PatientManager.GetMemberValue("outDate");

            aux1.text = "01/01/1920";
            PatientManager.SetMemberValue("outDate", aux1);

            InputField aux3 = (InputField)PatientManager.GetMemberValue("phone1");

            aux3.text = "61999999";
            PatientManager.SetMemberValue("phone1", aux3);

            InputField aux8 = (InputField)PatientManager.GetMemberValue("notes");

            aux8.text = "lorem ipsum";
            PatientManager.SetMemberValue("notes", aux8);

            Toggle aux2 = (Toggle)PatientManager.GetMemberValue("male");

            aux2.isOn = true;
            PatientManager.SetMemberValue("male", aux2);

            Toggle aux0 = (Toggle)PatientManager.GetMemberValue("female");

            aux0.isOn = false;
            PatientManager.SetMemberValue("female", aux0);

            PatientManager.savePatient();

            int IdPaciente = GlobalController.instance.user.idPaciente;
            int IdPessoa   = GlobalController.instance.user.persona.idPessoa;

            yield return(new WaitForSeconds(0.5f));

            DeletePatientButton.DeletePatient();

            yield return(new WaitForSeconds(0.5f));

            var currentscene  = SceneManager.GetActiveScene().name;
            var expectedscene = "NewPatient";

            Assert.AreEqual(expectedscene, currentscene);

            var patients = Paciente.Read();

            foreach (var patient in patients)
            {
                Assert.AreNotEqual(patient.idPaciente, IdPaciente);
            }

            var exers = Exercicio.Read();

            foreach (var exer in exers)
            {
                Assert.AreNotEqual(exer.idPaciente, IdPaciente);
            }

            var sess = Sessao.Read();

            foreach (var ses in sess)
            {
                Assert.AreNotEqual(ses.idPaciente, IdPaciente);
            }

            var ppls = Pessoa.Read();

            foreach (var ppl in ppls)
            {
                Assert.AreNotEqual(ppl.idPessoa, IdPessoa);
            }

            string nomePessoa = (GlobalController.instance.user.persona.nomePessoa).Replace(' ', '_');
            string nomePasta  = string.Format("Assets/Exercicios/{1}-{2}", Application.dataPath, IdPessoa, nomePessoa);

            bool dir = System.IO.Directory.Exists(nomePasta);

            Assert.AreEqual(dir, false);
        }
예제 #49
0
        public static bool validar(Paciente _classe)
        {
            //Nome
            if (UltilStr.StrPadrao(_classe.Nome))
            {
                Debug.WriteLine("nome ok");
            }
            else
            {
                erroMed.Add(new Erro("Nome", string.Format(UltilStr.exibirErros, "Nome")));
            }
            //Email
            if (UltilStr.StrPadrao(_classe.Email, TiposDeDados.Email))
            {
                Debug.WriteLine("email ok");
            }
            else
            {
                erroMed.Add(new Erro("Email", string.Format(UltilStr.exibirErros, "Email")));
            }
            //Cpf
            if (UltilStr.StrPadrao(_classe.Cpf, TiposDeDados.Cpf))
            {
                Debug.WriteLine("cpf ok");
            }
            else
            {
                erroMed.Add(new Erro("Cpf", string.Format(UltilStr.exibirErros, " Cpf")));
            }
            //Cep
            if (UltilStr.StrPadrao(_classe.Cep, TiposDeDados.Cep))
            {
                Debug.WriteLine("cep ok");
            }
            else
            {
                erroMed.Add(new Erro("Cep", string.Format(UltilStr.exibirErros, " Cep")));
            }
            //Rua
            if (UltilStr.StrPadrao(_classe.Rua))
            {
                Debug.WriteLine("rua ok");
            }
            else
            {
                erroMed.Add(new Erro("Rua", string.Format(UltilStr.exibirErros, " Rua")));
            }
            //Bairro
            if (UltilStr.StrPadrao(_classe.Bairro))
            {
                Debug.WriteLine("bairro ok");
            }
            else
            {
                erroMed.Add(new Erro("Bairro", string.Format(UltilStr.exibirErros, " Bairro")));
            }
            //Uf
            if (UltilStr.StrPadrao(_classe.UF))
            {
                Debug.WriteLine("uf ok");
            }
            else
            {
                erroMed.Add(new Erro("Uf", string.Format(UltilStr.exibirErros, " Uf")));
            }
            //Cidade
            if (UltilStr.StrPadrao(_classe.Cidade))
            {
                Debug.WriteLine("cidade ok");
            }
            else
            {
                erroMed.Add(new Erro("Cidade", string.Format(UltilStr.exibirErros, " Cidade")));
            }
            //Medicos
            if (UltilStr.StrPadrao(_classe.IdMedico.ToString(), 0, int.MaxValue))
            {
                Debug.WriteLine("medico ok");
            }
            else
            {
                erroMed.Add(new Erro("IdMedico", " Não há Médicos cadastrados. *"));
            }

            if (erroMed.Count == 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
예제 #50
0
        public void CargarVentanaFormMas(Paciente p)
        {
            FormMas fm = new FormMas(p, this);

            fm.ShowDialog();
        }
예제 #51
0
 public void InserirPaciente(Paciente paciente)
 {
     _context.Pacientes.Add(paciente);
 }
예제 #52
0
        //Create [email protected] with password=Admin@123456 in the Admin role
        public static void InitializeIdentityForEF(ApplicationDbContext db)
        {
            var          userManager = HttpContext.Current.GetOwinContext().GetUserManager <ApplicationUserManager>();
            var          roleManager = HttpContext.Current.GetOwinContext().Get <ApplicationRoleManager>();
            const string nombre      = "William Gustavo";
            const string apellido    = "Santisteban";
            const bool   estado      = true;
            const string name        = "*****@*****.**";
            const string password    = "******";
            const string roleName    = "Admin";

            //Create Role Admin if it does not exist
            var role = roleManager.FindByName(roleName);

            if (role == null)
            {
                role = new ApplicationRole(roleName);
                var roleresult = roleManager.Create(role);
            }

            var user = userManager.FindByName(name);

            if (user == null)
            {
                user = new ApplicationUser {
                    UserName = name, Email = name, Nombre = nombre, Apellido = apellido, Estado = estado, EmailConfirmed = true
                };
                var result = userManager.Create(user, password);
                result = userManager.SetLockoutEnabled(user.Id, false);
            }

            var groupManager = new GrupoManager();
            var newGroup     = new ApplicationGroup("Administradores", "Acceso General al Sistema");

            groupManager.CreateGroup(newGroup);
            groupManager.SetUserGroups(user.Id, new string[] { newGroup.Id });
            groupManager.SetGroupRoles(newGroup.Id, new string[] { role.Name });


            var especialidades = new List <Especialidad> {
                new Especialidad {
                    NombreEspecialidad = "Dietética / Nutricion",
                    Imagen             = "~/Content/img/especialidad/nutricionista.png"
                },
                new Especialidad {
                    NombreEspecialidad = "Ginecología",
                    Imagen             = "~/Content/img/especialidad/ginecologia.png"
                },
                new Especialidad {
                    NombreEspecialidad = "Psicología",
                    Imagen             = "~/Content/img/especialidad/psicologia.png"
                },
                new Especialidad {
                    NombreEspecialidad = "Dermatología",
                    Imagen             = "~/Content/img/especialidad/dermatologia.png"
                },
                new Especialidad {
                    NombreEspecialidad = "Pediatría",
                    Imagen             = "~/Content/img/especialidad/pediatria.png"
                },
                new Especialidad {
                    NombreEspecialidad = "Neumología",
                    Imagen             = "~/Content/img/especialidad/nutricionista.png"
                                         //Imagen = "~/Content/img/especialidad/neumologia.jpg"
                },
                new Especialidad {
                    NombreEspecialidad = "Neurología",
                    Imagen             = "~/Content/img/especialidad/nutricionista.png"
                                         //Imagen = "~/Content/img/especialidad/neurologia.jpg"
                },
                new Especialidad {
                    NombreEspecialidad = "Psiquiatría",
                    Imagen             = "~/Content/img/especialidad/psiquiatria.png"
                }
            };

            especialidades.ForEach(c => db.Especialidades.Add(c));


            var PermisosUsuario = new List <ApplicationRole> {
                new ApplicationRole {
                    Name = "Agregar_Usuario"
                },
                new ApplicationRole {
                    Name = "Editar_Usuario"
                },
                new ApplicationRole {
                    Name = "Detalle_Usuario"
                },
                new ApplicationRole {
                    Name = "Eliminar_Usuario"
                },
                new ApplicationRole {
                    Name = "AllUsuarios"
                }
            };

            PermisosUsuario.ForEach(c => db.Roles.Add(c));


            var PermisosGrupo = new List <ApplicationRole> {
                new ApplicationRole {
                    Name = "Agregar_Grupo"
                },
                new ApplicationRole {
                    Name = "Editar_Grupo"
                },
                new ApplicationRole {
                    Name = "Detalle_Grupo"
                },
                new ApplicationRole {
                    Name = "Eliminar_Grupo"
                },
                new ApplicationRole {
                    Name = "AllGrupos"
                }
            };

            PermisosGrupo.ForEach(c => db.Roles.Add(c));


            var PermisosAcciones = new List <ApplicationRole> {
                new ApplicationRole {
                    Name = "Agregar_Permiso"
                },
                new ApplicationRole {
                    Name = "Editar_Permiso"
                },
                new ApplicationRole {
                    Name = "Detalle_Permiso"
                },
                new ApplicationRole {
                    Name = "Eliminar_Permiso"
                },
                new ApplicationRole {
                    Name = "AllPermisos"
                }
            };

            PermisosUsuario.ForEach(c => db.Roles.Add(c));

            var PermisosTurnos = new List <ApplicationRole> {
                new ApplicationRole {
                    Name = "Agregar_Turno"
                },
                new ApplicationRole {
                    Name = "Editar_Turno"
                },
                new ApplicationRole {
                    Name = "Detalle_Turno"
                },
                new ApplicationRole {
                    Name = "Eliminar_Turno"
                },
                new ApplicationRole {
                    Name = "AllTurnos"
                }
            };

            PermisosTurnos.ForEach(c => db.Roles.Add(c));

            var PermisosHorarios = new List <ApplicationRole> {
                new ApplicationRole {
                    Name = "Agregar_Horario"
                },
                new ApplicationRole {
                    Name = "Editar_Horario"
                },
                new ApplicationRole {
                    Name = "Detalle_Horario"
                },
                new ApplicationRole {
                    Name = "Eliminar_Horario"
                },
                new ApplicationRole {
                    Name = "AllHorarios"
                }
            };

            PermisosHorarios.ForEach(c => db.Roles.Add(c));

            var PermisosProfesionales = new List <ApplicationRole> {
                new ApplicationRole {
                    Name = "Agregar_Profesional"
                },
                new ApplicationRole {
                    Name = "Editar_Profesional"
                },
                new ApplicationRole {
                    Name = "Detalle_Profesional"
                },
                new ApplicationRole {
                    Name = "Eliminar_Profesional"
                },
                new ApplicationRole {
                    Name = "AllProfesionales"
                }
            };

            PermisosProfesionales.ForEach(c => db.Roles.Add(c));

            var grupos = new List <ApplicationGroup> {
                new ApplicationGroup {
                    Name        = "Gestionar Usuarios",
                    Description = "Gestionar Usuarios"
                },
                new ApplicationGroup {
                    Name        = "Gestionar Grupos",
                    Description = "Gestionar Grupos"
                },
                new ApplicationGroup {
                    Name        = "Gestionar Acciones",
                    Description = "Gestionar Acciones"
                },
                new ApplicationGroup {
                    Name        = "Gestionar Autos",
                    Description = "Gestionar Autos"
                },
            };

            grupos.ForEach(c => db.ApplicationGroups.Add(c));


            const string nombreesp    = "Agustin";
            const string apellidoesp  = "Stelzer";
            const bool   estadoesp    = true;
            const string nameesp      = "*****@*****.**";
            const string passwordesp  = "Mcga@123456";
            const string roleNameesp  = "Profesionales";
            const string matriculaesp = "EE2015E";
            const string telefonoesp  = "3413544172";

            //Create Role Admin if it does not exist
            var roleesp = roleManager.FindByName(roleNameesp);

            if (roleesp == null)
            {
                roleesp = new ApplicationRole(roleNameesp);
                var roleresultado = roleManager.Create(roleesp);
            }

            var especialista = userManager.FindByName(nameesp);

            if (especialista == null)
            {
                especialista = new Especialista {
                    UserName        = nameesp,
                    Email           = nameesp,
                    Nombre          = nombreesp,
                    Apellido        = apellidoesp,
                    Estado          = estadoesp,
                    PhoneNumber     = telefonoesp,
                    EmailConfirmed  = true,
                    NumeroMatricula = matriculaesp,
                    Prefijo         = Prefijo.Dr,
                    ImagenMedico    = "~/Content/img/medicos/agustin_stelzer.jpg",
                    Especialidad    = especialidades[2]
                };
                var resultadoesp = userManager.Create(especialista, passwordesp);
                resultadoesp = userManager.SetLockoutEnabled(especialista.Id, false);
            }

            var groupManageresp = new GrupoManager();
            var newGroupesp     = new ApplicationGroup("Especialistas", "Acceso Prefesionales al Sistema");

            groupManager.CreateGroup(newGroupesp);
            groupManager.SetUserGroups(especialista.Id, new string[] { newGroupesp.Id });
            groupManager.SetGroupRoles(newGroupesp.Id, new string[] { roleesp.Name });

            foreach (var horariosroles in PermisosHorarios.ToList())
            {
                userManager.AddToRoles(especialista.Id, horariosroles.Name);
            }
            foreach (var turnosroles in PermisosTurnos.ToList())
            {
                userManager.AddToRoles(especialista.Id, turnosroles.Name);
            }

            const string nombrepac   = "Pamela";
            const string apellidopac = "Sosa";
            const bool   estadopac   = true;
            const string namepac     = "*****@*****.**";
            const string passwordpac = "Mcga@123456";
            const string roleNamepac = "Paciente";
            const string telefonopac = "3413544172";

            var rolepac = roleManager.FindByName(roleNamepac);

            if (rolepac == null)
            {
                rolepac = new ApplicationRole(roleNamepac);
                var roleresultadopaciente = roleManager.Create(rolepac);
            }

            var paciente = userManager.FindByName(namepac);

            if (paciente == null)
            {
                paciente = new Paciente
                {
                    UserName          = namepac,
                    Email             = namepac,
                    Nombre            = nombrepac,
                    Apellido          = apellidopac,
                    Estado            = estadopac,
                    PhoneNumber       = telefonopac,
                    EmailConfirmed    = true,
                    ImagenPaciente    = "~/Content/img/medicos/pamela_sosa.jpg",
                    FechadeCumpleanos = Convert.ToDateTime("1990-12-12 00:00"),
                    Genero            = Sexo.Femenino
                };
                var resultadoesp = userManager.Create(paciente, passwordpac);
                resultadoesp = userManager.SetLockoutEnabled(paciente.Id, false);
            }
            var newGrouppac = new ApplicationGroup("Pacientes", "Acceso Pacientes al Sistema");

            groupManager.CreateGroup(newGrouppac);
            groupManager.SetUserGroups(paciente.Id, new string[] { newGrouppac.Id });
            groupManager.SetGroupRoles(newGrouppac.Id, new string[] { rolepac.Name });

            var espe = userManager.FindByName("*****@*****.**");

            if (espe == null)
            {
                espe = new Especialista
                {
                    Prefijo         = Prefijo.Dr,
                    UserName        = "******",
                    Nombre          = "Hernán",
                    Apellido        = "Carballo",
                    Email           = "*****@*****.**",
                    Estado          = true,
                    PhoneNumber     = "3413354582",
                    ImagenMedico    = "~/Content/img/medicos/hernan_carballo.jpg",
                    Especialidad    = especialidades[3],
                    NumeroMatricula = "MEDICO156",
                    EmailConfirmed  = true,
                };

                const string claveespecialista = "Mcga@12345678";
                var          resultadootro     = userManager.Create(espe, claveespecialista);
                resultadootro = userManager.SetLockoutEnabled(espe.Id, false);
            }

            groupManager.SetUserGroups(espe.Id, new string[] { newGroupesp.Id });
            groupManager.SetGroupRoles(newGroupesp.Id, new string[] { roleesp.Name });

            foreach (var horariosroles in PermisosHorarios.ToList())
            {
                userManager.AddToRoles(especialista.Id, horariosroles.Name);
            }
            foreach (var turnosroles in PermisosTurnos.ToList())
            {
                userManager.AddToRoles(espe.Id, turnosroles.Name);
            }

            db.SaveChanges();
        }
예제 #53
0
        private void Btn_Registro_click(object sender, EventArgs e)
        {   //campos vacios
            if (txt_Identificacion.Text.Equals("") ||
                txt_Nombres.Text.Equals("") ||
                txt_Apellidos.Text.Equals(""))
            {
                MessageBox.Show("Campos vacios, Ingrese datos");
            }
            if (txt_Direccion.Enabled == true &&
                txt_Email.Enabled == true &&
                txt_Telefono.Enabled == true)
            {
                if (txt_Direccion.Text.Equals("") ||
                    txt_Telefono.Text.Equals("") ||
                    txt_Email.Text.Equals(""))
                {
                    MessageBox.Show("Campos vacios, Ingrese datos");
                }
            }

            if (Grupo_Registro.Text.Equals("Registro Paciente"))
            {
                try
                {
                    string identificacionPaciente = txt_Identificacion.Text;
                    string nombres         = txt_Nombres.Text;
                    string apellidos       = txt_Apellidos.Text;
                    string fechaNacimiento = DatoFechaNacimiento.Text;
                    string direccion       = txt_Direccion.Text;
                    string telefono        = txt_Telefono.Text;
                    string email           = txt_Email.Text;
                    string fechaRegistro   = DatoFechaRegistro.Text;


                    Paciente paciente = new Paciente(identificacionPaciente, nombres, apellidos, fechaNacimiento, direccion, telefono, email, fechaRegistro);
                    verificacion = ips.RegistrarPaciente(paciente);

                    if (verificacion == 1)
                    {
                        MessageBox.Show("Paciente Registrado Correctamente");
                        txt_Identificacion.Clear();
                        txt_Nombres.Clear();
                        txt_Apellidos.Clear();
                        txt_Direccion.Clear();
                        txt_Telefono.Clear();
                        txt_Email.Clear();
                    }
                    else
                    {
                        throw new RegistroNoExitosoException("¡ERROR! Registro no efectuado, verifica nuevamente");
                    }
                }
                catch (RegistroNoExitosoException ex)
                {
                    MessageBox.Show(ex.Message);
                }
                catch (SqlException)
                {
                    MessageBox.Show("UPS! Ocurrio un error");
                }
                DataSet BuscarTodosPacientes = new DataSet();
                BuscarTodosPacientes    = ips.BuscarTodosPacientes();
                DataGriwView.DataSource = BuscarTodosPacientes.Tables["Pacientes registrados en la IPS"];
            }
            if (Grupo_Registro.Text.Equals("Registro Medico"))
            {     //campos vacios
                if (txt_Salario.Text.Equals(""))
                {
                    MessageBox.Show("ingrese Salario");
                }
                //procedimiento
                try
                {
                    string identificacionMedico = txt_Identificacion.Text;
                    string nombres          = txt_Nombres.Text;
                    string apellidos        = txt_Apellidos.Text;
                    string especialidad     = ComboEspecialidades.Text;
                    int    salario_cita     = Int32.Parse(txt_Salario.Text);
                    int    años_experiencia = Int32.Parse(Txt_Años.Text);

                    Medico medico = new Medico(identificacionMedico, nombres, apellidos, especialidad, salario_cita, años_experiencia);
                    verificacion = ips.RegistrarMedico(medico);

                    if (verificacion == 1)
                    {
                        MessageBox.Show("Medico Registrado Correctamente");
                        txt_Identificacion.Clear();
                        txt_Nombres.Clear();
                        txt_Apellidos.Clear();
                        ComboEspecialidades.Text = "";
                        txt_Salario.Clear();
                        Txt_Años.Value = 0;
                    }
                    else
                    {
                        throw new RegistroNoExitosoException("¡ERROR! Registro no efectuado, verifica nuevamente");
                    }
                }
                catch (RegistroNoExitosoException ex)
                {
                    MessageBox.Show(ex.Message);
                }
                catch (SqlException)
                {
                    MessageBox.Show("UPS! Ocurrio un error");
                }
                DataSet BuscarTodosMedicos = new DataSet();
                BuscarTodosMedicos      = ips.BuscarTodosMedicos();
                DataGriwView.DataSource = BuscarTodosMedicos.Tables["Medicos registrados en la IPS"];
            }
            if (Grupo_Registro.Text.Equals("Registro Cita"))
            {
            }
        }
 public int Remove(Paciente paciente)
 {
     _context.Pacientes.Remove(paciente);
     return(SaveChanges());
 }
예제 #55
0
 public bool Gravar(Paciente paciente)
 {
     return true;
 }
예제 #56
0
        protected void btnSaveInfo_Click(object sender, EventArgs e)
        {
            HistoriaMedicaBll objHmBll = new HistoriaMedicaBll();
            HistoriaMedica    objHmEnt = objHmBll.Load(this.IdHist);

            PacienteBll objPacBll = new PacienteBll();
            Paciente    objPacEnt = objPacBll.Load(objHmEnt.IdPaciente);

            //se cargan los datos del paciente
            objPacEnt.Nombres                 = this.rtxtNombres.Text.Trim();
            objPacEnt.Apellidos               = this.rtxtApellidos.Text.Trim();
            objPacEnt.NumeroDocumento         = this.rtxtNumDoc.Text.Trim();
            objPacEnt.Acudiente               = this.rtxtAcudiente.Text.Trim();
            objPacEnt.Correo                  = this.rtxtCorreo.Text.Trim();
            objPacEnt.Direccion               = this.rtxtDireccion.Text.Trim();
            objPacEnt.FechaNacimiento         = Convert.ToDateTime(this.rdpFecNac.SelectedDate);
            objPacEnt.Genero                  = Convert.ToBoolean(Convert.ToByte(this.rblGenero.SelectedValue));
            objPacEnt.IdTipoDocumento         = Convert.ToInt32(this.rcbxTipoDoc.SelectedValue);
            objPacEnt.Telefono                = this.rtxtTelefono.Text.Trim();
            objPacEnt.IdUltimaModificacion    = this.IdUserCurrent;
            objPacEnt.FechaUltimaModificacion = DateTime.Now;

            //Datos del cabecero de la pagina
            objHmEnt.IdTipoVisa        = Convert.ToInt32(this.rcbxTipoVisa.SelectedValue);
            objHmEnt.PerimetroCefalico = this.rntPC.Value != null?Convert.ToDecimal(this.rntPC.Value) : decimal.MinValue;

            objHmEnt.Peso     = Convert.ToDecimal(this.rntPeso.Value);
            objHmEnt.Estatura = this.rntEstatura.Value != null?Convert.ToDecimal(this.rntEstatura.Value) / 100M : decimal.MinValue;

            objHmEnt.CodigoSolicitud = this.rtxtNumVisa.Text.Trim();

            // Jun 12 2018 Abohorquez se adiciona el siguiente bloque

            /*para el momento que el usuario medico general guarde cambios para el paciente y si este no tiene asignado un medico se asignara el usuario actual
             */
            if (!(objHmEnt.IdMedico != int.MinValue))
            {
                objHmEnt.IdMedico = this.IdUserCurrent;
            }

            // si tiene revision de medicina
            if (objHmEnt.TieneRevisionMed)
            {
                objHmEnt.EstadoRevisionMed = this.rblEstado.SelectedValue != string.Empty ? (Constants.EstadoRevision)(Convert.ToByte(this.rblEstado.SelectedValue)) : Constants.EstadoRevision.SinAplicar;
                objHmEnt.ComentarioMed     = this.rtxtCommentMedGen.Text.Trim();
            }
            //objHmEnt.TieneRevisionMed = true;
            objHmEnt.IdUltimaModificacion    = this.IdUserCurrent;
            objHmEnt.FechaUltimaModificacion = DateTime.Now;

            if (objHmEnt.TieneRevisionRad)
            {
                //Datos correspondientes a la evaluacion Radiologia correspondiente al medico general
                objHmEnt.EstadoRevisionRadMed = this.rblEstadoRadGen.SelectedValue == "" ? Constants.EstadoRevision.SinAplicar : (Constants.EstadoRevision)(Convert.ToByte(this.rblEstadoRadGen.SelectedValue));
                objHmEnt.ComentarioRadMed     = this.rtxtCommentRadGen.Text.Trim();
            }

            if (!objHmBll.Save(objHmEnt, objPacEnt))
            {
                RadScriptManager.RegisterClientScriptBlock(this, this.GetType(), "savedFailHead", "alert('Se ha presentado el sisguiente inconveniente al almacenar la informacion:\\n\\n" + Utilidades.AjustarMensajeError(objHmBll.Error) + "');", true);
            }

            /*
             * else
             * {
             * RadScriptManager.RegisterClientScriptBlock(this, this.GetType(), "savedOKHead", "alert('Se ha almacenado la información');", true);
             * }
             */
        }
예제 #57
0
 private void abmControl_ClickDelete(object sender, EventArgs e)
 {
     if(MessageBox.Show("Esta seguro que quiere eliminar el Paciente", "Biodata", MessageBoxButtons.YesNo) == DialogResult.Yes)
     {
         this.GrabarEntidad();
         this.Estado = EstadoForm.ELIMINAR;
         _paciente = _pacienteService.GetById(_pacienteDTO.ID);
         _pacienteService.Delete(_paciente);
         this.RefrescarGrilla();
     }
 }
예제 #58
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="idHistoria"></param>
        private void LoadInfoHist(int idHistoria)
        {
            this.hfIdHist.Value = idHistoria.ToString();
            HistoriaMedicaBll objHMBll  = new HistoriaMedicaBll();
            HistoriaMedica    objEntHm  = objHMBll.Load(idHistoria);
            PacienteBll       objPBll   = new PacienteBll();
            Paciente          objEntPac = objPBll.Load(objEntHm.IdPaciente);

            EmbajadaBll      objBllEmb = new EmbajadaBll();
            TipoDocumentoBll objBllTd  = new TipoDocumentoBll();
            TipoVisaBll      objTVBll  = new TipoVisaBll();
            TipoVisa         objEntTv  = objTVBll.Load(objEntHm.IdTipoVisa);

            Utilidades.LlenarRC(this.rcbxEmbajada, objBllEmb.GetList(string.Empty, true, false), "ID", "NOMBRE", true);
            Utilidades.LlenarRC(this.rcbxTipoDoc, objBllTd.GetList(string.Empty, true, false), "ID", "NOMBRE", true);
            Utilidades.LlenarRCEnBlanco(this.rcbxTipoVisa);

            ExamenLaboratorioBll objBllExLab = new ExamenLaboratorioBll();

            Utilidades.LlenarLB(this.lstMuestras, objBllExLab.GetList(string.Empty, true, true, true, true, true, true, true, false), "ID", "NOMBRE");

            this.lstMuestras.Items.Add(new RadListBoxItem("BACILOSCOPIA", Convert.ToInt32(Constants.ExamenLab.Baciloscopia).ToString()));
            this.lstMuestras.Items.Add(new RadListBoxItem("CULTIVO", Convert.ToInt32(Constants.ExamenLab.Cultivo).ToString()));

            this.lstMuestras.DataBind();

            Utilidades.PosicionarRC(this.rcbxEmbajada, Convert.ToInt32(objEntTv.IdEmbajada).ToString());
            this.rcbxEmbajada_SelectedIndexChanged(this.rcbxEmbajada, null);
            Utilidades.PosicionarRC(this.rcbxTipoVisa, objEntHm.IdTipoVisa.ToString());

            Utilidades.PosicionarRC(rcbxTipoDoc, objEntPac.IdTipoDocumento.ToString());

            this.rdpFecha.SelectedDate = objEntHm.FechaIngreso;
            this.rtxtNombres.Text      = objEntPac.Nombres;
            this.rtxtApellidos.Text    = objEntPac.Apellidos;
            this.rtxtNumDoc.Text       = objEntPac.NumeroDocumento;
            this.rtxtPasaporte.Text    = objEntPac.NumeroPasaporte;

            this.rtxtCommentMedGen.Text = objEntHm.ComentarioMed;

            TipoVisaBll objTvBll = new TipoVisaBll();
            TipoVisa    objTvEnt = objTvBll.Load(objEntHm.IdTipoVisa);

            this.EmbajadaCurr = (Constants.Embajadas)objTvEnt.IdEmbajada;

            this.rtxtNumVisa.Text        = objEntHm.CodigoSolicitud;
            this.rblGenero.SelectedValue = Convert.ToByte(objEntPac.Genero).ToString();
            //this.rdpFecNac.SelectedDate = Convert.ToDateTime(objEntPac.FechaNacimiento.ToString("yyyy-MM-dd"));
            this.rdpFecNac.SelectedDate = objEntPac.FechaNacimiento;

            this.lblEdad.Text           = objEntPac.EdadPaciente.ToString();
            this.lblCodigo.Text         = objEntHm.CodigoSolicitud;
            this.lblEstatura.Text       = Convert.ToDouble(objEntHm.Estatura * 100M).ToString();
            this.lblNombrePaciente.Text = objEntPac.Apellidos + " " + objEntPac.Nombres;
            this.lblPeso.Text           = objEntHm.Peso.ToString();
            this.lblTipoVisa.Text       = this.rcbxTipoVisa.SelectedItem.Text;

            this.rtxtCorreo.Text    = objEntPac.Correo;
            this.rtxtDireccion.Text = objEntPac.Direccion;
            this.rtxtAcudiente.Text = objEntPac.Acudiente;
            this.rntPeso.Value      = Convert.ToDouble(objEntHm.Peso);
            this.rntEstatura.Value  = Convert.ToDouble(objEntHm.Estatura * 100M);

            try
            {
                this.rntBmi.Value = Convert.ToDouble(objEntHm.BMI);
            }
            catch
            {
                this.rntBmi.Value = null;
            }

            this.rtxtTelefono.Text = objEntPac.Telefono;
            this.rntPC.Value       = objEntHm.PerimetroCefalico != decimal.MinValue ? Convert.ToDouble(objEntHm.PerimetroCefalico) : 0d;
            this.rntPC.Enabled     = this.rfvPC.Enabled = objEntPac.FechaNacimiento > DateTime.Now.AddYears(-2);

            this.rblEstado.SelectedValue = Convert.ToByte(objEntHm.EstadoRevisionMed).ToString();

            this.chkRadTomada.Checked    = objEntHm.RadiografiaTomada;
            this.chkCargEMedical.Checked = objEntHm.RadiografiaCargadaEmedical;
            this.chkNotEnv.Checked       = objEntHm.NotificacionEnviada;
            this.chkRequiereNot.Checked  = objEntHm.RequiereNotificacion;

            this.ChkRequiereNotificacion.Enabled = false;
            this.ChkNotificado.Enabled           = false;

            this.pnlComMed.Visible = objEntHm.EstadoRevisionMed == Constants.EstadoRevision.Anormal;

            this.rtxtCommentLab.Text        = objEntHm.ComentarioLab;
            this.rblEstadoLab.SelectedValue = Convert.ToByte(objEntHm.EstadoRevisionLab).ToString();

            this.rtxtCommentRad.Text        = objEntHm.ComentarioRad;
            this.rblEstadoRad.SelectedValue = Convert.ToByte(objEntHm.EstadoRevisionRad).ToString();

            this.pnlComRad.Visible = objEntHm.EstadoRevisionRad == Constants.EstadoRevision.Anormal;

            this.rtxtCommentRadGen.Text        = objEntHm.ComentarioRadMed;
            this.rblEstadoRadGen.SelectedValue = Convert.ToByte(objEntHm.EstadoRevisionRadMed).ToString();

            this.pnlComRadMed.Visible = objEntHm.EstadoRevisionRadMed == Constants.EstadoRevision.Anormal;

            this.LoadImgPerfilPaciente(idHistoria, this.imgPrePhoto);

            this.rbtnCerrarRetorno.Enabled = this.rbtnCerrarRetorno.Visible = objEntHm.RetornadoEmbajada;
        }
예제 #59
0
    public static object CrearUsuario(string NombresI, string NombresII, string ApellidosI, string ApellidosII, int TIPO_IDENTIFICACION, string NUMERO_IDENTIFICACION,

        int MunExpedicion, string fechaExpedicion, string Genero, string fechaNacimiento, int MunNacimiento, int Nacionalidad, int munResidencia, string DireccionResidencia,

        string telefono,
       string Email, string passwordQuestion, string SecurityAnswer)
    {
        string PERFILP = "USUARIOS";
        string Retorno = "";
        string status = "";
        Centralizador.Service1Client serviciocentralizador = new Centralizador.Service1Client();
        Centralizador.Entity.Usuario nuevoUsuario = new Centralizador.Entity.Usuario();

        nuevoUsuario.primerNombre = NombresI;
        nuevoUsuario.segundoNombre = NombresII;
        nuevoUsuario.segundoApellido = ApellidosII;
        nuevoUsuario.primerApellido = ApellidosI;
        nuevoUsuario.idTipoIdentificacion = TIPO_IDENTIFICACION;
        nuevoUsuario.numeroIdentificacion = NUMERO_IDENTIFICACION;
        nuevoUsuario.idMunicipioExpedicionDocumento = MunExpedicion;

        nuevoUsuario.fechaExpedicion = Convert.ToDateTime(fechaExpedicion,CultureInfo.InvariantCulture);
        nuevoUsuario.genero = Genero;
        nuevoUsuario.fechaNacimiento = Convert.ToDateTime(fechaNacimiento,CultureInfo.InvariantCulture);
        nuevoUsuario.idMunicipioNacimiento = MunNacimiento;

        nuevoUsuario.idPaisNacionalidad = Nacionalidad;
        nuevoUsuario.idMunicipioResidencia = munResidencia;
        nuevoUsuario.idMunicipioNotificacionCorrespondencia = munResidencia;
        nuevoUsuario.direccionNotificacionCorrespondencia = DireccionResidencia;
        nuevoUsuario.direccionResidencia = DireccionResidencia;
        nuevoUsuario.idMunicipioLaboral = munResidencia;
        nuevoUsuario.estadoCivil = "S";
        nuevoUsuario.correoElectronico = Email;
        nuevoUsuario.telefono = telefono;
        nuevoUsuario.idOperador = 1;
        var resultado = serviciocentralizador.ValidarExistenciaUsuario(nuevoUsuario);

        if (!resultado)
        {

            #region creacion de usuario en en sistema operador
            //

            MembershipUser a = Membership.GetUser(NUMERO_IDENTIFICACION);

            string porEmail = string.Empty;
            porEmail = Membership.GetUserNameByEmail(Email);
            if (a == null && string.IsNullOrEmpty(porEmail))
            {
                #region ("Creacion")
                MembershipCreateStatus createStatus;
                MembershipUser newUser =
                           Membership.CreateUser(NUMERO_IDENTIFICACION, NUMERO_IDENTIFICACION,
                                                 Email, passwordQuestion,
                                                 SecurityAnswer, true,
                                                 out createStatus);

                switch (createStatus)
                {
                    case MembershipCreateStatus.Success:
                        Roles.AddUserToRole(NUMERO_IDENTIFICACION, PERFILP);

                        Paciente nuevoPaciente = new Paciente();
                        nuevoPaciente.nombres_paciente = NombresI;
                        nuevoPaciente.apellidos_paciente = ApellidosI;
                        nuevoPaciente.ident_paciente = NUMERO_IDENTIFICACION;
                        nuevoPaciente.tipo_id = TIPO_IDENTIFICACION;
                        nuevoPaciente.genero_paciente = 2;

                        nuevoPaciente.direccion_paciente = DireccionResidencia;
                        nuevoPaciente.telefono_paciente = telefono;
                        nuevoPaciente.movil_paciente = telefono;
                        nuevoPaciente.mail_paciente = Email;
                        nuevoPaciente.userId = newUser.ProviderUserKey.ToString();
                        nuevoPaciente.fecha_nacimiento = DateTime.Now;

                       // PacienteDao pd = new PacienteDao();
                        //var nuevo = pd.registrarPacienteNuevo(nuevoPaciente);
                        var Usuarioregistrado = serviciocentralizador.RegistrarUsuario(nuevoUsuario);
                        DaoUsuario registroAPP = new DaoUsuario();
                        var usuaripoRegistrarApp =  registroAPP.RegistrarUsuario(nuevoPaciente.userId, Usuarioregistrado.UUID.ToString());

                        var enviar = new Correos().EnviarEmailCreacionDeUsuario(Email);

                        status = "OK";
                        Retorno = "La cuenta del usuario, ha sido creada con exito";

                        break;

                    case MembershipCreateStatus.DuplicateUserName:
                        status = "Existe";
                        Retorno = "Ya existe un usuario con ese nombre de usuario";
                        //CreateAccountResults.Text = "Ya existe un usuario con ese nombre de usuario";//"There already exists a user with this username.";
                        break;

                    case MembershipCreateStatus.DuplicateEmail:
                        status = "Duplicado";
                        Retorno = "Ya existe un usuario con este email.";// "There already exists a user with this email address.";
                        break;

                    case MembershipCreateStatus.InvalidEmail:
                        status = "email";
                        Retorno = "La dirección de correo electrónico que nos ha facilitado en inválida.";//"There email address you provided in invalid.";
                        break;

                    case MembershipCreateStatus.InvalidPassword:
                        status = "password";
                        Retorno = "La contraseña que ha proporcionado no es válido. Debe ser de siete caracteres y tener al menos un carácter no alfanumérico.";//"The password you provided is invalid. It must be seven characters long and have at least one non-alphanumeric character.";
                        break;

                    default:
                        status = "Error";
                        Retorno = "Hubo un error desconocido, la cuenta de usuario no fue creado.";//"There was an unknown error; the user account was NOT created.";
                        break;
                }
                #endregion
            }
            else
            {
                if (a != null)
                {
                    status = "Existe";
                    Retorno = "El nombre de usuario ya existe.";
                }
                //        CreateAccountResults.Text = "El usuario ya existe";

                if (!string.IsNullOrEmpty(porEmail))
                {
                    status = "EmailCambiar";
                    Retorno = "Ingrese por favor una dirección de correo electrónico diferente.";
                }
            }
        #endregion

        }
        else
        {

            Retorno = "El usuario Se encuentra registrado en el centralizador";
            status = "RegistradoCentralizador";

        }
        return new
        {
            status = status,
            mensaje = Retorno
        };
    }
 public Credencial Gerar(Paciente paciente)
 {
     return(new Credencial(paciente.Email, paciente.CPF));
 }