public ActionResult DeleteConfirmed(long id) { CurrenciesPost currencies = _currenciesService.GetPost(id); currencies.UserName = User.Identity.Name; _currenciesService.Delete(currencies); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind("ixCurrency,sCurrency")] CurrenciesPost currencies) { if (ModelState.IsValid) { currencies.UserName = User.Identity.Name; _currenciesService.Edit(currencies); return(RedirectToAction("Index")); } return(View(currencies)); }
public ActionResult Edit(long id) { CurrenciesPost currencies = _currenciesService.GetPost(id); if (currencies == null) { return(NotFound()); } return(View(currencies)); }
public Task Delete(CurrenciesPost currenciesPost) { // Additional validations // Pre-process // Process this._currenciesRepository.RegisterDelete(currenciesPost); try { this._currenciesRepository.Commit(); } catch (Exception ex) { this._currenciesRepository.Rollback(); // Log exception throw; } // Post-process return(Task.CompletedTask); }
public Task <Int64> Create(CurrenciesPost currenciesPost) { // Additional validations // Pre-process // Process this._currenciesRepository.RegisterCreate(currenciesPost); try { this._currenciesRepository.Commit(); } catch (Exception ex) { this._currenciesRepository.Rollback(); // Log exception throw; } // Post-process return(Task.FromResult(currenciesPost.ixCurrency)); }
public void RegisterDelete(CurrenciesPost currenciesPost) { _context.CurrenciesPost.Remove(currenciesPost); }
public void RegisterEdit(CurrenciesPost currenciesPost) { _context.Entry(currenciesPost).State = EntityState.Modified; }
public void RegisterCreate(CurrenciesPost currenciesPost) { _context.CurrenciesPost.Add(currenciesPost); }