public ActionResult DeleteConfirmed(long id) { PeoplePost people = _peopleService.GetPost(id); people.UserName = User.Identity.Name; _peopleService.Delete(people); return(RedirectToAction("Index")); }
public ActionResult Edit(long id) { PeoplePost people = _peopleService.GetPost(id); if (people == null) { return(NotFound()); } ViewBag.ixLanguage = new SelectList(_peopleService.selectLanguages().Select(x => new { x.ixLanguage, x.sLanguage }), "ixLanguage", "sLanguage", people.ixLanguage); return(View(people)); }
public ActionResult Edit([Bind("ixPerson,sPerson,sFirstName,sLastName,ixLanguage")] PeoplePost people) { if (ModelState.IsValid) { people.UserName = User.Identity.Name; _peopleService.Edit(people); return(RedirectToAction("Index")); } ViewBag.ixLanguage = new SelectList(_peopleService.selectLanguages().Select(x => new { x.ixLanguage, x.sLanguage }), "ixLanguage", "sLanguage", people.ixLanguage); return(View(people)); }
public Task Delete(PeoplePost peoplePost) { // Additional validations // Pre-process // Process this._peopleRepository.RegisterDelete(peoplePost); try { this._peopleRepository.Commit(); } catch (Exception ex) { this._peopleRepository.Rollback(); // Log exception throw; } // Post-process return(Task.CompletedTask); }
public Task <Int64> Create(PeoplePost peoplePost) { // Additional validations // Pre-process // Process this._peopleRepository.RegisterCreate(peoplePost); try { this._peopleRepository.Commit(); } catch (Exception ex) { this._peopleRepository.Rollback(); // Log exception throw; } // Post-process return(Task.FromResult(peoplePost.ixPerson)); }
public void RegisterDelete(PeoplePost peoplePost) { _context.PeoplePost.Remove(peoplePost); }
public void RegisterEdit(PeoplePost peoplePost) { _context.Entry(peoplePost).State = EntityState.Modified; }
public void RegisterCreate(PeoplePost peoplePost) { _context.PeoplePost.Add(peoplePost); }