コード例 #1
0
        public IActionResult Update(Guid id, SaturnReport saturn)
        {
            var report = _saturnReportRepository.GetAllSaturnReports()
                         .FirstOrDefault(x => x.Id == id);

            _saturnReportRepository.Update(report);

            return(RedirectToAction("ViewAll", "SaturnReport"));
        }
コード例 #2
0
 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"));
 }
コード例 #3
0
        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"));
        }
コード例 #4
0
        public IActionResult AbcHome()
        {
            var model = new SaturnReport();

            return(View(model));
        }
コード例 #5
0
        public IActionResult Create(SaturnReport report, int?id)
        {
            _saturnReportRepository.Add(report);

            return(RedirectToAction("ViewAll", "SaturnReport"));
        }
コード例 #6
0
 public Task <EntityEntry <SaturnReport> > Insert(SaturnReport item)
 {
     throw new NotImplementedException();
 }
コード例 #7
0
 public void Delete(SaturnReport saturnReport)
 {
     _context.SaturnReports.Remove(saturnReport);
     _context.SaveChanges();
 }
コード例 #8
0
 public void Add(SaturnReport saturnReport)
 {
     _context.SaturnReports.Add(saturnReport);
     _context.SaveChanges();
 }
コード例 #9
0
 public EntityEntry <SaturnReport> Update(SaturnReport saturnReport)
 {
     return(_context.SaturnReports.Update(saturnReport));
 }