Example #1
0
        public ActionResult DeleteConfirmed(long id)
        {
            PlanetarySystemsPost planetarysystems = _planetarysystemsService.GetPost(id);

            planetarysystems.UserName = User.Identity.Name;
            _planetarysystemsService.Delete(planetarysystems);
            return(RedirectToAction("Index"));
        }
Example #2
0
        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));
        }
Example #3
0
        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));
        }
Example #4
0
        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);
        }
Example #5
0
        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));
        }
Example #6
0
 public void RegisterDelete(PlanetarySystemsPost planetarysystemsPost)
 {
     _context.PlanetarySystemsPost.Remove(planetarysystemsPost);
 }
Example #7
0
 public void RegisterEdit(PlanetarySystemsPost planetarysystemsPost)
 {
     _context.Entry(planetarysystemsPost).State = EntityState.Modified;
 }
Example #8
0
 public void RegisterCreate(PlanetarySystemsPost planetarysystemsPost)
 {
     _context.PlanetarySystemsPost.Add(planetarysystemsPost);
 }