protected void BindGrid() { MicroBSC.BSC.Biz.Biz_Bsc_Score_Card bizScoreCard = new MicroBSC.BSC.Biz.Biz_Bsc_Score_Card(); MicroBSC.Integration.BSC.Biz.Biz_Bsc_Kpi_Score_Goal bizKpiScoreGoal = new MicroBSC.Integration.BSC.Biz.Biz_Bsc_Kpi_Score_Goal(); MicroBSC.Integration.BSC.Biz.Biz_Bsc_Kpi_Score bizKpiScore = new MicroBSC.Integration.BSC.Biz.Biz_Bsc_Kpi_Score(); DataTable dt_kpiScore = new DataTable(); DataTable dt_kpiScore_monthly_TS = new DataTable(); if (rdoGoalTong.SelectedValue.Equals("GOAL")) { dt_kpiScore = bizScoreCard.GetEstDeptKpiScoreList(ESTTERM_REF_ID, YMD, "TS", DEPT_REF_ID, false).Tables[0]; dt_kpiScore_monthly_TS = bizKpiScoreGoal.Get_Kpi_Monthly_Total_Sum(ESTTERM_REF_ID, DEPT_REF_ID); } else { dt_kpiScore = bizScoreCard.GetEstDeptKpiScoreList_Goal(ESTTERM_REF_ID, YMD, "TS", DEPT_REF_ID, false).Tables[0]; dt_kpiScore_monthly_TS = bizKpiScore.Get_Kpi_Monthly_Total_Sum(ESTTERM_REF_ID, DEPT_REF_ID); } //월별 컬럼 생성 string year = YMD.Substring(0, 4); for (int j = 1; j <= 12; j++) { string month = j.ToString().PadLeft(2, '0'); dt_kpiScore.Columns.Add(year + month); } //월별 컬럼에 값 추가 for (int i = 0; i < dt_kpiScore.Rows.Count; i++) { string kpi_ref_id = DataTypeUtility.GetString(dt_kpiScore.Rows[i]["KPI_REF_ID"]); for (int j = 1; j <= 12; j++) { string month = j.ToString().PadLeft(2, '0'); string filter = string.Format("KPI_REF_ID='{0}' AND YMD='{1}'", kpi_ref_id, year + month); DataTable dt_tmp_monthly_score = DataTypeUtility.FilterSortDataTable(dt_kpiScore_monthly_TS, filter); if (dt_tmp_monthly_score.Rows.Count > 0) { dt_kpiScore.Rows[i][year + month] = DataTypeUtility.GetString(dt_tmp_monthly_score.Rows[0]["SCORE_TS"]); } } } UltraWebGrid1.Clear(); UltraWebGrid1.DataSource = dt_kpiScore; UltraWebGrid1.DataBind(); }
/// <summary> /// 스코어카드 그리드 바인딩 /// 엑셀출력의 경우 숨겨진 그리드에 바인딩하고 출력한다(this.IPrintType == "XLS" || this.IPrintType == "PDF") /// </summary> public void SetDeptScoreCard() { MicroBSC.BSC.Biz.Biz_Bsc_Score_Card objBSC = new MicroBSC.BSC.Biz.Biz_Bsc_Score_Card(); //DataSet iDs = objBSC.GetEstDeptTotalScore( this.IEstTermRefID // , this.IYmd // , this.ISumType // , this.IEstDeptID); DataSet dsViw = new DataSet(); DataSet dsKpi = new DataSet(); DataSet dsTot = new DataSet(); if (rdoGoalTong.SelectedIndex.Equals(0)) { dsViw = objBSC.GetEstDeptKpiViewTypeList (this.IEstTermRefID , this.IYmd , this.ISumType , this.IEstDeptID , this.IExtKpiYN); dsKpi = objBSC.GetEstDeptKpiScoreList (this.IEstTermRefID , this.IYmd , this.ISumType , this.IEstDeptID , this.IExtKpiYN); dsTot = objBSC.GetEstDeptTotalScore (this.IEstTermRefID , this.IYmd , this.ISumType , this.IEstDeptID , this.IExtKpiYN); } else { dsViw = objBSC.GetEstDeptKpiViewTypeList_Goal (this.IEstTermRefID , this.IYmd , this.ISumType , this.IEstDeptID , this.IExtKpiYN); dsKpi = objBSC.GetEstDeptKpiScoreList_Goal (this.IEstTermRefID , this.IYmd , this.ISumType , this.IEstDeptID , this.IExtKpiYN); dsTot = objBSC.GetEstDeptTotalScore_Goal (this.IEstTermRefID , this.IYmd , this.ISumType , this.IEstDeptID , this.IExtKpiYN); } DataSet dsTree = new DataSet(); if (ddlMapLevel.SelectedValue == "SP") { DataSet dsStg = new DataSet(); if (rdoGoalTong.SelectedIndex.Equals(0)) { dsStg = objBSC.GetScorePerStrategy (this.IEstTermRefID , this.IYmd , this.ISumType , this.IEstDeptID , this.IExtKpiYN); } else { dsStg = objBSC.GetScorePerStrategy_Goal (this.IEstTermRefID , this.IYmd , this.ISumType , this.IEstDeptID , this.IExtKpiYN); } DataTable dtStg = dsStg.Tables[0].Copy(); DataTable dtKpi = dsKpi.Tables[0].Copy(); dsTree = dsViw.Copy(); dsTree.Tables.Add(dtStg); dsTree.Tables.Add(dtKpi); dsTree.Relations.Add("SCORE_CARD_STG", dsTree.Tables[0].Columns["VIEW_REF_ID"], dsTree.Tables[1].Columns["VIEW_REF_ID"]); dsTree.Relations.Add("SCORE_CARD_KPI", dsTree.Tables[1].Columns["STG_REF_ID"], dsTree.Tables[2].Columns["STG_REF_ID"]); } else { DataTable dtKpi = dsKpi.Tables[0].Copy(); dsTree = dsViw.Copy(); dsTree.Tables.Add(dtKpi); dsTree.Relations.Add("SCORE_CARD_KPI", dsTree.Tables[0].Columns["VIEW_REF_ID"], dsTree.Tables[1].Columns["VIEW_REF_ID"]); } if (this.IPrintType == "MONITOR") { ugrdScoreCard.Clear(); ugrdScoreCard.DataSource = dsTree.Tables[0].DefaultView; ugrdScoreCard.DataBind(); } else if (this.IPrintType == "XLS" || this.IPrintType == "PDF") { ugrdScoreCardForPrint.Clear(); ugrdScoreCardForPrint.DataSource = dsTree.Tables[0].DefaultView; ugrdScoreCardForPrint.DataBind(); } lblTotalScore.Style.Add("align", "right"); lblTotalScore.Text = (dsTot.Tables[0].Rows.Count > 0) ? double.Parse(dsTot.Tables[0].Rows[0]["POINT"].ToString()).ToString("#,##0.00") : "0"; }