This commit is contained in:
@@ -146,6 +146,10 @@ namespace AyaNova.Biz
|
|||||||
//FILES ON DISK
|
//FILES ON DISK
|
||||||
var UtilFilesInfo = FileUtil.GetUtilityFolderSizeInfo();
|
var UtilFilesInfo = FileUtil.GetUtilityFolderSizeInfo();
|
||||||
var AttachmentFilesInfo = FileUtil.GetAttachmentFolderSizeInfo();
|
var AttachmentFilesInfo = FileUtil.GetAttachmentFolderSizeInfo();
|
||||||
|
|
||||||
|
//Available space
|
||||||
|
|
||||||
|
|
||||||
using (AyContext ct = ServiceProviderProvider.DBContext)
|
using (AyContext ct = ServiceProviderProvider.DBContext)
|
||||||
{
|
{
|
||||||
//write to db
|
//write to db
|
||||||
|
|||||||
@@ -260,7 +260,20 @@ namespace AyaNova.Util
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal static long UtilityFilesDriveAvailableSpace()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return new System.IO.DriveInfo(Path.GetPathRoot(UtilityFilesFolder)).AvailableFreeSpace;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
|
||||||
|
ILogger log = AyaNova.Util.ApplicationLogging.CreateLogger("FileUtil::UtilityFilesDriveAvailableSpace");
|
||||||
|
log.LogError(ex, "FileUtil::UtilityFilesDriveAvailableSpace error getting available space");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion Utility file handling
|
#endregion Utility file handling
|
||||||
|
|
||||||
@@ -505,7 +518,7 @@ namespace AyaNova.Util
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
internal static void BackupAttachments(string demandFileNamePrepend,ILogger log = null)
|
internal static void BackupAttachments(string demandFileNamePrepend, ILogger log = null)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -524,7 +537,20 @@ namespace AyaNova.Util
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal static long AttachmentFilesDriveAvailableSpace()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return new System.IO.DriveInfo(Path.GetPathRoot(UserFilesFolder)).AvailableFreeSpace;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
|
||||||
|
ILogger log = AyaNova.Util.ApplicationLogging.CreateLogger("FileUtil::AttachmentFilesDriveAvailableSpace");
|
||||||
|
log.LogError(ex, "FileUtil::AttachmentFilesDriveAvailableSpace error getting available space");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
#endregion attachment stuff
|
#endregion attachment stuff
|
||||||
|
|
||||||
#region General utilities
|
#region General utilities
|
||||||
|
|||||||
Reference in New Issue
Block a user