public async Task <Response <int> > AddProductionFinalApproval(ProductionFinalApproval productionfinalapproval) { try { await _context.ProductionFinalApproval.AddAsync(productionfinalapproval); await _context.SaveChangesAsync(); var model = productionfinalapproval.Final_Approval_ID; return(new Response <int>() { IsSuccess = true, Model = model }); } catch (Exception ex) { _log.Error(ex, _user.GetCurrentUser().User_Name); return(new Response <int>() { IsSuccess = false, Message = ex.Message }); } }
public async Task <ActionResult> UpdateProductionFinalApproval([FromBody] ProductionFinalApproval model) { if (ModelState.IsValid) { try { await _repository.UpdateProductionFinalApproval(model); return(Ok()); } catch (Exception ex) { if (ex.GetType().FullName == "Microsoft.EntityFrameworkCore.DbUpdateConcurrencyException") { return(NotFound()); } return(BadRequest()); } } return(BadRequest()); }
public Task <Response <bool> > UpdateProductionFinalApproval(ProductionFinalApproval productionFinalapproval) { throw new NotImplementedException(); }