public bool ApproveOrder(int userID) { if (ValidateOrderDetail()) { _requestService.Save(_request, userID, OrderStatus.Approved); _order = null; return true; } return false; }
private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { try { _request = _requestService.FindSingle(_requestID); var stockInformation = _stockInformationRepository.GetStockInformationByOrderID(_requestID); var otherStockInformation = _forcastingRepository.GetForcastingByOrderID(_requestID); var approvedDetail = _stockInformationRepository.GetApprovedDetail(_requestID); var order = new OrderViewModel(_request, stockInformation,approvedDetail,otherStockInformation,consumptionSetting); _order = order; } catch (Exception) { _backgroundWorker.CancelAsync(); //CachingHelper.ClearCaching(); } }