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));
        }
예제 #6
0
 public void RegisterDelete(CurrenciesPost currenciesPost)
 {
     _context.CurrenciesPost.Remove(currenciesPost);
 }
예제 #7
0
 public void RegisterEdit(CurrenciesPost currenciesPost)
 {
     _context.Entry(currenciesPost).State = EntityState.Modified;
 }
예제 #8
0
 public void RegisterCreate(CurrenciesPost currenciesPost)
 {
     _context.CurrenciesPost.Add(currenciesPost);
 }