private List<KpiView> GetKpisList()
 {
     var result = new List<KpiView>();
     foreach (var view in m_KpiStorage)
     {
         var row = new KpiView();
         if (view.Value != null)
         {
             row.Caption = view.Value.Caption;
             row.KpiGoal = view.Value.KpiGoal;
             row.KpiValue = view.Value.KpiValue;
             //row.KpiValue = view.Value.KpiValue;
             row.KpiTrend = view.Value.KpiTrend;
             row.KpiStatus = view.Value.KpiStatus;
             //row.DisplayFolder = view.Value.DisplayFolder;
             row.KpiVariance = view.Value.KpiVariance;
             //row.KpiVariance = view.Value.KpiVariance;                    
         }
         var x = from kpi in m_SourceKpis
                 where kpi.Caption.Equals(view.Key)
                 select kpi;
         if (x.First() != null)
         {
             row.DisplayFolder = x.First().DisplayFolder;
             row.StatusGraphic = x.First().StatusGraphic+"_"+row.KpiStatus+".png";
             row.TrendGraphic = x.First().TrendGraphic+"_"+row.KpiTrend+".png";
         }
         result.Add(row);
     }
     return result;
 }
        private void AddKpiRowToStorage(CellSetData cs_descr)
        {
            if (cs_descr.Axes.Count > 0)
            {
                if (cs_descr.Cells.Count > 1 && cs_descr.Cells[0].Value != null &&
                    !m_KpiStorage.ContainsKey(cs_descr.Cells[0].Value.Value.ToString()))
                {
                    var row = new KpiView();
                    string key = cs_descr.Cells[0].Value.Value.ToString();
                    row.Caption = key;
                    double num;
                    row.KpiValue = cs_descr.Cells.Count > 1 && double.TryParse(cs_descr.Cells[1].Value.Value.ToString(), out num) ? num : double.NaN;
                    double num1;
                    row.KpiGoal = cs_descr.Cells.Count > 2 && double.TryParse(cs_descr.Cells[2].Value.Value.ToString(), out num1) ? num1 : double.NaN;
                    double num2;
                    row.KpiVariance = cs_descr.Cells.Count > 3 && double.TryParse(cs_descr.Cells[3].Value.Value.ToString(), out num2) ? num2 : double.NaN;                    
                    row.KpiStatus = cs_descr.Cells.Count > 4 ? cs_descr.Cells[4].Value.Value.ToString() : String.Empty;
                    row.KpiTrend = cs_descr.Cells.Count > 5 ? cs_descr.Cells[5].Value.Value.ToString() : String.Empty;
                    row.KpiWeight = cs_descr.Cells.Count > 6 ? cs_descr.Cells[6].Value.Value.ToString() : String.Empty;
                    m_KpiStorage.Add(key, row);
                }
            }
            if (this.RowIndex > -1)
            {
                this.RowIndex = this.ExecuteQueryForRow(++this.RowIndex);
            }            

        }
 private KpiView GetKpiViewItem(KpiView kpiView, KpiInfo info)
 {
     var row = new KpiView();
     if (kpiView != null)
     {
         row.Caption = kpiView.Caption;
         row.KpiGoal = kpiView.KpiGoal;
         row.KpiValue = kpiView.KpiValue;
         //row.KpiValue = view.Value.KpiValue;
         row.KpiTrend = kpiView.KpiTrend;
         row.KpiStatus = kpiView.KpiStatus;
         //row.DisplayFolder = view.Value.DisplayFolder;
         row.KpiVariance = kpiView.KpiVariance;
         //row.KpiVariance = view.Value.KpiVariance;                                
         row.DisplayFolder = info.DisplayFolder;
         row.StatusGraphic = info.StatusGraphic + "_" + row.KpiStatus + ".png";
         row.TrendGraphic = info.TrendGraphic + "_" + row.KpiTrend + ".png";
     }
     return row;
 }