public void UpdateDrink(DrinkDto drinkDto) { var drink = drinkRepository.GetBy(drinkDto.Id); drinkDto.MappingDrink(drink); drinkRepository.Update(drink); }
public decimal GetTotal(int billId) { var bills = billDetailRepository.GetsByBillId(billId); decimal total = 0; decimal price; foreach (var b in bills) { price = drinkRepository.GetBy(b.DrinkId).Price; total += b.Quantity * price; } return(total); }