Exemple #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     CapaEntidades.Paciente objPaciente = PacienteLN.getInstance().DatosPaciente(Session["USER_ID"].ToString());
     nombre.Text    = objPaciente.nombre;
     apellidos.Text = objPaciente.apellidos;
     edad.Text      = objPaciente.edad.ToString() + " años";
 }
Exemple #2
0
        protected void btn_Ingresar_Click(object sender, EventArgs e)
        {

                String idPaciente =  String.Format("{0,4}",Request.Form["txtUsuario"]);
                String contra = String.Format("{0,3}", Request.Form["txtPassword"]);

            if (idPaciente.Equals("admin"))
            {
                Response.Redirect("VerAlumnos.aspx");
            }
            else
            {
                if (idPaciente.Equals("juan"))
                {
                    Response.Redirect("StudentView.aspx");
                }
                else
                {

                
                CapaEntidades.Paciente objPaciente = PacienteLN.getInstance().AccesoSistema(idPaciente, contra);

                if (objPaciente != null)
                {
                    Session["USER_ID"] = idPaciente;
                    Response.Redirect("PrincipalPaciente.aspx");
                }
                else
                {
                    Response.Write("<script>alert('USUARIO INCORRECTO.')</script>");
                }
                }
            }
        }
Exemple #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     CapaEntidades.Paciente objPaciente = PacienteLN.getInstance().DatosPaciente(Session["USER_ID"].ToString());
     txtNombres.Text   = objPaciente.nombre;
     txtApellidos.Text = objPaciente.apellidos;
     DNI.Text          = objPaciente.idPaciente;
     Edad.Text         = objPaciente.edad.ToString();
     Direccion.Text    = objPaciente.direccion;
     Telefono.Text     = objPaciente.telefono;
     contraseña.Text   = objPaciente.contra;
     fechanac.Text     = String.Format("{0:dd/MM/yyyy}", objPaciente.fecha_nac);
 }
Exemple #4
0
        protected void btnRegistrar_Click(object sender, EventArgs e)
        {
            //Registro del paciente
            CapaEntidades.Paciente objPaciente = GetEntity();
            //Enviar a la capa Logica de Negocio
            bool response = PacienteLN.getInstance().RegistrarPaciente(objPaciente);

            if (response == true)
            {
                Response.Write("<script>alert('REGISTRO CORRECTO.')</script>");
                Response.Redirect("Login.aspx");
            }
            else
            {
                Response.Write("< script > alert('REGISTRO INCORRECTO.') </ script > ");
            }
        }
Exemple #5
0
        private CapaEntidades.Paciente GetEntity()
        {
            CapaEntidades.Paciente objPaciente = new CapaEntidades.Paciente();
            objPaciente.idPaciente = DNI.Text;
            objPaciente.contra     = contraseña.Text;
            objPaciente.nombre     = txtNombres.Text;
            objPaciente.apellidos  = txtApellidos.Text;
            objPaciente.edad       = Convert.ToInt32(Edad.Text);
            objPaciente.telefono   = Telefono.Text;
            objPaciente.direccion  = Direccion.Text;
            String fechanac = fn_anio.Text + "-" + fn_mes.Text + "-" + fn_dia.Text;

            objPaciente.fecha_nac = Convert.ToDateTime(fechanac);
            objPaciente.estado    = "1";
            objPaciente.usuario   = "1";

            return(objPaciente);
        }
Exemple #6
0
        public static List<Paciente> VistaPacientes()
        {
            using (OracleConnection conn = Conexion.conectar())
            {
                conn.Open();
                List<Paciente> nuevaLista = new List<Paciente>();
                OracleCommand consulta = new OracleCommand("prMostrarPaciente", conn);
                consulta.CommandType = CommandType.StoredProcedure;
                consulta.Parameters.Add("p_cursor", OracleDbType.RefCursor).Direction = ParameterDirection.Output;
                consulta.ExecuteNonQuery();
                OracleDataReader dr = ((OracleRefCursor)consulta.Parameters["p_cursor"].Value).GetDataReader();
                while (dr.Read())
                {
                    Paciente paciente = new Paciente();
                    paciente.Rut = dr[0].ToString();
                    paciente.Nombre = dr[1].ToString();
                    paciente.Apellido = dr[2].ToString();
                    paciente.Edad = int.Parse(dr[3].ToString());
                    paciente.Fono = int.Parse(dr[4].ToString());
                    paciente.Email = dr[5].ToString();
                    nuevaLista.Add(paciente);
                }

                conn.Close();

                return nuevaLista;
            }
        }