public void AddServicesToBill() { var bill = _billRepository.GetUnpaidBillByPatientId(_view.PatientId); // clear in case of update. _billRepository.ClearServicesInBill(bill); if (_temporarySelectedServices.Count > 0) { foreach (clinic_service serviceSelected in _temporarySelectedServices) { try { _billRepository.AddServiceToBill(bill.id, serviceSelected); } catch (ArgumentOutOfRangeException ex) { _view.ErrMessage = ex.Message; } } } _billRepository.CalculateTotalMoneyInBill(bill.id); }