public async Task <IResult> Update(Entities.Discount discount)
        {
            var query = await _discountRepository.Update(discount);

            if (query)
            {
                return(new SuccessResult("İndirim Güncellendi"));
            }
            return(new ErrorResult("İndirim Güncellemedi"));
        }
        public async Task <IResult> Save(Entities.Discount discount)
        {
            var query = await _discountRepository.Save(discount);

            if (query)
            {
                return(new SuccessResult("İndirim Kaydedildi"));
            }
            return(new ErrorResult("İndirim Kaydedilemedi"));
        }
        public async Task <IActionResult> Update(Entities.Discount discount)
        {
            var response = await _discountService.Update(discount);

            if (response.IsSuccess)
            {
                return(Ok(response));
            }

            return(BadRequest(response));
        }
Exemplo n.º 4
0
        public long CreateDiscount(ServiceDataContracts.Discount discount)
        {
            var d = new Entities.Discount();

            d.Name = discount.Name;
            d.ToGo = discount.ToGo;
            db.Discounts.Add(d);
            db.SaveChanges();

            return(d.Id);
        }
Exemplo n.º 5
0
        public async Task <bool> Update(Entities.Discount discount)
        {
            var status = await _dbConnection.ExecuteAsync("update discount set userid=@UserId, code=@Code, rate=@Rate where id=@Id", new { Id = discount.Id, UserId = discount.UserId, Code = discount.Code, Rate = discount.Rate });

            return(status > 0);
        }
Exemplo n.º 6
0
        public async Task <bool> Save(Entities.Discount discount)
        {
            var saveStatus = await _dbConnection.ExecuteAsync("INSERT INTO discount (userid,rate,code) VALUES(@UserId,@Rate,@Code)", discount);

            return(saveStatus > 0);
        }