Beispiel #1
0
 protected void Insert_fields(object sender, EntityDataSourceChangingEventArgs e)
 {
     YASA_PL.QualityDocumentation_Files c = (YASA_PL.QualityDocumentation_Files)e.Entity;
     if (c != null)
     {
         c.Date_created_modified = DateTime.Now;
         if (c.filePath != null)
         {
             c.File_extension = c.filePath.Substring(c.filePath.LastIndexOf(".") + 1).ToLower();
             //add file size information
             String             fileUrl = "~/qualitydocumentation_files/" + c.filePath;
             String             path    = Server.MapPath(fileUrl);
             System.IO.FileInfo fi      = null;
             fi          = new System.IO.FileInfo(path);
             c.File_size = Math.Round(Convert.ToDecimal(fi.Length / 1048576), 2);
         }
     }
 }
 protected void Insert_fields(object sender, EntityDataSourceChangingEventArgs e)
 {
     YASA_PL.QualityDocumentation_Files c = (YASA_PL.QualityDocumentation_Files)e.Entity;
     if (c != null)
     {
         c.Date_created_modified = DateTime.Now;
         if (c.filePath != null)
         {
             c.File_extension = c.filePath.Substring(c.filePath.LastIndexOf(".") + 1).ToLower();
             //add file size information
             String             fileUrl = "~/qualitydocumentation_files/" + c.filePath;
             String             path    = Server.MapPath(fileUrl);
             System.IO.FileInfo fi      = null;
             fi          = new System.IO.FileInfo(path);
             c.File_size = Math.Round(Convert.ToDecimal(fi.Length / 1048576), 2);
         }
         Session["Record_Info"] = "Edycja pliku zakończona poprawnie";
         redirectlink           = "~/QualityDocumentationSet/Details.aspx?Id=" + c.QualityDocumentationId;
     }
 }