Exemplo n.º 1
0
 protected void rlv_ItemCommand1(object sender, Telerik.Web.UI.RadListViewCommandEventArgs e)
 {
     if (e.CommandName == "Select")
     {
         string[] index  = e.CommandArgument.ToString().Split(new char[] { ',' });
         var      button = sender as Button;
         for (int i = 0; i < 19; i++)
         {
             if (int.Parse(index[0].ToString()) == i)
             {
                 DataTable dt4 = FRB.GetInfoPeoByFilterPDF(int.Parse(Request.QueryString["ID"].ToString()), int.Parse(index[0].ToString()));
                 Response.ContentType = "pdf";// doc.DOCUMENT_TYPE;
                 Response.Clear();
                 Response.AddHeader("content-disposition", "attachment; filename=" + dt4.Rows[0]["document_name"].ToString() + " " + dt4.Rows[0]["name"].ToString() + " " + dt4.Rows[0]["family"].ToString() + (dt4.Rows[0]["ext"].ToString().Contains(".")?"":".") + dt4.Rows[0]["ext"].ToString());
                 Response.BinaryWrite((byte[])dt4.Rows[0]["scan_document"]);
                 Response.Flush();
                 Response.End();
             }
         }
     }
     if (e.CommandName == "ShowPic")
     {
         string[] index  = e.CommandArgument.ToString().Split(new char[] { ',' });
         var      button = sender as Button;
         for (int i = 0; i < 19; i++)
         {
             if (int.Parse(index[0].ToString()) == i)
             {
                 //Session["ID"] = Request.QueryString["ID"].ToString();
                 Response.Redirect("ShowPicture.aspx?" + "ID" + "=" + int.Parse(Request.QueryString["ID"].ToString()) + "&" + "TypePic" + "=" + int.Parse(index[0].ToString()));
             }
         }
     }
 }
Exemplo n.º 2
0
    void ListViewAlbums_ItemInserting(object sender, Telerik.Web.UI.RadListViewCommandEventArgs e)
    {
        Album album = new Album();

        UpdateAlbum(e, album);

        context.Albums.InsertOnSubmit(album);

        RadAsyncUpload uploadAllImages = (e.ListViewItem.FindControl("RadAsyncUpload2") as RadAsyncUpload);

        if (uploadAllImages.UploadedFiles.Count > 0)
        {
            UploadedFile zipFile = uploadAllImages.UploadedFiles[0];
            using (ZipPackage zipPackage = ZipPackage.Open(zipFile.InputStream, FileAccess.Read))
            {
                List <ZipPackageEntry> allEntries = zipPackage.ZipPackageEntries.ToList();
                foreach (ZipPackageEntry entry in allEntries)
                {
                    byte[] imageData = new byte[entry.UncompressedSize];
                    entry.OpenInputStream().Read(imageData, 0, entry.UncompressedSize);

                    DataContext.Image image = new DataContext.Image();
                    image.AlbumID  = album.ID;
                    image.FileName = entry.FileNameInZip;
                    image.Data     = imageData;

                    album.Images.Add(image);
                }
            }
        }

        context.SubmitChanges();
    }
Exemplo n.º 3
0
        protected void rlvEventos_ItemCommand(object sender, Telerik.Web.UI.RadListViewCommandEventArgs e)
        {
            if (e.CommandName == "Select")
            {
                RadListViewDataItem item = e.ListViewItem as RadListViewDataItem;
                vIdEventoSeleccionado = int.Parse(item.GetDataKeyValue("ID_EVENTO").ToString());
                CargarDatosDetalle(vIdEventoSeleccionado);
                //var evento = ListaEventos.Where(t => t.ID_EVENTO == vIdEventoSeleccionado).FirstOrDefault();

                //if (evento != null)
                //{
                //    txtNbEvento.Text = evento.CL_EVENTO;
                //    txtDescripcion.Text = evento.DS_EVENTO;
                //    txtEstado.Text = evento.NB_ESTADO;
                //    txtCurso.Text = evento.NB_CURSO;
                //    txtUsuarioMod.Text = evento.CL_USUARIO_APP_MODIFICA;
                //    txtFechaMod.Text = String.Format("{0:dd/MM/yyyy}", evento.FE_MODIFICA);
                //}
            }
        }