protected override void ExecuteStep() { if (CashRequestID.HasValue()) { Find(); } else { Create(); } if (CashRequestID.LacksValue() || NLCashRequestID.LacksValue()) { throw new CreateFindCashRequestException( "No cash request to update (neither specified nor created) for {0}.", OuterContextDescription ); } // if } // ExecuteStep
} // AddOpportunity private void Find() { try { this.transaction = DB.GetPersistentTransaction(); DB.ExecuteNonQuery( this.transaction, "MainStrategySetCustomerIsBeingProcessed", CommandSpecies.StoredProcedure, new QueryParameter("@CustomerID", this.customerID) ); NLCashRequestID = DB.ExecuteScalar <long>( this.transaction, "NL_CashRequestGetByOldID", CommandSpecies.StoredProcedure, new QueryParameter("@OldCashRequestID", CashRequestID) ); if (NLCashRequestID.LacksValue()) { NLCashRequestAdd(); } this.transaction.Commit(); } catch (Exception e) { if (this.transaction != null) { this.transaction.Rollback(); } Log.Alert(e, "Failed to find cash request."); CashRequestID = 0; NLCashRequestID = 0; } // try } // Find