Re-fabrication

This commit is contained in:
2018-03-26 19:27:29 +02:00
parent e00bcbe275
commit 8fbe56c67e
499 changed files with 7510 additions and 12466 deletions

View File

@ -21,6 +21,7 @@ namespace Yavsc.ApiControllers
using ViewModels.Auth;
using Newtonsoft.Json;
using Yavsc.ViewModels;
using Yavsc.Abstract.FileSystem;
[Route("api/bill"), Authorize]
public class BillingController : Controller
@ -146,7 +147,7 @@ namespace Yavsc.ApiControllers
}
var filename = FileSystemHelpers.SignFileNameFormat("pro",billingCode,id);
FileInfo fi = new FileInfo(Path.Combine(Startup.UserBillsDirName, filename));
FileInfo fi = new FileInfo(Path.Combine(AbstractFileSystemHelpers.UserBillsDirName, filename));
if (!fi.Exists) return HttpNotFound(new { Error = "Professional signature not found" });
return File(fi.OpenRead(), "application/x-pdf", filename); ;
}
@ -181,7 +182,7 @@ namespace Yavsc.ApiControllers
}
var filename = FileSystemHelpers.SignFileNameFormat("pro",billingCode,id);
FileInfo fi = new FileInfo(Path.Combine(Startup.UserBillsDirName, filename));
FileInfo fi = new FileInfo(Path.Combine(AbstractFileSystemHelpers.UserBillsDirName, filename));
if (!fi.Exists) return HttpNotFound(new { Error = "Professional signature not found" });
return File(fi.OpenRead(), "application/x-pdf", filename); ;
}

View File

@ -4,6 +4,7 @@ using Microsoft.AspNet.Mvc;
using Yavsc.Helpers;
using Yavsc.Models;
using Yavsc.Models.Workflow;
using Yavsc.Services;
namespace Yavsc.ApiControllers
{
@ -27,7 +28,7 @@ namespace Yavsc.ApiControllers
{
if (billingCode==null) return HttpBadRequest("billingCode");
if (queryId==0) return HttpBadRequest("queryId");
var billing = Startup.GetBillable(dbContext, billingCode, queryId);
var billing = BillingService.GetBillable(dbContext, billingCode, queryId);
if (billing==null) return HttpBadRequest();
billing.Rejected = true;
billing.RejectedAt = DateTime.Now;