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); }
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); }
public void UpdateStatus(int orderId, BillStatus status) { var order = _orderRepository.FindById(orderId); order.BillStatus = status; _orderRepository.Update(order); }
public async Task UpdateStatus(int billId, BillStatus status) { var order = await _orderRepository.FindById(billId); order.BillStatus = status; await _orderRepository.Update(order); _unitOfWork.Commit(); }