public void ProcessCurrent(XPObjectSpace objSpace) { var prevSshot = CashFlowHelper.GetPreviousSnapshot(objSpace); if (prevSshot == null) { ProcessCurrentWithoutPrev(); _LastReturnMessage = "Processed without previous snapshot is defined in XPO."; return; } var dax = new DaxClient(); string connectionString = AppConfig.SsasConnectionString; var cnn = new ADOMD.AdomdConnection(connectionString); cnn.Open(); var reader = dax.ExecuteReader(@"EVALUATE ROW ( ""Result"", CALCULATE ( COUNTROWS( CashFlow ), CashFlow[Snapshot OID] = ""{OID}"" ) )".Replace("{OID}", "{" + prevSshot.Oid + "}"), cnn); reader.Read(); var prevRowCount = reader.GetValue(0); if (prevRowCount == null) { ProcessCurrentWithPrev(); _LastReturnMessage = "Processed previous snapshot as it currently does not exist in SSAS."; } else { ProcessCurrentWithoutPrev(); _LastReturnMessage = "Did not process previous snapshot because previous snapshot already exists in SSAS."; } }
private CashFlowSnapshot GetCurrentSnapshot(Session session) { return(CashFlowHelper.GetCurrentSnapshot(session)); }