estimation signature

This commit is contained in:
Paul Schneider 2016-12-05 05:57:07 +01:00
commit 077e1051ff
2 changed files with 33 additions and 23 deletions

View file

@ -1,4 +1,3 @@
using System;
using System.Linq;
using System.Security.Claims;
using Microsoft.AspNet.Authorization;
@ -68,7 +67,6 @@ namespace Yavsc.Controllers
[HttpPut("{id}")]
public IActionResult PutEstimate(long id, [FromBody] Estimate estimate)
{
var valdate = DateTime.Now;
if (!ModelState.IsValid)
{
@ -90,7 +88,6 @@ namespace Yavsc.Controllers
}
var entry = _context.Attach(estimate);
estimate.ProviderValidationDate = valdate;
try
{
_context.SaveChanges();
@ -107,7 +104,7 @@ namespace Yavsc.Controllers
}
}
return Ok( new { Id = estimate.Id, LatestValidationDate = valdate });
return Ok( new { Id = estimate.Id });
}
// POST: api/Estimate
@ -127,8 +124,6 @@ namespace Yavsc.Controllers
return HttpBadRequest(ModelState);
}
}
var valdate = DateTime.Now;
estimate.ProviderValidationDate = valdate;
_context.Estimates.Add(estimate);
/* _context.AttachRange(estimate.Bill);
@ -153,7 +148,7 @@ namespace Yavsc.Controllers
throw;
}
}
return Ok( new { Id = estimate.Id, Bill = estimate.Bill , LatestValidationDate = valdate });
return Ok( new { Id = estimate.Id, Bill = estimate.Bill });
}
// DELETE: api/Estimate/5