示例#1
0
        private void Anular(object p)
        {
            Business.Data.Laboratorio.Protocolo oRegistro = new Business.Data.Laboratorio.Protocolo();
            oRegistro = (Business.Data.Laboratorio.Protocolo)oRegistro.Get(typeof(Business.Data.Laboratorio.Protocolo), int.Parse(p.ToString()));

            Configuracion oCon = new Configuracion(); oCon = (Configuracion)oCon.Get(typeof(Configuracion), 1);

            oCon = (Configuracion)oCon.Get(typeof(Configuracion), "IdConfiguracion", 1);

            if (oRegistro.Estado == 2)
            {
                if (oCon.EliminarProtocoloTerminado)
                {
                    oRegistro.Baja = true;
                    oRegistro.Save();
                    oRegistro.GrabarAuditoriaProtocolo("Elimina Protocolo", int.Parse(Session["idUsuario"].ToString()));
                    //CargarGrilla();
                }
                else
                {
                    string popupScript = "<script language='JavaScript'> alert('No es posible eliminar un protocolo terminado.')</script>";
                    Page.RegisterClientScriptBlock("PopupScript", popupScript);
                }
            }
            else
            {
                oRegistro.Baja = true;
                oRegistro.Save();
                oRegistro.GrabarAuditoriaProtocolo("Elimina Protocolo", int.Parse(Session["idUsuario"].ToString()));
                //CargarGrilla();
            }
            CargarGrilla();
        }
        private void Imprimir(object p, string p_2)
        {
            Business.Data.Laboratorio.Protocolo oProt = new Business.Data.Laboratorio.Protocolo();
            oProt = (Business.Data.Laboratorio.Protocolo)oProt.Get(typeof(Business.Data.Laboratorio.Protocolo), int.Parse(p.ToString()));

            oProt.GrabarAuditoriaProtocolo("Genera PDF Comprobante", int.Parse(Session["idUsuario"].ToString()));

            Configuracion oCon = new Configuracion(); oCon = (Configuracion)oCon.Get(typeof(Configuracion), 1);

            oCon = (Configuracion)oCon.Get(typeof(Configuracion), "IdConfiguracion", 1);

            ParameterDiscreteValue encabezado1 = new ParameterDiscreteValue();

            encabezado1.Value = oCon.EncabezadoLinea1;

            ParameterDiscreteValue encabezado2 = new ParameterDiscreteValue();

            encabezado2.Value = oCon.EncabezadoLinea2;

            ParameterDiscreteValue encabezado3 = new ParameterDiscreteValue();

            encabezado3.Value = oCon.EncabezadoLinea3;


            ParameterDiscreteValue tipoNumeracion = new ParameterDiscreteValue();

            tipoNumeracion.Value = oCon.TipoNumeracionProtocolo;



            oCr.Report.FileName = "../Informes/Protocolo.rpt";
            oCr.ReportDocument.SetDataSource(oProt.GetDataSet("Protocolo", "", oProt.IdTipoServicio.IdTipoServicio));

            oCr.ReportDocument.ParameterFields[0].CurrentValues.Add(encabezado1);
            oCr.ReportDocument.ParameterFields[1].CurrentValues.Add(encabezado2);
            oCr.ReportDocument.ParameterFields[2].CurrentValues.Add(encabezado3);
            oCr.ReportDocument.ParameterFields[3].CurrentValues.Add(tipoNumeracion);

            oCr.DataBind();
            if (p_2 == "I")
            {
                oCr.ReportDocument.PrintToPrinter(1, false, 0, 0);
            }
            else
            {
                MemoryStream oStream; // using System.IO
                oStream = (MemoryStream)oCr.ReportDocument.ExportToStream(ExportFormatType.PortableDocFormat);
                Response.Clear();
                Response.Buffer      = true;
                Response.ContentType = "application/pdf";
                Response.AddHeader("Content-Disposition", "attachment;filename=Protocolo.pdf");

                Response.BinaryWrite(oStream.ToArray());
                Response.End();
            }
        }
