public async Task <ReportResponseDto> UpdateReport(ReportUpdateDto reportUpdate) { var report = _mapper.Map <Report>(reportUpdate); await _reportRepository.Update(report); var response = _mapper.Map <ReportResponseDto>(reportUpdate); return(response); }
public IActionResult UpdateReport(ReportUpdateDto model) { if (ModelState.IsValid) { var currentReport = _reportService.GetById(model.Id); currentReport.Title = model.Title; currentReport.Description = model.Description; _reportService.Update(currentReport); return(RedirectToAction("Index")); } return(View(model)); }
public IActionResult UpdateStatus(ReportUpdateDto dto) { try { //_service.UpdateStatus(dto); return(NoContent()); } catch (Exception) { throw; } }
public IActionResult UpdateReport(int id) { TempData["Active"] = TempDataInfo.Job; var report = _reportService.GetJobWithId(id); ReportUpdateDto model = new ReportUpdateDto() { Basliq = report.Basliq, Detay = report.Detay, Id = report.Id, Job = report.Job, JobId = report.JobId }; return(View(model)); }
public IActionResult UpdateReport(ReportUpdateDto model) { TempData["Active"] = TempDataInfo.Job; if (ModelState.IsValid) { var report = _reportService.GetJobWithId(model.Id); report.Basliq = model.Basliq; report.Detay = model.Detay; _reportService.Update(report); return(RedirectToAction("Index")); } return(View(model)); }
public IActionResult UpdateReport(ReportUpdateDto model) { if (ModelState.IsValid) { var updatedReport = _reportService.GetById(model.Id); updatedReport.Detail = model.Detail; updatedReport.Description = model.Description; _reportService.Update(updatedReport); return(RedirectToAction("Index")); } return(View(model)); }
public IActionResult UpdateReport(int id) { TempData["Active"] = TempDataInfo.WorkOrder; var report = _reportService.GetWithWorkId(id); ReportUpdateDto model = new ReportUpdateDto { Id = report.Id, WorkId = report.WorkId, Work = report.Work, Detail = report.Detail, Description = report.Description }; return(View(model)); }
public async Task SaveReport(ReportUpdateDto report) { var doc = await Reports .Find(x => x.Id == new ObjectId(report.Id)) .FirstOrDefaultAsync(); if (doc is null) { throw new Exception($"INFRASTRUCTURE: Can't save report with {report.Id} id"); } doc.QuestionnaireAnswers = report.QuestionnaireAnswers; doc.TableAnswers = report.TableAnswers; await Reports.FindOneAndReplaceAsync( filter : Builders <ReportDocument> .Filter.Eq(x => x.Id, doc.Id), replacement : doc); }
public async Task <IActionResult> UpdateReport([FromBody] ReportUpdateDto userModel) { await _reportService.UpdateReport(userModel); return(Ok()); }
public UpdateReport(ReportUpdateDto report, bool passed) { Report = report; Posted = passed; }