Validated book queries are obsolete
This commit is contained in:
parent
ead4b97c4f
commit
bf09fe4a91
3 changed files with 48 additions and 2 deletions
|
|
@ -1,3 +1,4 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using System.Security.Claims;
|
||||
using Microsoft.AspNet.Authorization;
|
||||
|
|
@ -124,8 +125,15 @@ namespace Yavsc.Controllers
|
|||
return HttpBadRequest(ModelState);
|
||||
}
|
||||
}
|
||||
|
||||
if (estimate.CommandId!=null) {
|
||||
var query = _context.BookQueries.FirstOrDefault(q => q.Id == estimate.CommandId);
|
||||
if (query == null || query.PerformerId!= uid)
|
||||
throw new InvalidOperationException();
|
||||
query.ValidationDate = DateTime.Now;
|
||||
}
|
||||
_context.Estimates.Add(estimate);
|
||||
|
||||
|
||||
/* _context.AttachRange(estimate.Bill);
|
||||
_context.Attach(estimate);
|
||||
_context.Entry(estimate).State = EntityState.Added;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue