public ActionResult DeleteConfirmed(long id) { PlanetarySystemsPost planetarysystems = _planetarysystemsService.GetPost(id); planetarysystems.UserName = User.Identity.Name; _planetarysystemsService.Delete(planetarysystems); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind("ixPlanetarySystem,sPlanetarySystem,ixGalaxy")] PlanetarySystemsPost planetarysystems) { if (ModelState.IsValid) { planetarysystems.UserName = User.Identity.Name; _planetarysystemsService.Edit(planetarysystems); return(RedirectToAction("Index")); } ViewBag.ixGalaxy = new SelectList(_planetarysystemsService.selectGalaxies().Select(x => new { x.ixGalaxy, x.sGalaxy }), "ixGalaxy", "sGalaxy", planetarysystems.ixGalaxy); return(View(planetarysystems)); }
public ActionResult Edit(long id) { PlanetarySystemsPost planetarysystems = _planetarysystemsService.GetPost(id); if (planetarysystems == null) { return(NotFound()); } ViewBag.ixGalaxy = new SelectList(_planetarysystemsService.selectGalaxies().Select(x => new { x.ixGalaxy, x.sGalaxy }), "ixGalaxy", "sGalaxy", planetarysystems.ixGalaxy); return(View(planetarysystems)); }
public Task Delete(PlanetarySystemsPost planetarysystemsPost) { // Additional validations // Pre-process // Process this._planetarysystemsRepository.RegisterDelete(planetarysystemsPost); try { this._planetarysystemsRepository.Commit(); } catch (Exception ex) { this._planetarysystemsRepository.Rollback(); // Log exception throw; } // Post-process return(Task.CompletedTask); }
public Task <Int64> Create(PlanetarySystemsPost planetarysystemsPost) { // Additional validations // Pre-process // Process this._planetarysystemsRepository.RegisterCreate(planetarysystemsPost); try { this._planetarysystemsRepository.Commit(); } catch (Exception ex) { this._planetarysystemsRepository.Rollback(); // Log exception throw; } // Post-process return(Task.FromResult(planetarysystemsPost.ixPlanetarySystem)); }
public void RegisterDelete(PlanetarySystemsPost planetarysystemsPost) { _context.PlanetarySystemsPost.Remove(planetarysystemsPost); }
public void RegisterEdit(PlanetarySystemsPost planetarysystemsPost) { _context.Entry(planetarysystemsPost).State = EntityState.Modified; }
public void RegisterCreate(PlanetarySystemsPost planetarysystemsPost) { _context.PlanetarySystemsPost.Add(planetarysystemsPost); }