public int InsertData(int iestterm_ref_id, int iversion_ref_id, string iversion_name, int itxr_user) { IDbConnection con = DbAgentHelper.CreateDbConnection(); con.Open(); IDbTransaction trx = con.BeginTransaction(); return(this.InsertData(con, trx, iestterm_ref_id, iversion_ref_id, iversion_name, itxr_user)); }
public bool UpdateQuestionDeptMap(DataTable dataTable , int comp_id , int estterm_ref_id , int estterm_sub_id , string est_id , string q_obj_id) { int affectedRow = 0; IDbConnection conn = DbAgentHelper.CreateDbConnection(); conn.Open(); IDbTransaction trx = conn.BeginTransaction(); try { affectedRow = _questionDeptEmpMap.Delete(conn , trx , comp_id , estterm_ref_id , estterm_sub_id , est_id , q_obj_id , 0 , 0); foreach (DataRow dataRow in dataTable.Rows) { affectedRow += _questionDeptEmpMap.Insert(conn , trx , DataTypeUtility.GetToInt32(dataRow["COMP_ID"]) , DataTypeUtility.GetToInt32(dataRow["ESTTERM_REF_ID"]) , DataTypeUtility.GetToInt32(dataRow["ESTTERM_SUB_ID"]) , DataTypeUtility.GetToInt32(dataRow["ESTTERM_STEP_ID"]) , dataRow["EST_ID"].ToString() , dataRow["Q_OBJ_ID"].ToString() , DataTypeUtility.GetToInt32(dataRow["TGT_DEPT_ID"]) , DataTypeUtility.GetToInt32(dataRow["TGT_EMP_ID"]) , DataTypeUtility.GetToDateTime(dataRow["DATE"]) , DataTypeUtility.GetToInt32(dataRow["USER"])); } trx.Commit(); } catch (Exception ex) { trx.Rollback(); return(false); } finally { conn.Close(); } return((affectedRow > 0) ? true : false); }
public int InsertAllData(DataTable dtScore, int itxr_user) { IDbConnection conn = DbAgentHelper.CreateDbConnection(); conn.Open(); IDbTransaction trx = conn.BeginTransaction(); int iRtn = 0; try { for (int i = 0; i < dtScore.Rows.Count; i++) { base.IEstterm_Ref_Id = int.Parse(dtScore.Rows[i]["ESTTERM_REF_ID"].ToString()); base.IYmd = dtScore.Rows[i]["YMD"].ToString(); base.IKpi_Ref_Id = int.Parse(dtScore.Rows[i]["KPI_REF_ID"].ToString()); base.IWeight_Inr = decimal.Parse(dtScore.Rows[i]["WEIGHT_INR"].ToString()); base.IWeight_Ext = decimal.Parse(dtScore.Rows[i]["WEIGHT_EXT"].ToString()); base.ITarget_Ext = decimal.Parse(dtScore.Rows[i]["TARGET_EXT"].ToString()); base.IResult_Ext = decimal.Parse(dtScore.Rows[i]["RESULT_EXT"].ToString()); base.IPoints_Ext = decimal.Parse(dtScore.Rows[i]["POINTS_EXT"].ToString()); base.IGrade_Ext = dtScore.Rows[i]["GRADE_EXT"].ToString(); base.IOpinion_Ext = dtScore.Rows[i]["OPINION_EXT"].ToString(); iRtn += base.UpdateData_Dac (conn, trx , this.IEstterm_Ref_Id , this.IYmd , this.IKpi_Ref_Id , this.IWeight_Inr , this.IWeight_Ext , this.ITarget_Ext , this.IResult_Ext , this.IPoints_Ext , this.IGrade_Ext , this.IOpinion_Ext , "", "", "Y" , itxr_user); base.Transaction_Message = "정상적으로 처리되었습니다."; } trx.Commit(); } catch (Exception e) { base.Transaction_Message = e.Message; trx.Rollback(); return(0); } finally { conn.Close(); } return(iRtn); }
public bool RemoveRelGroupInfo(int comp_id, string rel_grp_id) { int affectedRow = 0; IDbConnection conn = DbAgentHelper.CreateDbConnection(); conn.Open(); IDbTransaction trx = conn.BeginTransaction(); try { affectedRow = _relGroupInfo.Delete(conn , trx , comp_id , rel_grp_id); Dac_RelGroupDepts dacDept = new Dac_RelGroupDepts(); dacDept.Delete(conn , trx , comp_id , rel_grp_id , 0 , "" , 0); Dac_RelGroupPositionInfos dacInfos = new Dac_RelGroupPositionInfos(); dacInfos.Delete(conn , trx , comp_id , "" , rel_grp_id); Dac_RelGroupPositionDatas dacDatas = new Dac_RelGroupPositionDatas(); dacDatas.Delete(conn , trx , comp_id , "" , rel_grp_id); trx.Commit(); } catch (Exception ex) { trx.Rollback(); return(false); } finally { conn.Close(); } return((affectedRow > 0) ? true : false); }
public float GetAHPEstDeptStgSumPoint(int ver_id , int estterm_ref_id , int est_dept_ref_id , int target_stg_ref_id) { float sum_point = 0; Biz_PDTAndAHPStgEstDeptDatas pdtAhpEstDept = new Biz_PDTAndAHPStgEstDeptDatas(); DataSet ds = pdtAhpEstDept.GetPDTAndAHPEstDeptStgList(ver_id , estterm_ref_id , est_dept_ref_id , "Y"); IDbConnection conn = DbAgentHelper.CreateDbConnection(); conn.Open(); IDbTransaction trx = conn.BeginTransaction(); try { foreach (DataRow drRow in ds.Tables[0].Rows) { int stg_ref_id = int.Parse(drRow["STG_REF_ID"].ToString()); float point = 0; if (stg_ref_id == target_stg_ref_id) { point = 1; } else { point = GetAHPEstDeptStgHorizonPoint_Dac(ver_id , estterm_ref_id , est_dept_ref_id , stg_ref_id , target_stg_ref_id); } sum_point += point; } trx.Commit(); } catch (Exception ex) { trx.Rollback(); throw ex; } finally { conn.Close(); } return(sum_point); }
public bool ModifyQuestionObject(string q_obj_id , string q_obj_name , string q_obj_title , string q_obj_preface , string[] est_id_arr , DateTime update_date , int update_user) { int affectedRow = 0; Dac_QuestionEstMaps questionEstMap = new Dac_QuestionEstMaps(); IDbConnection conn = DbAgentHelper.CreateDbConnection(); conn.Open(); IDbTransaction trx = conn.BeginTransaction(); try { affectedRow += _questionObject.Update(conn , trx , q_obj_id , q_obj_name , q_obj_title , q_obj_preface , update_date , update_user); affectedRow += questionEstMap.Delete(conn, trx, "", q_obj_id); foreach (string est_id in est_id_arr) { affectedRow += questionEstMap.Insert(conn , trx , est_id , q_obj_id , update_date , update_user); } trx.Commit(); } catch (Exception ex) { trx.Rollback(); return(false); } finally { conn.Close(); } return((affectedRow > 0) ? true : false); }
/// <summary> /// 해당 POS_ID의 데이터 삭제 후 인서트 /// </summary> /// <param name="dt_est_pos_weight">COLUMNS : POS_ID, POS_VALUE, DEPT_TYPE_REF_ID, WEIGHT</param> public int Add_Est_Pos_Weight(int comp_id , int estterm_ref_id , string est_id , DataTable dt_est_pos_weight , string pos_id , int create_user_ref_id) { int affectedRow = 0; IDbConnection conn = DbAgentHelper.CreateDbConnection(); conn.Open(); IDbTransaction trx = conn.BeginTransaction(); try { _data.Delete_DB(conn , trx , comp_id , estterm_ref_id , est_id , pos_id , "" , 0); for (int i = 0; i < dt_est_pos_weight.Rows.Count; i++) { affectedRow += _data.Insert_DB(conn , trx , comp_id , estterm_ref_id , est_id , i + 1 , DataTypeUtility.GetString(dt_est_pos_weight.Rows[i]["POS_ID"]) , DataTypeUtility.GetString(dt_est_pos_weight.Rows[i]["POS_VALUE"]) , DataTypeUtility.GetToInt32(dt_est_pos_weight.Rows[i]["DEPT_TYPE_REF_ID"]) , DataTypeUtility.GetToInt32(dt_est_pos_weight.Rows[i]["WEIGHT"]) , create_user_ref_id); } trx.Commit(); } catch (Exception ex) { trx.Rollback(); affectedRow = 0; } finally { conn.Close(); } return(affectedRow); }
public int Remove_Tgt_Emp_Pool(DataTable DT_dept_id , int comp_id , string est_id , int estterm_ref_id , int estterm_sub_id) { MicroBSC.Integration.COM.Dac.Dac_Rel_Dept_Emp dacRelDeptEmp = new MicroBSC.Integration.COM.Dac.Dac_Rel_Dept_Emp(); Dac_Mul_Est_Emp dacEstEmp = new Dac_Mul_Est_Emp(); int affectedRow = 0; IDbConnection conn = DbAgentHelper.CreateDbConnection(); conn.Open(); IDbTransaction trx = conn.BeginTransaction(); try { //부서갯수만큼 루프 for (int i = 0; i < DT_dept_id.Rows.Count; i++) { string dept_ref_id = DT_dept_id.Rows[i]["DEPT_ID"].ToString(); DataTable DT_tgt_emp_id = dacRelDeptEmp.SelectRelDeptEmp_DB(0 , comp_id , dept_ref_id , est_id , estterm_ref_id , estterm_sub_id).Tables[0]; affectedRow += _data.Delete_Pool_Data(conn, trx , comp_id , est_id , estterm_ref_id , estterm_sub_id , DT_tgt_emp_id); } trx.Commit(); } catch (Exception ex) { trx.Rollback(); affectedRow = 0; } finally { conn.Close(); } return(affectedRow); }
public string AddBscKpiTargetGoal_DB(DataTable dt , int estterm_ref_id , int kpi_ref_id , int kpi_target_version_id , int emp_id) { string reVal = string.Empty; int affectedRow = 0; IDbConnection conn = DbAgentHelper.CreateDbConnection(); conn.Open(); IDbTransaction trx = conn.BeginTransaction(); MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Target_Goal dacBscKpiTargetGoal = new MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Target_Goal(); try { affectedRow = dacBscKpiTargetGoal.DeleteData_DB(conn , trx , estterm_ref_id , kpi_ref_id , kpi_target_version_id); foreach (DataRow dataRow in dt.Rows) { affectedRow = dacBscKpiTargetGoal.InsertData_DB(conn , trx , dataRow["ESTTERM_REF_ID"] , dataRow["KPI_REF_ID"] , dataRow["KPI_TARGET_VERSION_ID"] , dataRow["YMD"] , dataRow["TARGET_MS"] , dataRow["TARGET_TS"] , emp_id); } trx.Commit(); } catch (Exception ex) { trx.Rollback(); affectedRow = 0; return(ex.Message); } finally { conn.Close(); } return(reVal); }
public bool AddQuestionObject(string q_obj_name , string q_obj_title , string q_obj_preface , string[] est_id_arr , DateTime create_date , int create_user) { int affectedRow = 0; Dac_QuestionEstMaps questionEstMap = new Dac_QuestionEstMaps(); Dac_KeyGens keyGen = new Dac_KeyGens(); IDbConnection conn = DbAgentHelper.CreateDbConnection(); conn.Open(); IDbTransaction trx = conn.BeginTransaction(); try { string q_obj_id = keyGen.GetCode(conn, trx, "EST_QUESTION_OBJECT"); affectedRow += _questionObject.Insert(conn , trx , q_obj_id , q_obj_name , q_obj_title , q_obj_preface , create_date , create_user); foreach (string est_id in est_id_arr) { affectedRow += questionEstMap.Insert(conn , trx , est_id , q_obj_id , create_date , create_user); } trx.Commit(); } catch (Exception ex) { trx.Rollback(); return(false); } finally { conn.Close(); } return((affectedRow > 0) ? true : false); }
public bool NewAddScheDetail(int comp_id , int estterm_ref_id , int estterm_sub_id , DateTime start_date , DateTime end_date , DateTime create_date , int create_user) { IDbConnection conn = DbAgentHelper.CreateDbConnection(); conn.Open(); IDbTransaction trx = conn.BeginTransaction(); int affectedRow = 0; try { affectedRow = _dac_scheDetails.Delete(conn , trx , comp_id , estterm_ref_id , estterm_sub_id , string.Empty); affectedRow += _dac_scheDetails.InsertSelect(conn , trx , comp_id , estterm_ref_id , estterm_sub_id , start_date , end_date , create_date , create_user); trx.Commit(); } catch (Exception e) { trx.Rollback(); return(false); } finally { conn.Close(); } if (affectedRow > 0) { return(true); } return(false); }
/// <summary> /// 다면평가 결과를 평균 점수 꼐산 후 STEP_ID를 1로 인서트 /// </summary> /// <returns></returns> public int Merge_Est_Data(int admin_dept_ref_id , int admin_emp_ref_id , int comp_id , int estterm_ref_id , int estterm_sub_id , int tgt_dept_id , int tgt_emp_id) { MicroBSC.Integration.EST.Dac.Dac_Est_Data dacEstData = new MicroBSC.Integration.EST.Dac.Dac_Est_Data(); int affectedRow = 0; int delCnt = 0; string est_id = "3O"; int estterm_step_id = 1; string direction_type = ""; IDbConnection conn = DbAgentHelper.CreateDbConnection(); conn.Open(); IDbTransaction trx = conn.BeginTransaction(); try { delCnt = dacEstData.Delete(conn , trx , comp_id , est_id , estterm_ref_id , estterm_sub_id , estterm_step_id , tgt_emp_id , direction_type); affectedRow = _data.Insert_Sum_Point(conn, trx, admin_dept_ref_id, admin_emp_ref_id, comp_id, estterm_ref_id, estterm_sub_id, tgt_dept_id, tgt_emp_id); trx.Commit(); } catch (Exception ex) { trx.Rollback(); affectedRow = 0; } finally { conn.Close(); } return(affectedRow); }
/// <summary> /// 전기간 참조 /// </summary> /// <param name="comp_id"></param> /// <param name="estterm_ref_id_from"></param> /// <param name="estterm_sub_id_from"></param> /// <param name="estterm_ref_id_to"></param> /// <param name="estterm_sub_id_to"></param> /// <param name="create_date"></param> /// <param name="create_user"></param> /// <returns></returns> public bool CopyEstDataFromTo(int comp_id , int estterm_ref_id_from , int estterm_sub_id_from , int estterm_ref_id_to , int estterm_sub_id_to , DateTime create_date , int create_user) { int affectedRow = 0; IDbConnection conn = DbAgentHelper.CreateDbConnection(); conn.Open(); IDbTransaction trx = conn.BeginTransaction(); try { affectedRow += _questionDeptEmpMap.Delete(conn , trx , comp_id , estterm_ref_id_to , estterm_sub_id_to , "" , "" , 0 , 0); affectedRow += _questionDeptEmpMap.InsertDataFromTo(conn , trx , comp_id , estterm_ref_id_from , estterm_sub_id_from , estterm_ref_id_to , estterm_sub_id_to , create_date , create_user); trx.Commit(); } catch (Exception ex) { trx.Rollback(); return(false); } finally { conn.Close(); } return((affectedRow > 0) ? true : false); }
public bool Set_Est_Target(DataTable PRJ_IDs , int COMP_ID , string EST_ID , int ESTTERM_REF_ID , int ESTTERM_SUB_ID , int ESTTERM_STEP_ID , int USER_REF_ID) { Biz_Prj_Data bizPrjData = new Biz_Prj_Data(); IDbConnection conn = DbAgentHelper.CreateDbConnection(); conn.Open(); IDbTransaction trx = conn.BeginTransaction(); int affectedRow = 0; try { for (int i = 0; i < PRJ_IDs.Rows.Count; i++) { string prj_id = PRJ_IDs.Rows[i]["PRJ_ID"].ToString(); affectedRow += Add_Prj_Info(conn, trx, prj_id, USER_REF_ID); affectedRow += bizPrjData.Add_Prj_Data(conn, trx , prj_id , COMP_ID , EST_ID , ESTTERM_REF_ID , ESTTERM_SUB_ID , ESTTERM_STEP_ID , USER_REF_ID); } trx.Commit(); } catch (Exception ex) { trx.Rollback(); affectedRow = 0; } finally { conn.Close(); } return(affectedRow > 0 ? true : false); }
public bool RemovePdtAhpVersion(int ver_id, int estterm_ref_id) { IDbConnection conn = DbAgentHelper.CreateDbConnection(); conn.Open(); IDbTransaction trx = conn.BeginTransaction(); try { Biz_AHPEstDeptStgDatas ahpEstDeptStg = new Biz_AHPEstDeptStgDatas(); ahpEstDeptStg.RemoveAHPEstDeptStgData(conn , trx , ver_id , estterm_ref_id , 0); Biz_AHPEstDeptStgDatas ahpEstDeptStgDatas = new Biz_AHPEstDeptStgDatas(); ahpEstDeptStgDatas.RemoveAHPEstDeptStgData_Dac(conn , trx , ver_id , estterm_ref_id , 0 , 0 , 0); Biz_PDTAndAHPStgEstDeptDatas pdtAndAHPStgEstDeptDatas = new Biz_PDTAndAHPStgEstDeptDatas(); pdtAndAHPStgEstDeptDatas.RemovePDTAndAHPStgEstDeptData(conn , trx , ver_id , estterm_ref_id , 0 , 0); RemovePDAAndAHPVersion_Dac(conn, trx, ver_id, estterm_ref_id); trx.Commit(); } catch (Exception ex) { trx.Rollback(); return(false); } finally { conn.Close(); } return(true); }
public int UnSet_Est_Target(DataTable PRJ_IDs) { Dac_Prj_Data dacPrjData = new Dac_Prj_Data(); IDbConnection conn = DbAgentHelper.CreateDbConnection(); conn.Open(); IDbTransaction trx = conn.BeginTransaction(); int affectedRow = 1; string prj_ref_id_list = ""; try { for (int i = 0; i < PRJ_IDs.Rows.Count; i++) { string PRJ_ID = PRJ_IDs.Rows[i]["PRJ_ID"].ToString(); int PRJ_REF_ID = _data.Select_Prj_Ref_Id(conn, trx, PRJ_ID); if (prj_ref_id_list.Length > 0) { prj_ref_id_list += ", "; } prj_ref_id_list += PRJ_REF_ID; _data.Delete_Prj_Info(conn, trx, PRJ_ID); dacPrjData.Delete_Prj_Data(conn, trx, PRJ_REF_ID); } //프로젝트 평가 질의 매핑 삭제 Biz_Prj_Question_Prj_Map bizPrjQuestionPrjMap = new Biz_Prj_Question_Prj_Map(); bizPrjQuestionPrjMap.Remove_Question_Prj_Map_Data(conn, trx, 0, "", 0, 0, 0, prj_ref_id_list); trx.Commit(); } catch (Exception ex) { trx.Rollback(); affectedRow = 0; } finally { conn.Close(); } return(affectedRow); }
public bool AddQuestionSubject(string q_obj_id , string q_dfn_id , int num , string q_sbj_name , double weight , string q_sbj_define , string q_sbj_desc , DateTime create_date , int create_user) { int affectedRow = 0; IDbConnection conn = DbAgentHelper.CreateDbConnection(); conn.Open(); IDbTransaction trx = conn.BeginTransaction(); try { Dac_KeyGens keyGen = new Dac_KeyGens(); string q_sbj_id = keyGen.GetCode(conn, trx, "EST_QUESTION_SUBJECT"); affectedRow = _questionsubject.Insert(conn , trx , q_sbj_id , q_obj_id , q_dfn_id , num , q_sbj_name , weight , q_sbj_define , q_sbj_desc , create_date , create_user); trx.Commit(); } catch (Exception ex) { trx.Rollback(); return(false); } finally { conn.Close(); } return((affectedRow > 0) ? true : false); }
public bool AddRelGroupPosInfo(int comp_id , string rel_grp_id , string est_id , int estterm_ref_id , string rel_grp_pos_name , string rel_grp_pos_desc , string opt_value , DateTime create_date , int create_user) { int affectedRow = 0; IDbConnection conn = DbAgentHelper.CreateDbConnection(); conn.Open(); IDbTransaction trx = conn.BeginTransaction(); try { Dac_KeyGens keyGen = new Dac_KeyGens(); string rel_grp_pos_id = keyGen.GetCode(conn, trx, "EST_REL_GROUP_POS_INFO"); affectedRow = _relGroupPosInfo.Insert(conn , trx , comp_id , rel_grp_pos_id , rel_grp_id , est_id , estterm_ref_id , rel_grp_pos_name , rel_grp_pos_desc , opt_value , create_date , create_user); trx.Commit(); } catch (Exception ex) { trx.Rollback(); return(false); } finally { conn.Close(); } return((affectedRow > 0) ? true : false); }
public bool Modify_Score(int comp_id , string est_id , int estterm_ref_id , int estterm_sub_id , int estterm_step_id , string ymd , int est_dept_id , int est_emp_id , int tgt_dept_id , int tgt_emp_id , double score , int update_user_ref_id) { int affectedRow = 0; IDbConnection conn = DbAgentHelper.CreateDbConnection(); conn.Open(); IDbTransaction trx = conn.BeginTransaction(); try { affectedRow = _data.Update_Score(conn, trx , comp_id , est_id , estterm_ref_id , estterm_sub_id , estterm_step_id , ymd , est_dept_id , est_emp_id , tgt_dept_id , tgt_emp_id , score , update_user_ref_id); trx.Commit(); } catch (Exception ex) { trx.Rollback(); affectedRow = 0; } finally { conn.Close(); } return(affectedRow > 0 ? true : false); }
/// <summary> /// 결재원문 Key Update (최초기안시에만 호출) /// </summary> /// <param name="con"></param> /// <param name="trx"></param> /// <param name="iBizTypeCode"></param> /// <param name="pParam"></param> /// <param name="pAppRefId"></param> /// <returns></returns> public bool UpdateOriDocAppKey(IDbConnection con, IDbTransaction trx, string iBizTypeCode, NameValueCollection pParam, decimal pAppRefId) { if (con == null) { con = DbAgentHelper.CreateDbConnection(); con.Open(); } if (trx == null) { trx = con.BeginTransaction(); } return(base.UpdateOriDocAppKey_Dac(con, trx, iBizTypeCode, pParam, pAppRefId)); }
public string RemoveEstEmp(DataTable dtEmp , int comp_id , string est_id , int estterm_ref_id , int estterm_sub_id , string est_type) { string returnVal = string.Empty; MicroBSC.Integration.MUL.Dac.Dac_Mul_Est_Emp dacMulEstEmp = new MicroBSC.Integration.MUL.Dac.Dac_Mul_Est_Emp(); int intTxrCnt = 0; IDbConnection conn = DbAgentHelper.CreateDbConnection(); conn.Open(); IDbTransaction trx = conn.BeginTransaction(); try { for (int i = 0; i < dtEmp.Rows.Count; i++) { DataRow row = dtEmp.Rows[i]; intTxrCnt += dacMulEstEmp.Delete_DB(conn , trx , comp_id , est_id , estterm_ref_id , estterm_sub_id , row["EMP_REF_ID"] , est_type); } trx.Commit(); } catch (Exception ex) { returnVal = ex.Message; trx.Rollback(); return(returnVal); } finally { conn.Close(); } return(returnVal); }
public string AddData_DB(string kpi_pool_templete_id , string[] kpi_pool_ref_id_list , DateTime create_date , int create_user) { string reVal = string.Empty; int affectedRow = 0; IDbConnection conn = DbAgentHelper.CreateDbConnection(); conn.Open(); IDbTransaction trx = conn.BeginTransaction(); MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Pool_Templete_MAP dacBscKpiPoolTempleteMap = new MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Pool_Templete_MAP(); affectedRow = dacBscKpiPoolTempleteMap.DeleteData_DB(conn , trx , kpi_pool_templete_id); try { foreach (string kpi_pool_ref_id in kpi_pool_ref_id_list) { affectedRow = dacBscKpiPoolTempleteMap.InsertData_DB(conn , trx , kpi_pool_templete_id , kpi_pool_ref_id , create_date , create_user); } trx.Commit(); } catch (Exception ex) { reVal = ex.Message; trx.Rollback(); return(ex.Message); } finally { conn.Close(); } return(reVal); }
public bool AddQuestionDefine(string num , string q_dfn_name , string q_dfn_define , string q_dfn_notice , string q_dfn_desc , string est_id , DateTime create_date , int create_user) { int affectedRow = 0; IDbConnection conn = DbAgentHelper.CreateDbConnection(); conn.Open(); IDbTransaction trx = conn.BeginTransaction(); try { Dac_KeyGens keyGen = new Dac_KeyGens(); string q_dfn_id = keyGen.GetCode(conn, trx, "EST_QUESTION_DEFINE"); affectedRow = _questionDefine.Insert(conn , trx , q_dfn_id , num , q_dfn_name , q_dfn_define , q_dfn_notice , q_dfn_desc , est_id , create_date , create_user); trx.Commit(); } catch (Exception ex) { trx.Rollback(); return(false); } finally { conn.Close(); } return((affectedRow > 0) ? true : false); }
/// <summary> /// 데이터 입력 /// </summary> /// <param name="iDt"></param> /// <returns></returns> public bool InsertAllData(DataTable iDt) { int iRtn = 0; IDbConnection conn = DbAgentHelper.CreateDbConnection(); conn.Open(); IDbTransaction trx = conn.BeginTransaction(); int iRow = iDt.Rows.Count; string iType = ""; try { for (int i = 0; i < iRow; i++) { iType = iDt.Rows[i]["ITYPE"].ToString(); base.IBiz_Type = iDt.Rows[i]["BIZ_TYPE"].ToString(); base.IEmp_Ref_Id = int.Parse(iDt.Rows[i]["EMP_REF_ID"].ToString()); base.ISort_Order = int.Parse(iDt.Rows[i]["SORT_ORDER"].ToString()); base.IUpdate_User = int.Parse(iDt.Rows[i]["TXR_USER"].ToString()); if (iType == "A" || iType == "U") { iRtn = base.UpdateData_Dac(conn, trx, base.IBiz_Type, base.IEmp_Ref_Id, base.ISort_Order, base.IUpdate_User); } else if (iType == "D") { iRtn = base.DeleteData_Dac(conn, trx, base.IBiz_Type, base.IEmp_Ref_Id, base.IUpdate_User); } } trx.Commit(); return(true); } catch (Exception e) { trx.Rollback(); base.Transaction_Message = e.Message; return(false); } finally { conn.Close(); conn.Dispose(); } return(true); }
public bool AddQuestionItem(string q_sbj_id , int num , string q_item_name , double point , string comment , string subject_item_yn , DateTime create_date , int create_user) { int affectedRow = 0; IDbConnection conn = DbAgentHelper.CreateDbConnection(); conn.Open(); IDbTransaction trx = conn.BeginTransaction(); try { Dac_KeyGens keyGen = new Dac_KeyGens(); string q_itm_id = keyGen.GetCode(conn, trx, "EST_QUESTION_ITEM"); affectedRow = _questionItem.Insert(conn , trx , q_itm_id , q_sbj_id , num , q_item_name , point , comment , subject_item_yn , create_date , create_user); trx.Commit(); } catch (Exception ex) { trx.Rollback(); return(false); } finally { conn.Close(); } return((affectedRow > 0) ? true : false); }
/// <summary> /// 전체지표 등급현황 /// </summary> /// <param name="iestterm_ref_id"></param> /// <param name="iymd"></param> /// <param name="isum_type"></param> /// <param name="iest_dept_ref_id"></param> /// <returns></returns> public DataSet GetKpiEntGradeStatus(string isymd, string ieymd, string isum_type, int iest_dept_ref_id) { string sSQL = @"SELECT TD.YMD, TD.THRESHOLD_REF_ID, TD.THRESHOLD_KNAME, TD.THRESHOLD_ENAME, TD.IMAGE_FILE_NAME, TD.SEQUENCE, TD.THRESHOLD_COLOR , TD.CNT_KPI, TD.CNT_ALL , CASE WHEN TD.CNT_ALL=0 THEN 0 ELSE ROUND((TD.CNT_KPI/(TD.CNT_ALL)),4)*100 END as COMP_RATE FROM ( SELECT TB.YMD, TB.THRESHOLD_REF_ID, TC.THRESHOLD_KNAME, TC.THRESHOLD_ENAME, TC.IMAGE_FILE_NAME, TC.SEQUENCE, TC.THRESHOLD_COLOR , (TB.CNT_KPI*0.1)*10 as CNT_KPI , SUM(TB.CNT_KPI) OVER(PARTITION BY TB.YMD) as CNT_ALL FROM ( SELECT TA.YMD, TA.THRESHOLD_REF_ID, COUNT(TA.THRESHOLD_REF_ID) as CNT_KPI FROM ( SELECT KS.YMD , CASE WHEN @iSUM_TYPE='MS' THEN KS.THRESHOLD_REF_ID_MS ELSE KS.THRESHOLD_REF_ID_TS END as THRESHOLD_REF_ID FROM BSC_KPI_SCORE KS INNER JOIN BSC_KPI_INFO KI ON KS.ESTTERM_REF_ID = KI.ESTTERM_REF_ID AND KS.KPI_REF_ID = KI.KPI_REF_ID AND KI.USE_YN = 'Y' AND KI.ISDELETE = 'N' AND KI.IS_TEAM_KPI = 'Y' WHERE KS.YMD BETWEEN @iSYMD AND @iEYMD ) TA GROUP BY TA.YMD, TA.THRESHOLD_REF_ID ) TB INNER JOIN BSC_THRESHOLD_CODE TC ON TB.THRESHOLD_REF_ID = TC.THRESHOLD_REF_ID AND TC.DEFAULT_IMG_YN = 'N' ) TD ORDER BY TD.YMD, TD.SEQUENCE"; IDbDataParameter[] paramArray = CreateDataParameters(3); paramArray[0] = CreateDataParameter("@iSYMD", SqlDbType.VarChar); paramArray[0].Value = isymd; paramArray[1] = CreateDataParameter("@iEYMD", SqlDbType.VarChar); paramArray[1].Value = ieymd; paramArray[2] = CreateDataParameter("@iSUM_TYPE", SqlDbType.VarChar); paramArray[2].Value = isum_type; //DataSet ds = DbAgentObj.FillDataSet(query, "DEPT_TYPE_SORT_LIST", null, paramArray, CommandType.Text); DataSet ds = DbAgentObj.FillDataSet(DbAgentHelper.GetQueryStringReplace(sSQL), "KPI_GRADE", null, paramArray, CommandType.Text); return(ds); }
public bool CopyEstTermDataFromTo(bool check_1, bool check_2, bool check_3, bool check_4) { int affectedRow = 0; Dac_QuestionEstMaps questionEstMap = new Dac_QuestionEstMaps(); Dac_QuestionSubjects questionSubject = new Dac_QuestionSubjects(); Dac_QuestionItems questionItem = new Dac_QuestionItems(); Dac_QuestionDatas questionData = new Dac_QuestionDatas(); IDbConnection conn = DbAgentHelper.CreateDbConnection(); conn.Open(); IDbTransaction trx = conn.BeginTransaction(); try { if (check_1) { } if (check_2) { } if (check_3) { } if (check_4) { } trx.Commit(); } catch (Exception ex) { trx.Rollback(); return(false); } finally { conn.Close(); } return((affectedRow > 0) ? true : false); }
public bool AddPDTAndAHPStgInfo(int ver_id , int estterm_ref_id , DataTable treeData , int create_update_user) { IDbConnection conn = DbAgentHelper.CreateDbConnection(); conn.Open(); IDbTransaction trx = conn.BeginTransaction(); try { //RemovePDTAndAHPStgInfo_Dac(conn, trx, ver_id, estterm_ref_id, 0); for (int i = 0; i < treeData.Rows.Count; i++) { AddPDTAndAHPStgInfo_Dac(conn , trx , ver_id , estterm_ref_id , Convert.ToInt32(treeData.Rows[i]["STG_REF_ID"]) , Convert.ToInt32(treeData.Rows[i]["UP_STG_ID"]) , treeData.Rows[i]["STG_MAP_YN"].ToString() , treeData.Rows[i]["F_YN"].ToString() , treeData.Rows[i]["C_YN"].ToString() , treeData.Rows[i]["P_YN"].ToString() , treeData.Rows[i]["L_YN"].ToString() , "" , DateTime.Now , create_update_user); } trx.Commit(); } catch (Exception e) { trx.Rollback(); return(false); } finally { conn.Close(); } return(true); }
/// <summary> /// 가중치 입력과 둥시에 확정 /// </summary> public bool UpdateMBOWeight(int emp_ref_id, DataTable dt, bool is_confirm) { MicroBSC.BSC.Biz.Biz_Bsc_Kpi_Info objBSC = new MicroBSC.BSC.Biz.Biz_Bsc_Kpi_Info(); bool rtnValue = false; int affectedRow = 0; IDbConnection conn = DbAgentHelper.CreateDbConnection(); conn.Open(); IDbTransaction trx = conn.BeginTransaction(); try { rtnValue = base.UpdateMBOWeight(conn, trx, emp_ref_id, dt); for (int i = 0; i < dt.Rows.Count; i++) { int estterm_ref_id = DataTypeUtility.GetToInt32(dt.Rows[i]["ESTTERM_REF_ID"]); int kpi_ref_id = DataTypeUtility.GetToInt32(dt.Rows[i]["KPI_REF_ID"]); affectedRow += objBSC.ConfirmMBO(estterm_ref_id, kpi_ref_id, is_confirm); } if (rtnValue && affectedRow == dt.Rows.Count) { trx.Commit(); } else { trx.Rollback(); rtnValue = false; } } catch { trx.Rollback(); rtnValue = false; } finally { conn.Close(); } return(rtnValue); }
public bool Add_Est_Refusal(int comp_id , string est_id , int estterm_ref_id , int estterm_sub_id , int estterm_step_id , int tgt_dept_id , int tgt_emp_id , string refusal_comment , string grade_id , int create_user_ref_id) { int affectedRow = 0; IDbConnection conn = DbAgentHelper.CreateDbConnection(); conn.Open(); IDbTransaction trx = conn.BeginTransaction(); try { affectedRow += _data.Insert_Est_Refusal(conn, trx , comp_id , est_id , estterm_ref_id , estterm_sub_id , estterm_step_id , tgt_dept_id , tgt_emp_id , refusal_comment , grade_id , create_user_ref_id); trx.Commit(); } catch (Exception ex) { trx.Rollback(); affectedRow = 0; } finally { conn.Close(); } return(affectedRow > 0 ? true : false); }