一步一步学习sqlserver BI--应用开发
2008-11-24 10:10:34 来源:WEB开发网在业务逻辑层把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);
}
}
- ››sqlserver安装和简单的使用
- ››SqlServer触发器、存储过程和函数
- ››SQLServer建立交叉表查询
- ››SqlServer强制断开数据库连接的方法
- ››SQLServer 2005 海量数据解决方案
- ››SQLServer 2008数据库查看死锁、堵塞的SQL语句
- ››SqlServer 插入多条数据
- ››SQLServer 2008 R2导出的SQL文件中没有数据
- ››SQLSERVER通过游标查询两个数据表共有字段名组合成...
- ››sqlserver2008实现拼音首字母和随机n位数的生成
- ››SQLServer与Java数据类型对应表
- ››Bing地图得到诺基亚助力
更多精彩
赞助商链接