un positionnement de paramètre workflow des pros

This commit is contained in:
Paul Schneider 2017-01-13 16:31:40 +01:00
commit 96746fcc0b
322 changed files with 25893 additions and 3844 deletions

View file

@ -21,8 +21,11 @@ namespace Yavsc.ViewComponents
{
return await InvokeAsync(id,"Html");
}
public async Task<IViewComponentResult> InvokeAsync(long id, string outputFormat ="Html")
public async Task<IViewComponentResult> InvokeAsync(long id, string outputFormat ="Html")
{
return await InvokeAsync(id,outputFormat,false,false);
}
public async Task<IViewComponentResult> InvokeAsync(long id, string outputFormat ="Html", bool asBill = false, bool acquitted = false)
{
return await Task.Run( ()=> {
Estimate estimate =
@ -34,7 +37,12 @@ namespace Yavsc.ViewComponents
.Include(e => e.Bill).FirstOrDefault(x => x.Id == id);
if (estimate == null)
throw new Exception("No data");
var di = new DirectoryInfo(Startup.SiteSetup.UserFiles.Bills);
var dia = new DirectoryInfo(Startup.SiteSetup.UserFiles.Avatars);
ViewBag.BillsDir = di.FullName;
ViewBag.AvatarsDir = dia.FullName;
ViewBag.AsBill = asBill;
ViewBag.Acquitted = acquitted;
if (outputFormat == "LaTeX") {
return this.View("Estimate_tex", estimate);
}
@ -56,6 +64,7 @@ namespace Yavsc.ViewComponents
return this.View("Estimate_pdf",
new PdfGenerationViewModel{
Temp = Startup.Temp,
TeXSource = tex,
DestDir = Startup.UserBillsDirName,
BaseFileName = $"estimate-{id}"
@ -67,4 +76,4 @@ namespace Yavsc.ViewComponents
}
}
}
}