refabrique des commandes

This commit is contained in:
2016-06-14 03:37:57 +02:00
parent a0531fbc39
commit b0b22ea494
38 changed files with 2484 additions and 262 deletions

View File

@ -1,18 +1,18 @@
using System.IO;
using Microsoft.AspNet.FileProviders;
using Yavsc.Models;
using Yavsc.Models.Billing;
namespace Yavsc.Helpers
{
public static class FileSystemHelpers {
public static IDirectoryContents GetFileContent(this Estimate estimate, string userFileDir)
public static IDirectoryContents GetFileContent(this RDVEstimate estimate, string userFileDir)
{
if (estimate?.Command?.PerformerProfile?.Performer == null)
if (estimate?.Query?.PerformerProfile?.Performer == null)
return null;
var fsp = new PhysicalFileProvider(
Path.Combine(
userFileDir,
estimate.Command.PerformerProfile.Performer.UserName
estimate.Query.PerformerProfile.Performer.UserName
));
return fsp.GetDirectoryContents(
Path.Combine(Constants.UserBillsFilesDir, estimate.Id.ToString())