WIP estimate tex

This commit is contained in:
2016-11-03 17:34:19 +01:00
parent 583adaa09b
commit 828819ca5c
5 changed files with 155 additions and 31 deletions

View File

@ -32,7 +32,10 @@ namespace Yavsc.Controllers
public IActionResult Index()
{
var uid = User.GetUserId();
return View(_context.Estimates.Where(
return View(_context.Estimates.Include(e=>e.Query)
.Include(e=>e.Query.PerformerProfile)
.Include(e=>e.Query.PerformerProfile.Performer)
.Where(
e=>e.OwnerId == uid || e.ClientId == uid
).ToList());
}

View File

@ -89,13 +89,22 @@ namespace Yavsc.Controllers
}
[Produces("text/x-tex"), Authorize,
Route("Release/Estimate-{id}.tex")]
public Estimate Estimate(long id)
Route("estimate-{id}.tex")]
public ViewResult Estimate(long id)
{
var estimate = _context.Estimates.Include(x=>x.Query).
Include(x=>x.Query.Client).FirstOrDefault(x=>x.Id==id);
var adc = estimate.Query.Client.UserName;
return estimate;
var estimate = _context.Estimates.Include(x=>x.Query)
.Include(x=>x.Query.Client)
.Include(x=>x.Query.PerformerProfile)
.Include(x=>x.Query.PerformerProfile.OrganizationAddress)
.Include(x=>x.Query.PerformerProfile.Performer)
.Include(e=>e.Bill).FirstOrDefault(x=>x.Id==id);
// var poa = estimate.Query.PerformerProfile.OrganizationAddress;
// var adc = estimate.Query.Client.UserName;
ViewBag.From = estimate.Query.PerformerProfile.Performer;
ViewBag.To = estimate.Query.Client;
Response.ContentType = "text/x-tex";
// estimate.Query.Client.PostalAddress.
return View("Estimate.tex", estimate);
}
}
}