示例#3
0
        protected void btnGuardar_Click1(object sender, EventArgs e)
        {
            if (Page.IsValid)
            { ///Verifica si se trata de un alta o modificacion de protocolo
                Business.Data.Laboratorio.Protocolo oRegistro = new Business.Data.Laboratorio.Protocolo();
                oRegistro = (Business.Data.Laboratorio.Protocolo)oRegistro.Get(typeof(Business.Data.Laboratorio.Protocolo), int.Parse(Request["idProtocolo"].ToString()));

                GuardarDiagnosticos(oRegistro);
            }
        }
示例#4
0
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            { ///Verifica si se trata de un alta o modificacion de protocolo
                Business.Data.Laboratorio.Protocolo oRegistro = new Business.Data.Laboratorio.Protocolo();
                oRegistro = (Business.Data.Laboratorio.Protocolo)oRegistro.Get(typeof(Business.Data.Laboratorio.Protocolo), int.Parse(Request["idProtocolo"].ToString()));


                Guardar(oRegistro);
                Response.Redirect("AnalisisEdit.aspx?idProtocolo=" + oRegistro.IdProtocolo.ToString(), false);
            }
        }
示例#5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                SetToken();
                Business.Data.Laboratorio.Protocolo oRegistro = new Business.Data.Laboratorio.Protocolo();
                oRegistro = (Business.Data.Laboratorio.Protocolo)oRegistro.Get(typeof(Business.Data.Laboratorio.Protocolo), int.Parse(Request["idProtocolo"].ToString()));

                lblProtocolo.Text = oRegistro.GetNumero() + " " + oRegistro.IdPaciente.Apellido + " " + oRegistro.IdPaciente.Nombre;
                //    CargarListas(oRegistro);
                MuestraDatos(oRegistro);
            }
        }
示例#6
0
        private void MuestraDatos()
        {
            //Actualiza los datos de los objetos : alta o modificacion .
            Configuracion oC = new Configuracion(); oC = (Configuracion)oC.Get(typeof(Configuracion), "IdConfiguracion", 1);

            Business.Data.Laboratorio.Protocolo oRegistro = new Business.Data.Laboratorio.Protocolo();
            oRegistro = (Business.Data.Laboratorio.Protocolo)oRegistro.Get(typeof(Business.Data.Laboratorio.Protocolo), int.Parse(Request["idProtocolo"].ToString()));
            //  oRegistro.GrabarAuditoriaProtocolo("Consulta", int.Parse(Session["idUsuario"].ToString()));

            ddlMuestra.SelectedValue = oRegistro.IdMuestra.ToString();

            CargarItems(oRegistro);


            ///Agregar a la tabla las determinaciones para mostrarlas en el gridview
            //dtDeterminaciones = (System.Data.DataTable)(Session["Tabla1"]);
            DetalleProtocolo oDetalle  = new DetalleProtocolo();
            ISession         m_session = NHibernateHttpModule.CurrentSession;
            ICriteria        crit      = m_session.CreateCriteria(typeof(DetalleProtocolo));

            crit.Add(Expression.Eq("IdProtocolo", oRegistro));
            crit.AddOrder(Order.Asc("IdDetalleProtocolo"));

            IList  items  = crit.List();
            string pivot  = "";
            string sDatos = "";

            foreach (DetalleProtocolo oDet in items)
            {
                if (pivot != oDet.IdItem.Nombre)
                {
                    if (sDatos == "")
                    {
                        sDatos = oDet.IdItem.Codigo + "#" + oDet.TrajoMuestra + "#" + oDet.ConResultado;
                    }
                    else
                    {
                        sDatos += ";" + oDet.IdItem.Codigo + "#" + oDet.TrajoMuestra + "#" + oDet.ConResultado;
                    }
                    //sDatos += "#" + oDet.IdItem.Codigo + "#" + oDet.IdItem.Nombre + "#" + oDet.TrajoMuestra + "@";
                    pivot = oDet.IdItem.Nombre;
                }
            }

            TxtDatosCargados.Value = sDatos;

            //TxtDatos.Value = sDatos;
        }
        protected void gvLista_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            switch (e.CommandName)
            {
            case "Modificar":
            {
                Business.Data.Laboratorio.Protocolo oProtocolo = new Business.Data.Laboratorio.Protocolo();
                oProtocolo = (Business.Data.Laboratorio.Protocolo)oProtocolo.Get(typeof(Business.Data.Laboratorio.Protocolo), int.Parse(e.CommandArgument.ToString()));
                if (Request["idServicio"].ToString() == "4")
                {
                    Response.Redirect("ProtocoloEditPesquisa.aspx?idServicio=" + Request["idServicio"].ToString() + "&Desde=ProtocoloList&Operacion=Modifica&idProtocolo=" + oProtocolo.IdProtocolo);
                }
                else
                {
                    Response.Redirect("ProtocoloEdit2.aspx?idServicio=" + Request["idServicio"].ToString() + "&Desde=ProtocoloList&Operacion=Modifica&idProtocolo=" + oProtocolo.IdProtocolo);
                }
                break;
            }

            case "Imprimir":
            {
                Imprimir(e.CommandArgument, "I");
                PintarReferencias();
                break;
            }

            case "Pdf":
            {
                Imprimir(e.CommandArgument, "P");
                CargarGrilla();        // PintarReferencias();
                break;
            }

            case "Anular":
            {
                Anular(e.CommandArgument);
                // PintarReferencias();
                break;
            }
            }
        }
