clean & update project refs
This commit is contained in:
parent
fbd352e788
commit
089f500661
8 changed files with 39 additions and 7 deletions
|
|
@ -8,6 +8,7 @@ using Microsoft.AspNet.Razor;
|
|||
namespace Yavsc.ApiControllers
|
||||
{
|
||||
using Models;
|
||||
using Helpers;
|
||||
|
||||
[Route("api/pdfestimate"), Authorize]
|
||||
public class PdfEstimateController : Controller
|
||||
|
|
@ -87,5 +88,13 @@ namespace Yavsc.ApiControllers
|
|||
{
|
||||
return ViewComponent("Estimate",new object[] { id, "Pdf" } );
|
||||
}
|
||||
|
||||
[HttpPost("prosign/{id}")]
|
||||
public IActionResult ProSign(long id)
|
||||
{
|
||||
if (Request.Form.Files.Count!=1)
|
||||
return new BadRequestResult();
|
||||
return Ok (User.ReceiveProSignature(id,Request.Form.Files[0]));
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 43 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 12 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 3.2 KiB |
|
|
@ -1,5 +1,6 @@
|
|||
|
||||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
|
|
@ -101,10 +102,6 @@ namespace Yavsc.Helpers
|
|||
item.FileName = user.UserName + ".png";
|
||||
var destFileName = Path.Combine(Startup.SiteSetup.UserFiles.Avatars, item.FileName);
|
||||
|
||||
ImageProcessor.ImageFactory f = new ImageProcessor.ImageFactory();
|
||||
|
||||
ImageProcessor.Web.Processors.Resize r = new ImageProcessor.Web.Processors.Resize();
|
||||
|
||||
var fi = new FileInfo(destFileName);
|
||||
if (fi.Exists) item.Overriden = true;
|
||||
Rectangle cropRect = new Rectangle();
|
||||
|
|
@ -166,5 +163,25 @@ namespace Yavsc.Helpers
|
|||
dir, xsmallname), ImageFormat.Png);
|
||||
}
|
||||
}
|
||||
|
||||
public static FileRecievedInfo ReceiveProSignature(this ClaimsPrincipal user, long estimateId, IFormFile formFile)
|
||||
{
|
||||
var item = new FileRecievedInfo();
|
||||
item.FileName = $"estimate-prosign-{estimateId}.png";
|
||||
var destFileName = Path.Combine(Startup.SiteSetup.UserFiles.Blog, item.FileName);
|
||||
|
||||
var fi = new FileInfo(destFileName);
|
||||
if (fi.Exists) item.Overriden = true;
|
||||
|
||||
using (var org = formFile.OpenReadStream())
|
||||
{
|
||||
Image i = Image.FromStream(org);
|
||||
using (Bitmap source = new Bitmap(i))
|
||||
{
|
||||
source.Save(destFileName, ImageFormat.Png);
|
||||
}
|
||||
}
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@
|
|||
}
|
||||
});
|
||||
});
|
||||
</script> @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } }
|
||||
</script>
|
||||
|
||||
<h2>@ViewData["Title"].</h2>
|
||||
|
||||
|
|
|
|||
|
|
@ -118,7 +118,11 @@
|
|||
"gen": "Microsoft.Extensions.CodeGeneration"
|
||||
},
|
||||
"frameworks": {
|
||||
"dnx451": {}
|
||||
"dnx451": {
|
||||
"frameworkAssemblies": {
|
||||
"System.Drawing": "4.0.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"exclude": [
|
||||
"wwwroot",
|
||||
|
|
|
|||
|
|
@ -11423,6 +11423,8 @@
|
|||
"Microsoft.AspNet.OWin >= 1.0.0-rc1-final",
|
||||
"System.Json >= 4.0.20126.16343"
|
||||
],
|
||||
"DNX,Version=v4.5.1": []
|
||||
"DNX,Version=v4.5.1": [
|
||||
"fx/System.Drawing >= 4.0.0"
|
||||
]
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue