Esempio n. 1
0
 protected void ASPxGridView1_DetailRowExpandedChanged(object sender, DevExpress.Web.ASPxGridViewDetailRowEventArgs e)
 {
     if (e.Expanded)
     {
         Session["xID"] = this.ASPxGridView1.GetRowValues(e.VisibleIndex, "CodigoBoletin");
         if (!Directory.Exists(MapPath("~/Boletines")))
         {
             Directory.CreateDirectory(MapPath("~/Boletines"));
         }
         if (!Directory.Exists(MapPath("~/Boletines/" + Session["xID"])))
         {
             Directory.CreateDirectory(MapPath("~/Boletines/" + Session["xID"]));
         }
         if (!Directory.Exists(MapPath("~/Thumb")))
         {
             Directory.CreateDirectory(MapPath("~/Thumb"));
         }
     }
 }
Esempio n. 2
0
        protected void gridArtifacts_DetailRowExpandedChanged(object sender, DevExpress.Web.ASPxGridViewDetailRowEventArgs e)
        {
            string FileExtn;
            string storageFileName;

            ASPxGridView artifactsGrid = (ASPxGridView)sender;

            FileExtn        = "";
            storageFileName = artifactsGrid.GetRowValues(e.VisibleIndex, "filestoragename").ToString();
            string fileName = artifactsGrid.GetRowValues(e.VisibleIndex, "filename").ToString();

            string accountName   = "UploadAzureAccount";
            string containerName = Session["enterpriseID"].ToString().ToUpper();
            string url           = GetFileUrl(storageFileName, accountName, containerName, ref FileExtn);

            if (e.Expanded)
            {
                //using (var client = new System.Net.WebClient())
                //{
                //    client.DownloadFile(url, Path.GetTempPath() + "\\" + fileName);
                //}
                //Session["fileNameToDownload"] = fileName + "|" + FileExtn;

                Session["fileNameToDownload"] = url + "|" + FileExtn + "|" + fileName + "|" + storageFileName;
            }
            else
            {
                FileExtn        = Session["fileNameToDownload"].ToString().Split('|')[1];
                storageFileName = Session["fileNameToDownload"].ToString().Split('|')[3];

                if (FileExtn == ".pdf")
                {
                    if (File.Exists(Server.MapPath("~/TempFiles") + "/" + fileName))
                    {
                        File.Delete(Server.MapPath("~/TempFiles") + "/" + fileName);
                    }
                }
                Session.Remove("fileNameToDownload");
            }
        }
Esempio n. 3
0
 protected void ASPxGridViewPlantillaEncabezado_DetailRowExpandedChanged(object sender, DevExpress.Web.ASPxGridViewDetailRowEventArgs e)
 {
     if (e.Expanded)
     {
         Session["DYR_ID"] = this.ASPxGridViewPlantillaEncabezado.GetRowValues(e.VisibleIndex, "DYR_ID");
         Session["ID"]     = e.VisibleIndex;
         SubCargarCuencas();
         SubCargarSecciones();
     }
 }