示例#8
0
        private void Imprimir(string p, string p_2)
        {
            Business.Data.Laboratorio.Protocolo oProt = new Business.Data.Laboratorio.Protocolo();
            oProt = (Business.Data.Laboratorio.Protocolo)oProt.Get(typeof(Business.Data.Laboratorio.Protocolo), int.Parse(p));

            oCr.Report.FileName = "../Informes/Protocolo.rpt";
            oCr.ReportDocument.SetDataSource(oProt.GetDataSet("Protocolo", "", oProt.IdTipoServicio.IdTipoServicio));
            oCr.DataBind();


            switch (p_2)
            {
            case "Pantalla":
            {
                CrystalReportViewer1.ReportSourceID = oCr.ID;
                CrystalReportViewer1.ReportSource   = oCr;
                Condiciones_del_visualizador();
            }
            break;

            case "I":
            { oCr.ReportDocument.PrintToPrinter(1, true, 1, 100); }
            break;

            case "PDF":
            {
                oCr.ReportDocument.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, true, "Protocolo.pdf");
                //        MemoryStream oStream; // using System.IO
                //oStream = (MemoryStream)oCr.ReportDocument.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
                //Response.Clear();
                //Response.Buffer = true;
                //Response.ContentType = "application/pdf";
                //Response.AddHeader("Content-Disposition", "attachment;filename=Protocolo.pdf");

                //Response.BinaryWrite(oStream.ToArray());
                //Response.End();
            }
            break;
            }
        }
示例#9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (Request["idProtocolo"] != null)
                {
                    Business.Data.Laboratorio.Protocolo oRegistro = new Business.Data.Laboratorio.Protocolo();
                    oRegistro = (Business.Data.Laboratorio.Protocolo)oRegistro.Get(typeof(Business.Data.Laboratorio.Protocolo), int.Parse(Request["idProtocolo"].ToString()));

                    SolicitudScreening oSolicitud = new SolicitudScreening();
                    oSolicitud = (Business.Data.Laboratorio.SolicitudScreening)oSolicitud.Get(typeof(Business.Data.Laboratorio.SolicitudScreening), "IdProtocolo", oRegistro);

                    if (oSolicitud != null)
                    {
                        MostrarSolicitudScreeening(oSolicitud);
                    }

                    //    CargarItems();
                    //    CargarScreening(int.Parse(Request["idSolicitudScreening"].ToString()));
                    //    CargarAlarmas(int.Parse(Request["idSolicitudScreening"].ToString()));
                }
            }
        }