public GraphWithTabularCompare<string, string> GetGraphWithVersionsCompare(Guid graphGuid, Guid applicationId,
DateTime dateStart, DateTime dateEnd)
{
GraphWithTabularCompare<string, string> graphWithVersionCompare =
new GraphWithTabularCompare<string, string>();
try
{
graphWithVersionCompare.Options = this.applicationRepository.GetVersionsByApplication(applicationId).ToList();
if (graphWithVersionCompare.Options.Count() != 0)
{
graphWithVersionCompare.Selected = graphWithVersionCompare.Options.Take(3).ToList();
graphWithVersionCompare.Consume(
this.GetGraphVersions(graphGuid, applicationId, graphWithVersionCompare.Selected, dateStart, dateEnd)
);
graphWithVersionCompare.Tabular = graphWithVersionCompare.Data.Series;
}
else
{
graphWithVersionCompare.NotEnoughData = true;
}
}
catch (DataAccessLayerException)
{
throw;
}
catch (ServiceLayerException)
{
throw;
}
catch (Exception ex)
{
throw new ServiceLayerException(ex);
}
return graphWithVersionCompare;
}