private void btnEliminar_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtExpediente.Text.Trim())) { ErrorDatos.SetError(txtExpediente, "No ha elegido \nningun pacinte"); } else { bool ResultadoOK = false; string mensajeError = ""; objPaciente = new clFachadaPaciente(); try { objPaciente.EliminarPaciente(Convert.ToInt32(txtExpediente.Text), 1, ref ResultadoOK, ref mensajeError); } catch (Exception error) { MessageBox.Show(error.Message.ToString()); } if (ResultadoOK) { MessageBox.Show("Paciente Elimnado con exito \n\n En cualquier momento puede restaurar el paciente "); Efecto.LimpiarForm(this); } else { MessageBox.Show("Paciente no Eliminado"); } } }
private void btnGuardaryConsultar_Click(object sender, EventArgs e) { if (Efecto.ValidarFormulario(this, ErrorDatos) == false) { manipulable.manipular(ucRealizarConsulta.Instance(manipulable), this.txtExpediente.Text); Efecto.LimpiarForm(this); } }
private void txtBuscarP_KeyPress(object sender, KeyPressEventArgs e) { Efecto.SoloLetrasOrNumeros('N', e); if ((int)e.KeyChar == (int)Keys.Enter) { btnBuscarConsulta_Click(sender, e); } }
//To Inicializze all necesary elemen6ts the UI uses from the database and dates internal void LoadComponents() { dtpEdadHasta.MinDate = new DateTime(1900, 12, 31); dtpEdadHasta.MaxDate = DateTime.Today; dtpEdadDesde.MinDate = new DateTime(1900, 12, 31); dtpEdadDesde.MaxDate = DateTime.Today; dtpConsultaDesde.MinDate = new DateTime(1900, 12, 31); dtpConsultaDesde.MaxDate = DateTime.Today; dtpConsultaHasta.MinDate = new DateTime(1900, 12, 31); dtpConsultaHasta.MaxDate = DateTime.Today; bool ResultadoOK = false; string MensajeError = ""; DataTable DTPacientes = new DataTable(); DTPacientes = objBusquedaP.Buscar("", 1, ref ResultadoOK, ref MensajeError); string FechaNac; string FechaAlta; // dgvResultadoBusquedaP.DataSource = DTPacientes; dgvResultadoBusquedaP.Rows.Clear(); for (int i = 0; i < DTPacientes.Rows.Count; i++) { //FechaNac = Convert.ToDateTime(DTPacientes.Rows[i]["Pa_FechaNac"]).ToShortDateString(); FechaAlta = Convert.ToDateTime(DTPacientes.Rows[i]["Pa_FechaAlta"]).ToShortDateString(); FechaNac = Efecto.ObtenerEdad(Convert.ToDateTime(DTPacientes.Rows[i]["Pa_FechaNac"])); dgvResultadoBusquedaP.Rows.Add( DTPacientes.Rows[i]["Pa_ID"], DTPacientes.Rows[i]["Pa_Nombre"], DTPacientes.Rows[i]["Pa_Apellido"], DTPacientes.Rows[i]["Gen_Descripcion"], DTPacientes.Rows[i]["TP_Descripcion"], FechaNac, FechaAlta, DTPacientes.Rows[i]["Pa_Cedula"], DTPacientes.Rows[i]["Pa_Telefono"], DTPacientes.Rows[i]["Pa_Celular"], DTPacientes.Rows[i]["Est_Descripcion"], DTPacientes.Rows[i]["Pa_Email"], DTPacientes.Rows[i]["Zo_Nombre"], DTPacientes.Rows[i]["Domi_Calle"], DTPacientes.Rows[i]["Domi_Numero"], DTPacientes.Rows[i]["Domi_Sector"], DTPacientes.Rows[i]["Mu_Nombre"], DTPacientes.Rows[i]["Pro_Nombre"] ); } }
private void btnEditarPaciente_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtExpediente.Text.Trim())) { ErrorDatos.SetError(btnBuscarPaciente, "No ha elegido un paciente"); } else { manipulable.manipular(ucRegistroP.Instance(manipulable), this.txtExpediente.Text); Efecto.LimpiarForm(this); } }
private void btnProgramarCita_Click_1(object sender, EventArgs e) { if (Efecto.ValidarFormulario(this, ErrorDatos) == false) { try { int Pa_ID = Convert.ToInt32(txtExpediente.Text); int Cita_ID = 0; string MotivoCita = txtMotivo.Text; DateTime FechaCita = Convert.ToDateTime(dtpFechaCita.Value); DateTime HoraCita = Convert.ToDateTime(dtpHoraCita.Value); string NotaCita = txtNotaCita.Text; bool ResultadoOk = false; string MensajeError = ""; clFachadaCita FachadaCita = new clFachadaCita(); FachadaCita.RegistrarCita(ref Cita_ID , Pa_ID , MotivoCita , HoraCita, FechaCita , NotaCita , ref ResultadoOk , ref MensajeError); if (ResultadoOk) { txtCirtaNo.Text = Cita_ID.ToString(); cargarCitas(txtExpediente.Text); MessageBox.Show("La cita se guardo exitosamente"); } else { MessageBox.Show(MensajeError); } } catch (Exception error) { MessageBox.Show(error.Message.ToString()); } } else { } }
private void txtBuscarP_TextChanged(object sender, EventArgs e) { bool ResultadoOK = false; string MensajeError = ""; clFachadaBusquedaPaciente objBusquedaP = new clFachadaBusquedaPaciente(); DataTable DTPacientes = new DataTable(); DTPacientes = objBusquedaP.Buscar(txtBuscarP.Text, 3, ref ResultadoOK, ref MensajeError); string FechaNac; string FechaAlta; // dgvResultadoBusquedaP.DataSource = DTPacientes; dgvResultadoBusquedaP.Rows.Clear(); for (int i = 0; i < DTPacientes.Rows.Count; i++) { //FechaNac = Convert.ToDateTime(DTPacientes.Rows[i]["Pa_FechaNac"]).ToShortDateString(); FechaAlta = Convert.ToDateTime(DTPacientes.Rows[i]["Pa_FechaAlta"]).ToShortDateString(); FechaNac = Efecto.ObtenerEdad(Convert.ToDateTime(DTPacientes.Rows[i]["Pa_FechaNac"])); dgvResultadoBusquedaP.Rows.Add( DTPacientes.Rows[i]["Pa_ID"], DTPacientes.Rows[i]["Pa_Nombre"], DTPacientes.Rows[i]["Pa_Apellido"], DTPacientes.Rows[i]["Gen_Descripcion"], DTPacientes.Rows[i]["TP_Descripcion"], FechaNac, FechaAlta, DTPacientes.Rows[i]["Pa_Cedula"], DTPacientes.Rows[i]["Pa_Telefono"], DTPacientes.Rows[i]["Pa_Celular"], DTPacientes.Rows[i]["Est_Descripcion"], DTPacientes.Rows[i]["Pa_Email"], DTPacientes.Rows[i]["Zo_Nombre"], DTPacientes.Rows[i]["Domi_Calle"], DTPacientes.Rows[i]["Domi_Numero"], DTPacientes.Rows[i]["Domi_Sector"], DTPacientes.Rows[i]["Mu_Nombre"], DTPacientes.Rows[i]["Pro_Nombre"] ); } objBusquedaP = null; DTPacientes = null; }
private void btnBuscarPaciente_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtBuscarP.Text.Trim())) { Form_BuscarPaciente FB = new Form_BuscarPaciente(); FB.ShowDialog(); } else { clFachadaBusquedaPaciente objFachadaPaciente = new clFachadaBusquedaPaciente(); DataTable DTPaciente = new DataTable(); string Pa_ID = txtBuscarP.Text; bool ResultadoOK = false; string MensajeError = ""; DTPaciente = objFachadaPaciente.Buscar(Pa_ID, 3, ref ResultadoOK, ref MensajeError); if (DTPaciente.Rows.Count == 1) { //para asignar a las etiquetas en valor de los datos del pacinetede la tabla consultada lblNombre.Text = DTPaciente.Rows[0]["Pa_Nombre"].ToString(); lblApellido.Text = DTPaciente.Rows[0]["Pa_Apellido"].ToString(); lblEdad.Text = Efecto.ObtenerEdad(Convert.ToDateTime(DTPaciente.Rows[0]["Pa_FechaNac"].ToString())); lblGenero.Text = DTPaciente.Rows[0]["Gen_Descripcion"].ToString(); lblTipoPaciente.Text = DTPaciente.Rows[0]["TP_Descripcion"].ToString(); lblZona.Text = DTPaciente.Rows[0]["Zo_Nombre"].ToString(); lblCedula.Text = DTPaciente.Rows[0]["Pa_Cedula"].ToString(); lblEstadoCivil.Text = DTPaciente.Rows[0]["Est_descripcion"].ToString(); txtExpediente.Text = DTPaciente.Rows[0]["Pa_ID"].ToString(); cargarCitas(txtExpediente.Text); } else { MessageBox.Show("Paciente no encontrado", "Avertencia", MessageBoxButtons.OK, MessageBoxIcon.Warning); } DTPaciente = null; } }
private void butSoloGuardarP_Click(object sender, EventArgs e) { if (Efecto.ValidarFormulario(this, ErrorDatos) == false) { objPaciente = new clFachadaPaciente(); string Pa_Cedula; int Pa_ID = 0; int Domi_ID = 0; if (string.IsNullOrEmpty(txtExpediente.Text.Trim())) { Pa_ID = 0; Domi_ID = 0; } else { try { Pa_ID = Convert.ToInt32(txtExpediente.Text); Domi_ID = Convert.ToInt32(txtDomi_ID.Text); } catch { Pa_ID = 0; Domi_ID = 0; } } string Pa_Nombre = txtNombre.Text; string Pa_Apellido = txtApellido.Text; int Gen_ID = Convert.ToInt32(cbbGenero.SelectedValue); DateTime Pa_FechaNac = Convert.ToDateTime(dtpFechNaci.Text); if (string.IsNullOrEmpty(txtCedula.Text)) { Pa_Cedula = null; } else { Pa_Cedula = txtCedula.Text; } int Est_ID = Convert.ToInt32(cbbEstadoCivil.SelectedValue); string Pa_Telefono = txtTelefono.Text; string Pa_Celular = txtCelular.Text; string Pa_Email = txtEmail.Text; int TP_ID = Convert.ToInt32(cbbTipoPaciente.SelectedValue); int Zo_ID = Convert.ToInt32(cbbZona.SelectedValue); string Sector = txtSector.Text; string Calle = txtCalle.Text; string Numero = txtNumero.Text; int ciudad_ID = Convert.ToInt32(cbbCiudad.SelectedValue); bool ResultadoOk = false; string MensajeError = ""; objPaciente.Registrar(ref Pa_ID, Pa_Nombre, Pa_Apellido, Gen_ID, Pa_FechaNac, Pa_Cedula, Est_ID, Pa_Telefono, Pa_Celular, Pa_Email, TP_ID, Zo_ID, Domi_ID, Sector, Calle, Numero, ciudad_ID, ref ResultadoOk, ref MensajeError); if (ResultadoOk) { if (string.IsNullOrEmpty(txtExpediente.Text.Trim())) { MessageBox.Show("Paciente Guardado", "Notificacion", MessageBoxButtons.OK, MessageBoxIcon.Information); txtExpediente.Text = Pa_ID.ToString(); } else { MessageBox.Show("Paciente Actualizado", "Notificacion", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { MessageBox.Show(MensajeError, "Notificacion", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { } }
private void txtBuscarP_KeyPress(object sender, KeyPressEventArgs e) { Efecto.SoloLetrasOrNumeros('C', e); }
private void txtNotaCita_KeyPress(object sender, KeyPressEventArgs e) { Efecto.SoloLetrasOrNumeros('T', e); }
private void btnMasMenosCitas_Click(object sender, EventArgs e) { /*use the method MostrarOcultar from the Efecto class to hide and show * the panel passed in the parameter panel by clicking a referenced button*/ Efecto.MostrarOcultar(panelCita, btnMasMenosCitas); }
private void txtTemperatura_KeyPress(object sender, KeyPressEventArgs e) { Efecto.SoloLetrasOrNumeros('N', e); }
private void txtPresionBaja_KeyPress(object sender, KeyPressEventArgs e) { Efecto.SoloLetrasOrNumeros('N', e); }
private void btnConfirmar_Click(object sender, EventArgs e) { if ((Efecto.ValidarFormulario(this, ErrorDatos) == false) && !(string.IsNullOrEmpty(rtxtMotivoConsulta.Text.Trim())) && !(string.IsNullOrEmpty(rtxtHistoria.Text.Trim()))) { clFachadaConsulta objConsulta = new clFachadaConsulta(); try { bool ResultadoOk = true; string MensajeError = ""; DateTime FechaConsulta = Convert.ToDateTime(dtpFechaConsulta.Value); DateTime HoraConsulta = Convert.ToDateTime(dtpHoraConsulta.Value); string Motivo = rtxtMotivoConsulta.Text; string Historia = rtxtHistoria.Text; bool seguimiento = false; if (cbSeguimiento.Checked) { seguimiento = true; } int Doc_ID = 1; string Examen = txtExamenFisico.Text; decimal peso = 0; decimal talla = 0; decimal indiceMC = 0; decimal Temp = 0; int Presionalta = 0; int PresionBaja = 0; try { if (string.IsNullOrEmpty(txtPeso.Text.Trim())) { peso = 0; } else { peso = Convert.ToDecimal(txtPeso.Text); } if (string.IsNullOrEmpty(txtTalla.Text.Trim())) { talla = 0; } else { talla = Convert.ToDecimal(txtTalla.Text); } if (string.IsNullOrEmpty(txtIndiceMC.Text.Trim())) { if ((string.IsNullOrEmpty(txtPeso.Text.Trim())) || (string.IsNullOrEmpty(txtTalla.Text.Trim()))) { indiceMC = 0; } else { indiceMC = (peso / (talla * talla)); txtIndiceMC.Text = indiceMC.ToString(); } } if (string.IsNullOrEmpty(txtTemperatura.Text.Trim())) { Temp = 0; } else { Temp = Convert.ToDecimal(txtTemperatura.Text); } if ((string.IsNullOrEmpty(txtPeso.Text.Trim())) || (string.IsNullOrEmpty(txtTalla.Text.Trim()))) { indiceMC = 0; } else { indiceMC = (peso / (talla * talla)); txtIndiceMC.Text = indiceMC.ToString(); } if ((string.IsNullOrEmpty(txtPresionalta.Text.Trim())) || (string.IsNullOrEmpty(txtPresionBaja.Text.Trim()))) { } else { Presionalta = Convert.ToInt16(txtPresionalta.Text); PresionBaja = Convert.ToInt16(txtPresionBaja.Text); } } catch { ResultadoOk = false; } if (ResultadoOk) { int Pa_ID = Convert.ToInt32(txtExpediente.Text); int Con_ID = 0; string Diagnostico = txtDiagnostico.Text; string Tratamiento = txtTratamiento.Text; objConsulta.RegistrarConsulta(ref Con_ID, FechaConsulta, HoraConsulta, Motivo, Historia, seguimiento, Doc_ID, Pa_ID, Examen, peso, talla, indiceMC, Temp, Presionalta, PresionBaja, Diagnostico, Tratamiento, ref ResultadoOk, ref MensajeError); if (ResultadoOk) { txtConsultaID.Text = Con_ID.ToString(); MessageBox.Show("Consulta Guardada Exitosamente"); } else { MessageBox.Show(MensajeError); } } else { MessageBox.Show(" Los datos Introducidos en el Apartado de condicion Fisica, como : peso, talla, etc., estan en el Formato incorrecto"); } } catch (Exception error) { MessageBox.Show(error.ToString()); } } else { MessageBox.Show("Los campos: Motivo, Historia y Examen Fisico deben estar llenos ", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
private void txtSector_KeyPress(object sender, KeyPressEventArgs e) { Efecto.SoloLetrasOrNumeros('L', e); }
private void signIn() { Autenticacion aut = Autenticacion.Instance; if (string.IsNullOrEmpty(txtUserName.Text)) { errorProvider.SetError(txtUserName, "Debe llenar el usuario"); } else { if (string.IsNullOrEmpty(txtPassword.Text)) { user = txtUserName.Text; subControl = 3;//para seleccionar solo por el usuario y verificar si existe; dataTable = aut.IniciarSeccion(user, password, subControl, ref resultadoOk, ref mensajeError); if (dataTable.Rows.Count == 1) { panelPasswordContainer.Visible = true; txtPassword.Focus(); txtUserName.Enabled = false; lblBienvenido.Visible = true; btnBack.Visible = true; string nombre = dataTable.Rows[0]["Doc_Nombre"].ToString(); string apellido = dataTable.Rows[0]["Doc_Apellido"].ToString(); if (!string.IsNullOrEmpty(dataTable.Rows[0]["Us_Foto"].ToString())) { byte[] imgageURL = (byte[])dataTable.Rows[0]["Us_Foto"]; imgUserLogin.Image = SolutionHelper.ConvertToImage(imgageURL); } lblUserInfoName.Text = nombre; lblUserInfoLastName.Text = apellido; btnLogin.Text = "Sing In"; } else { MessageBox.Show("Usuario no Encontrado"); } } else { password = txtPassword.Text; subControl = 2;//para seleccionar solo por el usuario y la contyrasena; dataTable = aut.IniciarSeccion(user, password, subControl, ref resultadoOk, ref mensajeError); if (dataTable.Rows.Count == 1) { //El usuario esta autenticado Form_Principal FP = new Form_Principal(); FP.receiveUser(dataTable); FP.Show(); Efecto.LimpiarForm(this); this.Hide(); //this.Close(); } else { errorProvider.SetError(txtPassword, "Contraseña Inavalida"); } } } }
private void btnNuevo_Click(object sender, EventArgs e) { // Efecto.LimpiarFormulario(this); Efecto.LimpiarForm(this); }
private void btnReportes_MouseMove(object sender, MouseEventArgs e) { Efecto.Instance.panelMoving(Panel_Barra, btnReportes, Efecto.VERTICAL); MostrarPanel(); Efecto.VisibleNoVisible(Panel_Slide, Reportes_Panel); }