/// <summary> /// 전략버젼 적용기간 선택 /// </summary> public void SetStgTerm() { if (ddlStgTreeVersion.SelectedValue != null) { txtVERSION_NAME.Text = PageUtility.GetByTextDropDownList(ddlStgTreeVersion); this.IType = "U"; this.SetButton(); } else { txtVERSION_NAME.Text = ""; ugrdTerm.Clear(); return; } MicroBSC.BSC.Biz.Biz_Bsc_Stg_Tree_Term objBSC = new MicroBSC.BSC.Biz.Biz_Bsc_Stg_Tree_Term(); DataSet rDs = objBSC.GetAllList(this.IEstTermRefID , this.IVersionRefID); ugrdTerm.Clear(); if (rDs.Tables.Count > 0) { ugrdTerm.DataSource = rDs.Tables[0].DefaultView; ugrdTerm.DataBind(); } }
/// <summary> /// 전략버젼 적용기간 데이터 추출 /// </summary> /// <returns></returns> public DataTable GetStgVersionData() { MicroBSC.BSC.Biz.Biz_Bsc_Stg_Tree_Term objTrm = new MicroBSC.BSC.Biz.Biz_Bsc_Stg_Tree_Term(); DataTable dtTerm = objTrm.GetSchemaStgTreeTerm(); DataRow drTerm = null; CheckBox chkAPPLY; TemplatedColumn colAPPLY = (TemplatedColumn)ugrdTerm.Columns.FromKey("APPLY_YN"); int iRow = ugrdTerm.Rows.Count; for (int i = 0; i < iRow; i++) { chkAPPLY = (CheckBox)((CellItem)colAPPLY.CellItems[ugrdTerm.Rows[i].BandIndex]).FindControl("chkCheckTerm"); if (chkAPPLY.Checked) { drTerm = dtTerm.NewRow(); drTerm["ESTTERM_REF_ID"] = ugrdTerm.Rows[i].Cells.FromKey("ESTTERM_REF_ID").Value; drTerm["VERSION_REF_ID"] = ugrdTerm.Rows[i].Cells.FromKey("VERSION_REF_ID").Value; drTerm["YMD"] = ugrdTerm.Rows[i].Cells.FromKey("YMD").Value; dtTerm.Rows.Add(drTerm); } } return(dtTerm); }
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); }