public ActionResult DeleteConfirmed(long id) { PlanetSubRegionsPost planetsubregions = _planetsubregionsService.GetPost(id); planetsubregions.UserName = User.Identity.Name; _planetsubregionsService.Delete(planetsubregions); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind("ixPlanetSubRegion,sPlanetSubRegion,ixPlanetRegion")] PlanetSubRegionsPost planetsubregions) { if (ModelState.IsValid) { planetsubregions.UserName = User.Identity.Name; _planetsubregionsService.Edit(planetsubregions); return(RedirectToAction("Index")); } ViewBag.ixPlanetRegion = new SelectList(_planetsubregionsService.selectPlanetRegions().Select(x => new { x.ixPlanetRegion, x.sPlanetRegion }), "ixPlanetRegion", "sPlanetRegion", planetsubregions.ixPlanetRegion); return(View(planetsubregions)); }
public ActionResult Edit(long id) { PlanetSubRegionsPost planetsubregions = _planetsubregionsService.GetPost(id); if (planetsubregions == null) { return(NotFound()); } ViewBag.ixPlanetRegion = new SelectList(_planetsubregionsService.selectPlanetRegions().Select(x => new { x.ixPlanetRegion, x.sPlanetRegion }), "ixPlanetRegion", "sPlanetRegion", planetsubregions.ixPlanetRegion); return(View(planetsubregions)); }
public Task Delete(PlanetSubRegionsPost planetsubregionsPost) { // Additional validations // Pre-process // Process this._planetsubregionsRepository.RegisterDelete(planetsubregionsPost); try { this._planetsubregionsRepository.Commit(); } catch (Exception ex) { this._planetsubregionsRepository.Rollback(); // Log exception throw; } // Post-process return(Task.CompletedTask); }
public Task <Int64> Create(PlanetSubRegionsPost planetsubregionsPost) { // Additional validations // Pre-process // Process this._planetsubregionsRepository.RegisterCreate(planetsubregionsPost); try { this._planetsubregionsRepository.Commit(); } catch (Exception ex) { this._planetsubregionsRepository.Rollback(); // Log exception throw; } // Post-process return(Task.FromResult(planetsubregionsPost.ixPlanetSubRegion)); }
public void RegisterDelete(PlanetSubRegionsPost planetsubregionsPost) { _context.PlanetSubRegionsPost.Remove(planetsubregionsPost); }
public void RegisterEdit(PlanetSubRegionsPost planetsubregionsPost) { _context.Entry(planetsubregionsPost).State = EntityState.Modified; }
public void RegisterCreate(PlanetSubRegionsPost planetsubregionsPost) { _context.PlanetSubRegionsPost.Add(planetsubregionsPost); }