WEB开发网
开发学院数据库MSSQL Server 一步一步学习sqlserver BI--应用开发 阅读

一步一步学习sqlserver BI--应用开发

 2008-11-24 10:10:34 来源:WEB开发网   
核心提示: 在业务逻辑层把CellSet组装成我们前台需要的数据集格式/** <summary>/// 填充按部门统计的数据/// </summary>/// <param name="model"></param>/// <p

在业务逻辑层把CellSet组装成我们前台需要的数据集格式

/**//// <summary>

    /// 填充按部门统计的数据
    /// </summary>
    /// <param name="model"></param>
    /// <param name="timeKey"></param>
    public void Fill(DepartmentTotalModel model, DateTime time, int timeKey)
    {
      CellSet cellSet = new DepartmentTotalDac().Count(timeKey);
  
      DepartmentTotalModel.FactGameTradeDataRow newRow;
  
      for (int i = 1; i < cellSet.Axes[1].Positions.Count; i++)
      {
        newRow = model.FactGameTradeData.NewFactGameTradeDataRow();
        newRow.Department = cellSet.Axes[1].Positions[i].Members[0].Caption;
        newRow.TradeDate = time;
  
        for (int j = 0; j < cellSet.Axes[0].Positions.Count; j++)
        {
          if (cellSet.Axes[0].Positions[j].Members[0].Name == "[Measures].[Total Orders Count]")
          {
            newRow.TotalOrders = TypeParse.ToInt32(cellSet[j, i].FormattedValue);
          }
          else if (cellSet.Axes[0].Positions[j].Members[0].Name == "[Measures].[Total Amount Count]")
          {
            newRow.TotalAmount = TypeParse.ToInt32(cellSet[j, i].FormattedValue);
          }
          else if (cellSet.Axes[0].Positions[j].Members[0].Name == "[Measures].[Total Money Count]")
          {
            newRow.TotalMoney = TypeParse.ToDecimal(cellSet[j, i].FormattedValue);
          }
          else if (cellSet.Axes[0].Positions[j].Members[0].Name == "[Measures].[Un Paid Cancel Amount Count]")
          {
            newRow.UnPaidCancelAmount = TypeParse.ToInt32(cellSet[j, i].FormattedValue);
          }
          else if (cellSet.Axes[0].Positions[j].Members[0].Name == "[Measures].[Un Paid Cancel Money Count]")
          {
            newRow.UnPaidCancelMoney = TypeParse.ToDecimal(cellSet[j, i].FormattedValue);
          }
          else if (cellSet.Axes[0].Positions[j].Members[0].Name == "[Measures].[Paid Cancel Amount Count]")
          {
            newRow.PaidCancelAmount = TypeParse.ToInt32(cellSet[j, i].FormattedValue);
          }
          else if (cellSet.Axes[0].Positions[j].Members[0].Name == "[Measures].[Paid Cancel Money Count]")
          {
            newRow.PaidCancelMoney = TypeParse.ToDecimal(cellSet[j, i].FormattedValue);
          }
        }
  
        model.FactGameTradeData.AddFactGameTradeDataRow(newRow);
      }
  
    }

上一页  1 2 3 4  下一页

Tags:学习 sqlserver BI

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接