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>"); } } } }
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"; }
protected void btnSearch_Click(object sender, EventArgs e) { PacienteLN ln = new PacienteLN(); string buscar = txt_searchItem.Text; cargarSeachPeopleDefaul(); }
protected void Page_Load(object sender, EventArgs e) { pacienteLN = new PacienteLN(); pacienteLN.GridPaciente(GridPaciente); ScriptManager.GetCurrent(this).RegisterPostBackControl(this.btnGuardar); }
private string MapearDatosPaciente(String identificacion) { string indentificadorPaciente = null; Paciente objPaciente = PacienteLN.getInstance().BuscarPacienteDNI(identificacion); indentificadorPaciente = objPaciente.IdPaciente.ToString(); return(indentificadorPaciente); }
public static bool EliminarDatosPaciente(String id) { Int32 idPaciente = Convert.ToInt32(id); bool ok = PacienteLN.getInstance().Eliminar(idPaciente); return(ok); }
// Bonus 2: private void LlenarListaSexo() { //var ListaSexo = PacienteLN.getInstance().ListarSexo(); List <Sexo> ListaSexo = PacienteLN.getInstance().ListarSexo(); ddlSexo.DataSource = ListaSexo; ddlSexo.DataTextField = "nombre"; ddlSexo.DataValueField = "idSexo"; ddlSexo.DataBind(); }
public void cargarSeachPeople() { PacienteLN nUsuario = new PacienteLN(); // nUsuario.Mostrar(); listSearchingPerson.DataSource = nUsuario.Mostrar(); listSearchingPerson.DataBind(); listSearchingPerson.DataSource = nUsuario.PacientesProfecionalNoAgregado(grupo); listSearchingPerson.DataBind(); }
protected void lnkEdit_Command(object sender, CommandEventArgs e) { pacientesEdit = new Pacientes(); mostrarEdit(); pacientesEdit.id_Paciente = Convert.ToInt32(e.CommandArgument.ToString()); PacienteLN ln = new PacienteLN(); pacientesEdit = ln.PacienteID(pacientesEdit); cargarDatosSelect(pacientesEdit); }
protected void gridPaciente_RowDeleting(object sender, GridViewDeleteEventArgs e) { string columna = e.Values["Id"].ToString(); pacienteLN = new PacienteLN(); pacienteLN.EliminarPaciente(columna); Limpiar(); pacienteLN.GridPaciente(GridPaciente); nom = "asd OR asd"; pacienteLN.GridPacienteBusqueda(GridPacienteBusqueda, nom); }
private void LlenarDatosPaciente(Int32 IdCita) { // llenar la informacion Paciente objPaciente = PacienteLN.getInstance().BuscarPacienteIdCita(IdCita); hfIdPaciente.Value = objPaciente.IdPaciente.ToString(); lblNombres.Text = objPaciente.Nombres; lblApellidos.Text = objPaciente.ApPaterno + " " + objPaciente.ApMaterno; lblEdad.Text = objPaciente.Edad.ToString(); lblSexo.Text = (objPaciente.Sexo == 'F') ? "Femenino" : "Masculino"; }
public override bool ValidateUser(string username, string password) { bool ok = false; Paciente objPaciente = new PacienteLN().iniciarSesionPaciente(username, password); if (objPaciente != null) { ok = true; } return(ok); }
public static bool EliminarDatosPaciente(String id) { Paciente objPaciente = new Paciente() { IdPaciente = Convert.ToInt32(id) }; bool respuesta = PacienteLN.getInstance().EliminarDatosPaciente(objPaciente); return(respuesta); }
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); }
public static bool ActualizarDatosPaciente(string id, string direccion) { Paciente objPaciente = new Paciente() { IdPaciente = Convert.ToInt32(id), Direccion = direccion }; bool ok = PacienteLN.getInstance().Actualizar(objPaciente); return(ok); }
public static bool ActualizarDatosPaciente(String id, String direccion) { Paciente objPaciente = new Paciente() { IdPaciente = Convert.ToInt32(id), Direccion = direccion }; bool respuesta = PacienteLN.getInstance().ActualizarDatoPaciente(objPaciente); return(respuesta); }
public static List <Paciente> ListarPacientes() { List <Paciente> Lista = null; try { Lista = PacienteLN.getInstance().listarPacientes(); }catch (Exception ex) { Lista = null; } return(Lista); }
public static List <Paciente> PromocionDetList(string cod_promocion) { List <Paciente> Lista = null; try { Lista = PacienteLN.getInstance().ListarPacientes(); } catch (Exception ex) { Lista = null; } return(Lista); }
public void cargarDatos(Grupo g) { try { PacienteLN nUsuario = new PacienteLN(); // nUsuario.Mostrar(); lvwDatos.DataSource = nUsuario.Listar(g); lvwDatos.DataBind(); } catch (Exception ex) { Response.Write("<script>alert('" + ex.Message + "')</script>"); } }
protected void btnGuardar_Click(object sender, EventArgs e) { /*foto*/ byte[] bytes = null; HttpPostedFile postedFile = Fotografia.PostedFile; string fileName = Path.GetFileName(postedFile.FileName); string fileExtension = Path.GetExtension(fileName); int fileSize = postedFile.ContentLength; if (fileExtension.ToLower() == ".jpg" || fileExtension.ToLower() == ".png") { Stream stream = postedFile.InputStream; BinaryReader binaryReader = new BinaryReader(stream); bytes = binaryReader.ReadBytes((int)stream.Length); } /*fin foto*/ pacienteEN = new PacienteEN(); pacienteLN = new PacienteLN(); pacienteEN.Nombre = txtNombre.Text; pacienteEN.Apellido = txtApellido.Text; pacienteEN.FechaNacimiento = txtFNacimiento.Text; pacienteEN.Genero = Convert.ToInt32(DropGenero.SelectedValue); pacienteEN.Id_Estado = Convert.ToInt32(DropEstadoCivil.SelectedValue); pacienteEN.Telefono = txtTelefono.Text; pacienteEN.Id_Etnia = Convert.ToInt32(DropEtnia.SelectedValue); pacienteEN.Nacionalidad = txtNacionalidad.Text; pacienteEN.Direccion = txtDireccion.Text; pacienteEN.Id_Departamento = Convert.ToInt32(DropDepartamento.SelectedValue); pacienteEN.Id_Municipio = Convert.ToInt32(DropMunicipio.SelectedValue); pacienteEN.DPI = txtDPI.Text; pacienteEN.Pasaporte = txtPasaporte.Text; pacienteEN.Vencimiento = txtFVencimiento.Text; pacienteEN.Id_GradoAcademico = Convert.ToInt32(DropGradoAcademico.SelectedValue); pacienteEN.Id_Profesion = Convert.ToInt32(DropProfesion.SelectedValue); pacienteEN.Estatura = Convert.ToInt32(txtEstatura.Text); pacienteEN.Peso = Convert.ToInt32(txtPeso.Text); pacienteEN.Fotografia = bytes; if (pacienteLN.InsertarPaciente(pacienteEN) == 1) { string mensaje = "Ingreso Exitoso"; ScriptManager.RegisterStartupScript(this, typeof(string), "Mensaje", "alert('" + mensaje + "');", true); Limpiar(); pacienteLN.GridPaciente(GridPaciente); } }
protected void btnRegistrar_Click(object sender, EventArgs e) { Paciente objPaciente = GetValues(); bool response = PacienteLN.getInstance().RegistrarPaciente(objPaciente); if (response == true) { Response.Write("<script>alert('REGISTRO CORRECTO')</script>"); } else { Response.Write("<script>alert('ERROR AL REGISTRAR')</script>"); Response.Write("<script>alert('POR FAVOR VERIFIQUE')</script>"); } }
protected void btnCadastrar_Click(object sender, EventArgs e) { //cadastro paciante PacienteModelView ObjPacienteModelView = GetEntity(); // enviar a capa de logica de negocio bool response = PacienteLN.getInstance().CadastrarPaciente(ObjPacienteModelView); if (response == true) { Response.Write("<script>alert('REGISTRO CORRETO.')</script>"); } else { Response.Write("<script>alert('REGISTRO INCORRETO.')</script>"); } }
protected void btnRegistrar_Click(object sender, EventArgs e) { //Registro del Paciente Paciente objPaciente = GetEntity(); //Enviamos a la CapaLogicaNegocio bool respuesta = PacienteLN.getInstance().RegistrarPaciente(objPaciente); if (respuesta == true) { Response.Write("<script>alert('REGISTRO CORRECTO')</script>"); } else { Response.Write("<script>alert('REGISTRO INCORRECTO')</script>"); } }
protected void Page_LoadComplete(object sender, EventArgs e) { if (IsPostBack == false) { pacienteLN = new PacienteLN(); pacienteLN.DropEstadoCivil(DropEstadoCivil); pacienteLN.DropProfesion(DropProfesion); pacienteLN.DropEtnia(DropEtnia); pacienteLN.DropGradoAcademico(DropGradoAcademico); pacienteLN.DropDepartamento(DropDepartamento); pacienteLN.DropMunicipio(DropMunicipio); pacienteLN.GridPaciente(GridPaciente); } }
protected void btnRegistrar_Click(object sender, EventArgs e) { // Registro del paciente Paciente objPaciente = GetEntity(); // enviar a la capa de logica de negocio bool response = PacienteLN.getInstance().RegistrarPaciente(objPaciente); if (response == true) { Response.Write("<script>alert('REGISTRO CORRECTO.')</script>"); } else { Response.Write("<script>alert('REGISTRO INCORRECTO.')</script>"); } }
public static Paciente ObtenerPaciente(int?id) { try { if (id == null || id == 0) { return(null); } Paciente paciente = PacienteLN.getInstance().ObtenerPaciente(id.Value); } catch (Exception ex) { throw ex; } return(null); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { String email = Page.User.Identity.Name; Paciente objPaciente = new PacienteLN().traerDatosPaciente(email); if (objPaciente != null) { txtNombreModificarPaciente.Text = objPaciente.nombre_paciente; txtApellidoModificarPaciente.Text = objPaciente.apellido_paciente; txtDireccionModificarPaciente.Text = objPaciente.direccion_paciente; txtDniModificarPaciente.Text = objPaciente.dni_paciente; txtEmailModificarPaciente.Text = objPaciente.email_paciente; hfFechaNacimiento.Value = objPaciente.fecha_nacimiento_paciente; string ruta1; string ruta2; ruta1 = HttpContext.Current.Server.MapPath("~/Fotos/masculino.jpg"); ruta2 = HttpContext.Current.Server.MapPath("~/Fotos/femenino.jpg"); byte[] fotoMasculina = File.ReadAllBytes(ruta1); byte[] fotoFemenina = File.ReadAllBytes(ruta2); //byte[] fotoMasculina = File.ReadAllBytes("D:/Usuario/Universidad/Proyectos/SRM/CapaPresentacionMedico/Fotos/masculino.jpg"); //byte[] fotoFemenina = File.ReadAllBytes("D:/Usuario/Universidad/Proyectos/SRM/CapaPresentacionMedico/Fotos/femenino.jpg"); if (Convert.ToBase64String(fotoMasculina).Equals(Convert.ToBase64String(objPaciente.foto_paciente)) || Convert.ToBase64String(fotoFemenina).Equals(Convert.ToBase64String(objPaciente.foto_paciente))) { txtImagenModificarPaciente.Value = "Sin foto"; } txtTelefonoModificarPaciente.Text = objPaciente.telefono_paciente; imagenModificarPaciente.Src = "data:image/jpg;base64," + Convert.ToBase64String(objPaciente.foto_paciente); if (objPaciente.sexo_paciente.Equals("M")) { selectSexoModificarPaciente.SelectedIndex = 2; } else { selectSexoModificarPaciente.SelectedIndex = 1; } } else { //SU SESION A CADUCADO VUELVA A INICIAR SESION. } } }
public void cargarSeachPeopleDefaul() { PacienteLN nUsuario = new PacienteLN(); // nUsuario.Mostrar(); if (txt_searchItem.Text == "") { listSearchingPerson.DataSource = nUsuario.PacientesProfecionalNoAgregado(grupo); listSearchingPerson.DataBind(); } else { Pacientes u = new Pacientes(); u.cedula = txt_searchItem.Text; listSearchingPerson.DataSource = nUsuario.PacientesNoAgregadosByCedulaBuscar(u, grupo); System.Diagnostics.Debug.WriteLine("cedula usuario =" + u.cedula + " -" + "id grupo = " + grupo.idGrupo); listSearchingPerson.DataBind(); } }
protected void btnGuardarCambios_Click(object sender, EventArgs e) { Paciente objPaciente = obtenerDatosPaciente(); if (objPaciente.email_paciente.Equals("")) { Page.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "MensajeModificarUsuarioInorrecto();", true); } else { bool respuesta = new PacienteLN().ModificarPaciente(objPaciente); if (respuesta == true) { Page.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "MensajeModificarUsuarioCorrecto();", true); } else { Page.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "MensajeModificarUsuarioInorrecto();", true); } } }
protected void LoginUser_Authenticate(object sender, AuthenticateEventArgs e) { bool auth = Membership.ValidateUser(LoginUser.UserName, LoginUser.Password); if (auth) { Paciente objPaciente = new PacienteLN().iniciarSesionPaciente(LoginUser.UserName, LoginUser.Password); if (objPaciente != null) { SessionManager = new SessionManager(Session); SessionManager.UserSessionObjeto = objPaciente; FormsAuthentication.RedirectFromLoginPage(LoginUser.UserName, false); } } else { Page.ClientScript.RegisterStartupScript(this.GetType(), "SweetAlert", "MensajePacienteIncorrecto();", true); } }