public int TrxVersionAndTerm(string iType, int iestterm_ref_id, int iversion_ref_id, string iversion_name, int itxr_user, DataTable dtVerTerm) { int iAffRow = 0; int iRow = 0; IDbConnection con = DbAgentHelper.CreateDbConnection(); con.Open(); IDbTransaction trx = con.BeginTransaction(); try { if (iType == "A") { iAffRow = this.InsertData(con, trx, iestterm_ref_id, iversion_ref_id, iversion_name, itxr_user); } else if (iType == "U") { iAffRow = this.UpdateData(con, trx, iestterm_ref_id, iversion_ref_id, iversion_name, itxr_user); } else if (iType == "D") { iAffRow = this.DeleteData(con, trx, iestterm_ref_id, iversion_ref_id, itxr_user); Biz_Bsc_Stg_Tree objSTree = new Biz_Bsc_Stg_Tree(); Biz_Bsc_Stg_Tree_Term objSTerm = new Biz_Bsc_Stg_Tree_Term(); iAffRow = objSTree.DeleteData(con, trx, iestterm_ref_id, iversion_ref_id, itxr_user); iAffRow = objSTerm.DeleteData(con, trx, iestterm_ref_id, iversion_ref_id, itxr_user); } if (iType == "A" || iType == "U") { iRow = dtVerTerm.Rows.Count; if (base.Transaction_Result == "Y") { Biz_Bsc_Stg_Tree_Term objTerm = new Biz_Bsc_Stg_Tree_Term(); for (int i = 0; i < iRow; i++) { objTerm.IEstterm_Ref_Id = base.IEstterm_Ref_Id; objTerm.IVersion_Ref_Id = base.IVersion_Ref_Id; objTerm.IYmd = dtVerTerm.Rows[i]["YMD"].ToString(); iAffRow += objTerm.UpdateData(con, trx, objTerm.IEstterm_Ref_Id, objTerm.IVersion_Ref_Id, objTerm.IYmd, itxr_user); } } } trx.Commit(); } catch (Exception e) { base.Transaction_Message = e.Message; base.Transaction_Result = "N"; trx.Rollback(); } finally { con.Close(); } return(iAffRow); }
/// <summary> /// 전략트리 설정 /// </summary> public void SetStgTree(TreeView iTreeView) { iTreeView.Nodes.Clear(); MicroBSC.BSC.Biz.Biz_Bsc_Stg_Tree objTree = new MicroBSC.BSC.Biz.Biz_Bsc_Stg_Tree(); DataTable rDt = objTree.GetStgTree(this.IEstTermRefID, this.IVersionRefID); TreeNode tnRoot = new TreeNode(PageUtility.GetByTextDropDownList(ddlStgTreeVersion), "0"); iTreeView.Nodes.Add(tnRoot); tnRoot.Checked = true; //tnRoot.SelectAction = TreeNodeSelectAction.Expand; for (int i = 0; i < rDt.Rows.Count; i++) { string sID = rDt.Rows[i]["IDX"].ToString(); string sNM = rDt.Rows[i]["STG_NAME"].ToString(); string sPT = rDt.Rows[i]["PARENT_IDX"].ToString(); foreach (TreeNode tnC in iTreeView.CheckedNodes) { if (tnC.Value == sPT) { TreeNode tnNode = new TreeNode(sNM, sID); tnC.ChildNodes.Add(tnNode); tnNode.Checked = true; if (this.IIdx.ToString() == sID) { tnNode.Select(); } break; } } } if (trvStg.SelectedNode != null && trvStg.SelectedNode.Parent != null) { this.IIdx = decimal.Parse(trvStg.SelectedNode.Value); this.IIdxParent = decimal.Parse(trvStg.SelectedNode.Value); txtSelStg.Text = trvStg.SelectedNode.Text; txtSelStgParent.Text = trvStg.SelectedNode.Parent.Text; trvStg.ExpandAll(); } else { this.SetInitStgForm(); } }
/// <summary> /// 전략풀 그리드 조회 /// </summary> protected void SetStgGrid() { if (TypeUtility.GetNumString(PageUtility.GetByValueDropDownList(ddlEstTermInfo)) == "") { PageUtility.AlertMessage("평가기간을 알 수 없습니다!"); return; } MicroBSC.BSC.Biz.Biz_Bsc_Stg_Tree objBSC = new MicroBSC.BSC.Biz.Biz_Bsc_Stg_Tree(); objBSC.IEstterm_Ref_Id = this.IEstTermRefID; objBSC.IVersion_Ref_Id = this.IVersionRefID; //DataSet rDs = objBSC.GetAllList(objBSC.Iestterm_ref_id, objBSC.Istg_code, objBSC.Istg_name, objBSC.Iuse_yn); DataSet rDs = objBSC.GetUsedStgCount(objBSC.IEstterm_Ref_Id, objBSC.IVersion_Ref_Id); ugrdStgList.Clear(); if (rDs.Tables.Count > 0) { ugrdStgList.DataSource = rDs; ugrdStgList.DataBind(); } }
public void SetStgTreeInfo() { MicroBSC.BSC.Biz.Biz_Bsc_Stg_Tree objTree = new MicroBSC.BSC.Biz.Biz_Bsc_Stg_Tree(this.IIdx); txtSORT_ORDER.Text = objTree.ISort_Order.ToString(); }
/// <summary> /// 전략트리 데이터 입출력 /// </summary> public bool TrxStgTreeData(bool isChild) { if (!ValidateStgData()) { return(false); } this.SetParam(); MicroBSC.BSC.Biz.Biz_Bsc_Stg_Tree objStg = new MicroBSC.BSC.Biz.Biz_Bsc_Stg_Tree(); objStg.IEstterm_Ref_Id = this.IEstTermRefID; objStg.IVersion_Ref_Id = this.IVersionRefID; objStg.IIdx = this.IIdx; objStg.IParent_Idx = (isChild) ? this.IIdx : this.IIdxParent; objStg.IStg_Ref_Id = (this.ITypeTree == "U" || this.ITypeTree == "D") ? 0 : int.Parse(hdfStgPoolId.Value); objStg.ISort_Order = int.Parse(txtSORT_ORDER.Text); objStg.ICreate_User = gUserInfo.Emp_Ref_ID; if (this.ITypeTree == "A") { int iRtn = objStg.InsertData(null , null , this.IEstTermRefID , this.IVersionRefID , objStg.IStg_Ref_Id , objStg.IParent_Idx , objStg.ISort_Order , objStg.ICreate_User); ltrScript.Text = JSHelper.GetAlertScript(objStg.Transaction_Message, false); if (objStg.Transaction_Result == "Y") { this.IIdx = objStg.IIdx; return(true); } } else if (this.ITypeTree == "U") { int iRtn = objStg.UpdateData(null , null , this.IIdx , this.IEstTermRefID , this.IVersionRefID , objStg.IStg_Ref_Id , objStg.IParent_Idx , objStg.ISort_Order , objStg.ICreate_User); ltrScript.Text = JSHelper.GetAlertScript(objStg.Transaction_Message, false); if (objStg.Transaction_Result == "Y") { return(true); } } else if (this.ITypeTree == "D") { decimal[] arrIdx = new decimal[1]; TreeNode tn = trvStg.SelectedNode; int iLoop = 1; //자신 if (tn != null) { arrIdx[0] = decimal.Parse(tn.Value); } //자식 //foreach (TreeNode trn in tn.ChildNodes) //{ // decimal dTmp = decimal.Parse(trn.Value); // if (dTmp > 0) // { // iLoop++; // Array.Resize(ref arrIdx, iLoop); // arrIdx[iLoop - 1] = dTmp; // } //} //상위부모 다 삭제 //while (tn != null) //{ // decimal dTmp = decimal.Parse(tn.Value); // if (dTmp > 0) // { // Array.Resize(ref arrIdx, iLoop); // arrIdx[iLoop - 1] = dTmp; // iLoop++; // } // tn = tn.Parent; //} int iRtn = objStg.DeleteMultiNode(arrIdx, objStg.ICreate_User); ltrScript.Text = JSHelper.GetAlertScript(objStg.Transaction_Message, false); if (objStg.Transaction_Result == "Y") { return(true); } } return(false); }