private void AddConversionCount(FullPipelineRow currentStageData, string attributeName) { if (currentStageData != null) { currentStageData.CalculatedProperties[attributeName] = currentStageData.OverallCount; } }
private FullPipelineRow GetFullPipelineRow(IDataReader reader, FullPipelineEntityConfig config) { var pipelineRow = new FullPipelineRow { StageId = reader.GetColumnValue <Guid>("StageId"), CountInStage = reader.GetColumnValue <decimal>(FullPipelineQueryConsts.CurrentInStageCountColumnName), OverallCount = reader.GetColumnValue <decimal>(FullPipelineQueryConsts.OverallStageCountColumnName) }; var calcProperties = GetCalculatedProperties(reader, config); pipelineRow.CalculatedProperties = calcProperties; return(pipelineRow); }
private decimal GetConversion(FullPipelineRow currentStage, FullPipelineRow baseStage) { if (currentStage == null) { return(0m); } if (baseStage == null || baseStage.OverallCount == 0) { return(currentStage.OverallCount == 0m ? 0m : _baseStageConversion); } return((currentStage.OverallCount / baseStage.OverallCount) * 100); }
private void AddCalculatedProperties(List <FullPipelineStageDataElement> elements, FullPipelineRow data) { if (data == null) { return; } data.CalculatedProperties.ForEach(keyValue => elements.Add(new FullPipelineStageDataElement { Name = keyValue.Key, Value = keyValue.Value })); }