public IActionResult Update(Guid id, SaturnReport saturn) { var report = _saturnReportRepository.GetAllSaturnReports() .FirstOrDefault(x => x.Id == id); _saturnReportRepository.Update(report); return(RedirectToAction("ViewAll", "SaturnReport")); }
public IActionResult Delete(Guid id, SaturnReport saturnReport) { if (ModelState.IsValid) { var report = _saturnReportRepository.GetAllSaturnReports() .FirstOrDefault(x => x.Id == id); _saturnReportRepository.Delete(report); } return(RedirectToAction("ViewAll", "SaturnReport")); }
public IActionResult Edit(SaturnReport saturnReport, Guid Id) { var report = _saturnReportRepository.GetAllSaturnReports().FirstOrDefault(x => x.Id == Id); report.Title = saturnReport.Title; report.UserEmail = saturnReport.UserEmail; report.Desciption = saturnReport.Desciption; report.BodyText = saturnReport.BodyText; report.Created = saturnReport.Created; _saturnReportRepository.Update(report); _saturnReportRepository.Save(); return(RedirectToAction("Index", "Admin")); }
public IActionResult AbcHome() { var model = new SaturnReport(); return(View(model)); }
public IActionResult Create(SaturnReport report, int?id) { _saturnReportRepository.Add(report); return(RedirectToAction("ViewAll", "SaturnReport")); }
public Task <EntityEntry <SaturnReport> > Insert(SaturnReport item) { throw new NotImplementedException(); }
public void Delete(SaturnReport saturnReport) { _context.SaturnReports.Remove(saturnReport); _context.SaveChanges(); }
public void Add(SaturnReport saturnReport) { _context.SaturnReports.Add(saturnReport); _context.SaveChanges(); }
public EntityEntry <SaturnReport> Update(SaturnReport saturnReport) { return(_context.SaturnReports.Update(saturnReport)); }