public async Task <IActionResult> CreateApproveWithReqReason([FromBody] ApproveWithReqReasonMqr appReqMqr) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } await appReqMqrService.InsertAsync(appReqMqr); await appReqMqrService.SaveChangesAsync(); return(Ok(appReqMqr)); }
public async Task Delete(ApproveWithReqReasonMqr appReqMqr) { var appreqmqrData = await maefRepo.GetFirstOrDefaultAsync(predicate : c => c.Id == appReqMqr.MAEFId); appReqMqr.AuditLogGroupId = appreqmqrData.AuditLogGroupId; appReqMqr.HistoryGroupId = Guid.NewGuid(); await historyRepo.InsertAsync(new History { date = DateTime.Now, action = "Approved With Requirement Reason MQR Deleted", groupCode = role, user = user, RequestId = appreqmqrData.Id, AuditLogGroupId = appReqMqr.AuditLogGroupId, HistoryGroupId = appReqMqr.HistoryGroupId }); appReqMqrRepo.Delete(appReqMqr); }