Пример #1
0
        public async Task <bool> Delete(Currency contract)
        {
            var entity = ContractToEntity(contract);
            var result = await _currencyRepo.Delete(entity);

            return(result);
        }
        public IHttpActionResult Delete([FromODataUri] System.Guid key)
        {
            logger.Trace("Call CurrencyController Delete");

            CurrencyRepository.Delete(key);
            return(Ok());
        }
Пример #3
0
        public IActionResult Delete(Guid id)
        {
            var currency = currencyRepository.Get(id);

            currencyRepository.Delete(currency);
            return(Ok());
        }
Пример #4
0
        public ActionResult Delete(CurrencyDTO currency)
        {
            Currency c = currencyRepository.GetById(currency.CurrencyID);

            currencyRepository.Delete(c);
            currencyRepository.Save();
            return(Json(currency, JsonRequestBehavior.DenyGet));
        }
Пример #5
0
        public async Task <IActionResult> Delete(int id)
        {
            await currencyRepository.Delete(id);

            await unitOfWork.SaveEntitiesAsync();

            return(Ok());
        }
Пример #6
0
        public void Execute(DeleteCurrencyCommand command)
        {
            var deleted = _currencyRepository.Delete(command.Id);

            if (!deleted)
            {
                throw new CurrencyNotFoundException();
            }
        }
Пример #7
0
        public void Delete_Test()
        {
            var entityList     = _repo.Get().Result;
            var entityToDelete = entityList.FirstOrDefault();

            var delete = _repo.Delete(entityToDelete).Result;

            var entityFetch = _repo.GetOne(entityToDelete.Id).Result;

            Assert.Null(entityFetch);
        }
Пример #8
0
 //CRUD
 public override ProcessResult Delete(int id)
 {
     try
     {
         _repository.Delete(id);
         return(ServiceResultsHelper.FillProcessResult(null));
     }
     catch (Exception ex)
     {
         return(ServiceResultsHelper.FillProcessResultForError(ex));
     }
 }
Пример #9
0
 public Task <bool> Delete(long id)
 {
     try
     {
         _currencyRepo.Delete(id);
         _currencyRepo.SaveChanges();
         var itemDeleted = _currencyRepo.GetByID(id) == null;
         return(Task.FromResult(itemDeleted));
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #10
0
        /// <summary>
        /// Gets currency live rates
        /// </summary>
        /// <param name="exchangeRateCurrencyCode">Exchange rate currency code</param>
        /// <returns>Exchange rates</returns>
        //public virtual IList<ExchangeRate> GetCurrencyLiveRates(string exchangeRateCurrencyCode)
        //{
        //    var exchangeRateProvider = LoadActiveExchangeRateProvider();
        //    if (exchangeRateProvider == null)
        //        throw new Exception("Active exchange rate provider cannot be loaded");
        //    return exchangeRateProvider.GetCurrencyLiveRates(exchangeRateCurrencyCode);
        //}

        /// <summary>
        /// Deletes currency
        /// </summary>
        /// <param name="currency">Currency</param>
        public virtual void DeleteCurrency(Currency currency)
        {
            if (currency == null)
            {
                throw new ArgumentNullException("currency");
            }

            _currencyRepository.Delete(currency);

            _cacheManager.GetCache(CACHE_NAME_CURRENCY).Clear();

            //event notification
            //_eventPublisher.EntityDeleted(currency);
        }
        public ActionResult <CurrencyReadDto> Delete(int id)
        {
            Currency currency = _currencyRepository.Get(id);

            if (currency == null)
            {
                return(BadRequest("Currency with that id doesn't exit"));
            }

            _currencyRepository.Delete(currency);

            _logger.Log("Delete Currency");

            return(Ok());
        }
Пример #12
0
        public IActionResult Delete(int Id)
        {
            CommonResponse <int> response = new CommonResponse <int>();
            var result = _currencyRepository.Delete(Id, this.loginUserId);

            if (result == 0)
            {
                response.status  = Helper.failure_code;
                response.message = Message.currencyDeletedError;
            }
            else if (result == Helper.refernce_error_code)
            {
                response.message = Message.referenceError;
            }
            else
            {
                response.status  = Helper.success_code;
                response.message = Message.currencyDeleted;
            }
            return(Ok(response));
        }
Пример #13
0
 public IActionResult Delete(int id)
 {
     _currencyRepository.Delete(id);
     return(RedirectToAction("Index", "Currency"));
 }
Пример #14
0
 public void Delete(int Id)
 {
     _repository.Delete(Id);
 }
Пример #15
0
 public async Task Delete(string code)
 {
     await _currencyRepository.Delete(code);
 }
Пример #16
0
        public void DeleteCurrency(int id)
        {
            var currency = _currencyRepository.GetById(id);

            _currencyRepository.Delete(currency);
        }
 public void DeleteCurrency(int id)
 {
     _currencyRepository.Delete(id);
 }
Пример #18
0
 public async Task <bool> DeleteCurrency(int id)
 {
     return(await _currencyRepository.Delete(id));
 }
        public void Delete(int id)
        {
            var currency = Get(id);

            _currencyRepository.Delete(currency);
        }
Пример #20
0
 public void Delete(Currency entity, User user)
 {
     CheckPossibilityToDelete(entity, user);
     entity.DeletionDate = DateTime.Now;
     currencyRepository.Delete(entity);
 }