示例#1
0
        public void Delete(int billId)
        {
            var lstDetail = _billRepository.FindById(billId);

            if (lstDetail.BillDetails != null && lstDetail.BillDetails.Count > 0)
            {
                _billDetailRepository.RemoveMultiple(lstDetail.BillDetails.ToList());
            }
            _billRepository.Remove(lstDetail);
        }
示例#2
0
        public BillViewModel DeleteBill(int id)
        {
            var bill          = _billRepository.FindById(id);
            var billViewModel = Mapper.Map <Bill, BillViewModel>(bill);

            var billDetails = _billDetailRepository.FindAll(x => x.BillId == id);

            _billDetailRepository.RemoveMultiple(billDetails.ToList());
            _billRepository.Remove(bill);

            return(billViewModel);
        }
示例#3
0
        public void UpdateStatus(int orderId, BillStatus status)
        {
            var order = _orderRepository.FindById(orderId);

            order.BillStatus = status;
            _orderRepository.Update(order);
        }
示例#4
0
 public async Task UpdateStatus(int billId, BillStatus status)
 {
     var order = await _orderRepository.FindById(billId);
     order.BillStatus = status;
     await _orderRepository.Update(order);
     _unitOfWork.Commit();
 }