estimate to LaTeX

This commit is contained in:
Paul Schneider 2016-11-06 02:03:36 +01:00
commit d1ae27074e
29 changed files with 1294 additions and 148 deletions

View file

@ -87,9 +87,8 @@ namespace Yavsc.Controllers
));
}
[Produces("text/x-tex"), Authorize,
Route("estimate-{id}.tex")]
public ViewResult Estimate(long id)
[Produces("text/x-tex"), Authorize, Route("estimate-{id}.tex")]
public ViewResult EstimateTex(long id)
{
var estimate = _context.Estimates.Include(x=>x.Query)
.Include(x=>x.Query.Client)
@ -97,10 +96,21 @@ namespace Yavsc.Controllers
.Include(x=>x.Query.PerformerProfile.OrganizationAddress)
.Include(x=>x.Query.PerformerProfile.Performer)
.Include(e=>e.Bill).FirstOrDefault(x=>x.Id==id);
ViewBag.From = estimate.Query.PerformerProfile.Performer;
ViewBag.To = estimate.Query.Client;
Response.ContentType = "text/x-tex";
return View("Estimate.tex", estimate);
}
[Produces("application/x-pdf"), Authorize, Route("estimate-{id}.pdf")]
public ViewResult EstimatePdf(long id)
{
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);
return View("Estimate.pdf", estimate);
}
}
}

View file

@ -105,7 +105,8 @@ namespace Yavsc.Controllers
Roles = await _userManager.GetRolesAsync(user),
PostalAddress = user.PostalAddress?.Address,
FullName = user.FullName,
Avatar = user.Avatar
Avatar = user.Avatar,
BankInfo = user.BankInfo
};
if (_dbContext.Performers.Any(x => x.PerformerId == user.Id))
{
@ -296,6 +297,21 @@ namespace Yavsc.Controllers
else return Redirect(model.ReturnUrl);
}
[HttpGet,Authorize]
public async Task<IActionResult> AddBankInfo()
{
var user = await _userManager.FindByIdAsync(User.GetUserId());
return View(new AddBankInfoViewModel(
user.BankInfo));
}
[HttpGet,Authorize]
public async Task<IActionResult> SetFullName()
{
var user = await _userManager.FindByIdAsync(User.GetUserId());
return View(user.FullName);
}
//
// POST: /Manage/ChangePassword
[HttpPost]