protected void Page_Load(object sender, EventArgs e)
        {
            OperationResult objOperationResult = new OperationResult();

            if (!IsPostBack)
            {
                if (Request.QueryString["PersonId"] != null)
                {
                    Session["IdTrabajador"] = Request.QueryString["PersonId"].ToString();
                }
            }

            ListamultimediaFile = objPacientBL.GetMultimediaFileByPersonId(ref objOperationResult, Session["IdTrabajador"].ToString()).FindAll(p => p.FileName != "IMAGEN AUDIOGRAMA OD" && p.FileName != "IMAGEN AUDIOGRAMA OI");

            foreach (var item in ListamultimediaFile)
            {
                LinkButton objLinkButton = new LinkButton();

                objLinkButton.ID   = item.MultimediaFileId;
                objLinkButton.Text = item.FileName;

                objLinkButton.Click += new EventHandler(link_Click);

                DivControls.Controls.Add(objLinkButton);
                DivControls.Controls.Add(new LiteralControl("<br>"));
            }
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            OperationResult objOperationResult = new OperationResult();

            if (!IsPostBack)
            {
                if (Request.QueryString["PersonId"] != null)
                {
                    Session["IdTrabajador"] = Request.QueryString["PersonId"].ToString();
                }
            }

            if (!(bool)Session["Adjunto"])
            {
                Label obkLabel = new Label();
                obkLabel.ID   = "label";
                obkLabel.Text = "Usted no tiene permisos para descargar archivos adjuntos";

                DivControls.Controls.Add(obkLabel);
                return;
            }

            ListamultimediaFile = objPacientBL.GetMultimediaFileByPersonId(ref objOperationResult, Session["IdTrabajador"].ToString());

            var ListamultimediaFileFinal = ListamultimediaFile.FindAll(p => p.FileName != "IMAGEN AUDIOGRAMA OD" && p.FileName != "IMAGEN AUDIOGRAMA OI");

            foreach (var item in ListamultimediaFileFinal)
            {
                LinkButton objLinkButton = new LinkButton();

                objLinkButton.ID   = item.MultimediaFileId;
                objLinkButton.Text = item.FileName;

                objLinkButton.Click += new EventHandler(link_Click);

                DivControls.Controls.Add(objLinkButton);
                DivControls.Controls.Add(new LiteralControl("<br>"));
            }

            Session["IdTrabajador"] = null;
        }