protected void btnProgramar_Click(object sender, EventArgs e) { if (txtResultado.Text == "") { lblMensaje.Text = "Registre resultado"; txtResultado.Focus(); return; } if (txtObservaciones.Text == "") { lblMensaje.Text = "Registre observaciones"; txtObservaciones.Focus(); return; } InformeResultadoBL oInformeResultado = new InformeResultadoBL(); InformeResultadoBE eInformeResultado = new InformeResultadoBE(); eInformeResultado.Id_orden_examen = Convert.ToInt32(txtId_orden_examen.Text); eInformeResultado.Resultado = txtResultado.Text; eInformeResultado.Observacion = txtObservaciones.Text; eInformeResultado.Estado = "R"; if (fupImagen.FileName != "") { eInformeResultado.Imagen = fupImagen.FileName; } if (oInformeResultado.Nuevo(eInformeResultado) == true) { if (fupImagen.FileName != "") { //System.IO.File.Copy(fupImagen.PostedFile.FileName, @"D:\personal\UPC\tp3\proyecto\sistema\examenes\" + fupImagen.FileName, true); System.IO.File.Copy(fupImagen.PostedFile.FileName, @"D:\personal\UPC\tp3\proyecto\sistema\UPC-TP3\Fuentes\Net\ClinicaInternacional\CI.SIC.AP\GestionImagenes\examenes\" + fupImagen.FileName, true); } Response.Redirect("gestionImagenes.aspx"); } else { lblMensaje.Text = "No se pudieron registrar Resultados"; } }
protected void CargaInforme() { InformeResultadoBL oInformeResultado = new InformeResultadoBL(); InformeResultadoBE eInformeResultado; eInformeResultado = oInformeResultado.Registro(txtId_orden_examen.Text == "" ? 0 : Convert.ToInt32(txtId_orden_examen.Text)); lblAdicionales.Visible = false; txtAdicionales.Visible = false; btnGrabarAdicionales.Visible = false; txtResultado.CssClass = ""; txtObservaciones.CssClass = ""; txtFecha_resultado.CssClass = ""; if (eInformeResultado != null) { txtFecha_resultado.Text = eInformeResultado.Fecha.ToString("dd/MM/yyyy"); txtEstado_resultado.Text = eInformeResultado.Estado; txtResultado.Text = eInformeResultado.Resultado; txtObservaciones.Text = eInformeResultado.Observacion; txtAdicionales.Text = eInformeResultado.Adicional; if (hidAccion.Value != "C") { Image1.ImageUrl = ""; btnGrabar.Visible = false; Image1.Visible = false; lblMensaje.Text = "Resultado de examen ya fue registrado"; } else { txtResultado.CssClass = "no_edit"; txtObservaciones.CssClass = "no_edit"; txtFecha_resultado.CssClass = "no_edit"; lblAdicionales.Visible = true; txtAdicionales.Visible = true; btnGrabarAdicionales.Visible = true; if (eInformeResultado.Imagen != "") { Image1.Visible = true; //Image1.ImageUrl = @"file:\\" + @"D:\personal\UPC\tp3\proyecto\sistema\examenes\" + eInformeResultado.Imagen; Image1.ImageUrl = "examenes/" + eInformeResultado.Imagen; //Image1.ImageUrl = @"file:///C:/Users/Public/Pictures/ban-seguros.png"; //Image1.DataBind(); } } } else { txtEstado_resultado.Text = ""; txtResultado.Text = ""; txtObservaciones.Text = ""; if (hidAccion.Value == "C") { Image1.Visible = false; lblMensaje.Text = "Resultado de examen no ha sido registrado"; } else { txtFecha_resultado.Text = DateTime.Now.ToString("dd/MM/yyyy"); } } }