This commit is contained in:
parent
46f5c107b8
commit
fa34ed249b
233 changed files with 4000 additions and 1396 deletions
23
Yavsc/Helpers/FileSystemHelpers.cs
Normal file
23
Yavsc/Helpers/FileSystemHelpers.cs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
using System.IO;
|
||||
using Microsoft.AspNet.FileProviders;
|
||||
using Yavsc.Models;
|
||||
|
||||
namespace Yavsc.Helpers
|
||||
{
|
||||
public static class FileSystemHelpers {
|
||||
public static IDirectoryContents GetFileContent(this Estimate estimate, string userFileDir)
|
||||
{
|
||||
if (estimate?.Command?.PerformerProfile?.Performer == null)
|
||||
return null;
|
||||
var fsp = new PhysicalFileProvider(
|
||||
Path.Combine(
|
||||
userFileDir,
|
||||
estimate.Command.PerformerProfile.Performer.UserName
|
||||
));
|
||||
return fsp.GetDirectoryContents(
|
||||
Path.Combine(Constants.UserBillsFilesDir, estimate.Id.ToString())
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue