private void DrawMapTreeDetail(TreeView iTrvMap, int iEstTermRefID, int iEstDeptRefID, int iMapVersionID, string iSelectedKey) { int cntRow = 0; int cntStg = 0; int cntKpi = 0; string strKey = ""; string strVal = ""; strKey = "D" + ";" + Convert.ToString(this.IEstDeptRefID) + ";0"; strVal = this.IEstDeptName + " 전략맵"; TreeNode topNode = new TreeNode(strVal, strKey); iTrvMap.Nodes.Clear(); iTrvMap.Nodes.Add(topNode); topNode.ImageUrl = "../images/stg/TREE_D.gif"; TreeNode vNode; MicroBSC.BSC.Biz.Biz_Bsc_View_Info objView = new MicroBSC.BSC.Biz.Biz_Bsc_View_Info(); DataSet dsView = objView.GetAllList(); TreeNode sNode; MicroBSC.BSC.Biz.Biz_Bsc_Map_Stg objSTG = new Biz_Bsc_Map_Stg(); DataSet dsSTG = new DataSet(); TreeNode kNode; MicroBSC.BSC.Biz.Biz_Bsc_Map_Kpi objKPI = new Biz_Bsc_Map_Kpi(); DataSet dsKPI = new DataSet(); cntRow = dsView.Tables[0].Rows.Count; for (int i = 0; i < cntRow; i++) { string imgWork = "<img alt='' src='../images/stg/TREE_W.gif'/>"; string imgExec = "<img alt='' src='../images/stg/TREE_E.gif'/>"; strKey = "V" + ";" + dsView.Tables[0].Rows[i]["VIEW_REF_ID"].ToString() + ";0"; strVal = dsView.Tables[0].Rows[i]["VIEW_NAME"].ToString(); vNode = new TreeNode(strVal, strKey); vNode.ImageUrl = "../images/stg/TREE_V.gif"; topNode.ChildNodes.Add(vNode); if (iSelectedKey == strKey) { vNode.Select(); vNode.ExpandAll(); vNode.SelectAction = TreeNodeSelectAction.Select; } int stgrefid = 0; int kpirefid = 0; dsSTG = objSTG.GetStrategyPerView(IEstTermRefID, IEstDeptRefID, IMapVersionID, int.Parse(dsView.Tables[0].Rows[i]["VIEW_REF_ID"].ToString())); cntStg = dsSTG.Tables[0].Rows.Count; for (int j = 0; j < cntStg; j++) { strKey = "S" + ";" + dsSTG.Tables[0].Rows[j]["STG_REF_ID"].ToString() + ";0"; stgrefid = Convert.ToInt32(dsSTG.Tables[0].Rows[j]["STG_REF_ID"].ToString()); kpirefid = 0; strVal = dsSTG.Tables[0].Rows[j]["STG_NAME"].ToString() + (WorkCount(IEstTermRefID, IEstDeptRefID, stgrefid, kpirefid) ? imgWork : "") + (ExecCount(IEstTermRefID, IEstDeptRefID, stgrefid, kpirefid) ? imgExec : ""); sNode = new TreeNode(strVal, strKey); sNode.ImageUrl = "../images/stg/TREE_S.gif"; vNode.ChildNodes.Add(sNode); if (iSelectedKey == strKey) { sNode.Select(); sNode.ExpandAll(); sNode.SelectAction = TreeNodeSelectAction.Select; } dsKPI = objKPI.GetKpiListPerStg(IEstTermRefID, IEstDeptRefID, IMapVersionID, int.Parse(dsSTG.Tables[0].Rows[j]["STG_REF_ID"].ToString())); cntKpi = dsKPI.Tables[0].Rows.Count; for (int k = 0; k < cntKpi; k++) { strKey = "K" + ";" + dsKPI.Tables[0].Rows[k]["KPI_REF_ID"].ToString() + ";" + dsSTG.Tables[0].Rows[j]["STG_REF_ID"].ToString(); kpirefid = Convert.ToInt32(dsKPI.Tables[0].Rows[k]["KPI_REF_ID"].ToString()); strVal = dsKPI.Tables[0].Rows[k]["KPI_NAME"].ToString() + (WorkCount(IEstTermRefID, IEstDeptRefID, stgrefid, kpirefid) ? imgWork : "") + (ExecCount(IEstTermRefID, IEstDeptRefID, stgrefid, kpirefid) ? imgExec : ""); kNode = new TreeNode(strVal, strKey); kNode.ImageUrl = "../images/stg/TREE_K.gif"; sNode.ChildNodes.Add(kNode); if (iSelectedKey == strKey) { kNode.Select(); kNode.ExpandAll(); kNode.SelectAction = TreeNodeSelectAction.Select; } } } } if (iTrvMap.SelectedNode == null) { topNode.Select(); } iTrvMap.ExpandAll(); }
public DataTable GetStgCaE() { // 1. 전략을 가진 부서를 조회하여 컬럼으로 늘이기 Biz_Bsc_Map_Stg objStg = new Biz_Bsc_Map_Stg(); DataSet dsDept = objStg.GetEstDeptHaveStrategy(this.IEstTermRefID, this.IEstDeptRefID, this.IYmd); DataTable dtStgMoon = new DataTable("STG_MOON_CHART"); string sDeptId = ""; string cDeptId = ""; // 부서id string cStgId = ""; // 전략id string cStgNm = ""; // 전략명 string cKpiId = ""; // 지표ID string cKpiNm = ""; // 지표명 string cTarget = ""; // 목표 string cResult = ""; // 실적 string cSignal = ""; // 시그널 string cWeight = ""; // 가중치 if (dsDept.Tables.Count > 0) { for (int i = 0; i < dsDept.Tables[0].Rows.Count; i++) { sDeptId = dsDept.Tables[0].Rows[i]["EST_DEPT_REF_ID"].ToString(); cDeptId = sPfxDeptId + sDeptId; cStgId = sPfxStgId + sDeptId; cStgNm = sPfxStgNm + sDeptId; cKpiId = sPfxKpiId + sDeptId; cKpiNm = sPfxKpiNm + sDeptId; cTarget = sPfxTarget + sDeptId; cResult = sPfxResult + sDeptId; cSignal = sPfxSignal + sDeptId; cWeight = sPfxWeight + sDeptId; dtStgMoon.Columns.Add(cStgId, typeof(string)); dtStgMoon.Columns.Add(cStgNm, typeof(string)); dtStgMoon.Columns.Add(cKpiId, typeof(string)); dtStgMoon.Columns.Add(cKpiNm, typeof(string)); dtStgMoon.Columns.Add(cTarget, typeof(string)); dtStgMoon.Columns.Add(cResult, typeof(string)); dtStgMoon.Columns.Add(cSignal, typeof(string)); dtStgMoon.Columns.Add(cWeight, typeof(string)); } } // 2. 전략관계가져오기 Biz_Bsc_Stg_Tree_Term objSTerm = new Biz_Bsc_Stg_Tree_Term(this.IEstTermRefID, this.IYmd); //Biz_Bsc_Stg_Tree objSTree = new Biz_Bsc_Stg_Tree(); //DataSet dtSTree = objSTree.GetStgTree(this.IEstTermRefID, objSTerm.IVersion_Ref_Id); // 3. 해당조직의 전략을 조회하여 나래비를 세움 Biz_Bsc_Map_Kpi objKpi = new Biz_Bsc_Map_Kpi(); if (dsDept.Tables.Count > 0) { for (int k = 0; k < dsDept.Tables[0].Rows.Count; k++) { sDeptId = dsDept.Tables[0].Rows[k]["EST_DEPT_REF_ID"].ToString(); DataSet dsStgDept = objKpi.GetKpiAnalysisPerEstDept(this.IEstTermRefID, int.Parse(sDeptId), this.IYmd, 0, "MS"); if (dsStgDept.Tables.Count > 0) { DataRow dr = null; for (int i = 0; i < dsStgDept.Tables[0].Rows.Count; i++) { dr = dtStgMoon.NewRow(); sDeptId = dsStgDept.Tables[0].Rows[i]["EST_DEPT_REF_ID"].ToString(); cDeptId = sPfxDeptId + sDeptId; cStgId = sPfxStgId + sDeptId; cStgNm = sPfxStgNm + sDeptId; cKpiId = sPfxKpiId + sDeptId; cKpiNm = sPfxKpiNm + sDeptId; cTarget = sPfxTarget + sDeptId; cResult = sPfxResult + sDeptId; cSignal = sPfxSignal + sDeptId; cWeight = sPfxWeight + sDeptId; dr[cStgId] = dsStgDept.Tables[0].Rows[i]["STG_REF_ID"].ToString(); dr[cStgNm] = dsStgDept.Tables[0].Rows[i]["STG_NAME"].ToString(); dr[cKpiId] = dsStgDept.Tables[0].Rows[i]["KPI_REF_ID"].ToString(); dr[cKpiNm] = dsStgDept.Tables[0].Rows[i]["KPI_NAME"].ToString(); dr[cTarget] = dsStgDept.Tables[0].Rows[i]["TARGET"].ToString(); dr[cResult] = dsStgDept.Tables[0].Rows[i]["RESULT"].ToString(); dr[cSignal] = dsStgDept.Tables[0].Rows[i]["THRESHOLD_IMG"].ToString(); dr[cWeight] = dsStgDept.Tables[0].Rows[i]["WEIGHT"].ToString(); dtStgMoon.Rows.Add(dr); } } if (k == 2) { break; } } } return(dtStgMoon); }