WIP
This commit is contained in:
parent
e58e7782e2
commit
6d5178bf43
16 changed files with 1209 additions and 34 deletions
|
|
@ -68,6 +68,8 @@ namespace Yavsc.Controllers
|
|||
[HttpPut("{id}")]
|
||||
public IActionResult PutEstimate(long id, [FromBody] Estimate estimate)
|
||||
{
|
||||
var valdate = DateTime.Now;
|
||||
|
||||
if (!ModelState.IsValid)
|
||||
{
|
||||
return HttpBadRequest(ModelState);
|
||||
|
|
@ -88,7 +90,7 @@ namespace Yavsc.Controllers
|
|||
}
|
||||
|
||||
var entry = _context.Attach(estimate);
|
||||
estimate.LatestValidationDate = DateTime.Now;
|
||||
estimate.ProviderValidationDate = valdate;
|
||||
try
|
||||
{
|
||||
_context.SaveChanges();
|
||||
|
|
@ -105,7 +107,7 @@ namespace Yavsc.Controllers
|
|||
}
|
||||
}
|
||||
|
||||
return Ok( new { Id = estimate.Id, LatestValidationDate = estimate.LatestValidationDate });
|
||||
return Ok( new { Id = estimate.Id, LatestValidationDate = valdate });
|
||||
}
|
||||
|
||||
// POST: api/Estimate
|
||||
|
|
@ -125,7 +127,9 @@ namespace Yavsc.Controllers
|
|||
return HttpBadRequest(ModelState);
|
||||
}
|
||||
}
|
||||
estimate.LatestValidationDate = DateTime.Now;
|
||||
var valdate = DateTime.Now;
|
||||
estimate.ProviderValidationDate = valdate;
|
||||
|
||||
_context.Estimates.Add(estimate);
|
||||
/* _context.AttachRange(estimate.Bill);
|
||||
_context.Attach(estimate);
|
||||
|
|
@ -149,7 +153,7 @@ namespace Yavsc.Controllers
|
|||
throw;
|
||||
}
|
||||
}
|
||||
return Ok( new { Id = estimate.Id, Bill = estimate.Bill , LatestValidationDate = estimate.LatestValidationDate });
|
||||
return Ok( new { Id = estimate.Id, Bill = estimate.Bill , LatestValidationDate = valdate });
|
||||
}
|
||||
|
||||
// DELETE: api/Estimate/5
|
||||
|
|
@ -182,7 +186,7 @@ namespace Yavsc.Controllers
|
|||
return Ok(estimate);
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
protected override void Dispose (bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
using System.IO;
|
||||
using Microsoft.AspNet.Authorization;
|
||||
using Microsoft.AspNet.Mvc;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.Routing;
|
||||
using Microsoft.AspNet.Mvc.ViewComponents;
|
||||
using Microsoft.AspNet.Razor;
|
||||
|
|
@ -84,7 +83,7 @@ namespace Yavsc.ApiControllers
|
|||
}
|
||||
|
||||
[HttpPost("gen/{id}")]
|
||||
public async Task<IActionResult> GeneratePdf(long id)
|
||||
public IActionResult GeneratePdf(long id)
|
||||
{
|
||||
return ViewComponent("Estimate",new object[] { id, true } );
|
||||
}
|
||||
|
|
|
|||
22
Yavsc/ApiControllers/PodcastController.cs
Normal file
22
Yavsc/ApiControllers/PodcastController.cs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Net.WebSockets;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNet.Mvc;
|
||||
|
||||
namespace Yavsc.ApiControllers
|
||||
{
|
||||
public class PodcastController : Controller
|
||||
{
|
||||
public ArraySegment<Byte> CurrentOutput ;
|
||||
public bool IsEnd;
|
||||
|
||||
ConcurrentBag<WebSocket> Listeners = new ConcurrentBag<WebSocket>();
|
||||
|
||||
public async Task Connect()
|
||||
{
|
||||
var socket = await this.HttpContext.WebSockets.AcceptWebSocketAsync();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue