/// <summary> /// 프로젝트 평가점수와 KPI실적 연계 /// </summary> /// <param name="est_id">조직KPI:3A, 개인KPI:3GA</param> /// <param name="ymd">KPI 기간 yyyyMM</param> public bool Modify_Point_Rel_Prj_Kpi(IDbConnection conn, IDbTransaction trx , int comp_id , string est_id , int estterm_ref_id , int estterm_sub_id , int est_dept_id , int est_emp_id , int tgt_dept_id , int tgt_emp_id , int kpi_ref_id , string ymd , int update_user_ref_id) { bool result = false; int affectedRow = 0; Dac_Est_Data dacEstData = new Dac_Est_Data(); Dac_Bsc_Kpi_Result dacBscKpiResult = new Dac_Bsc_Kpi_Result(); Dac_Com_Approval_Info dacComApprovalInfo = new Dac_Com_Approval_Info(); Dac_Com_Approval_Prc dacComApprovalPrc = new Dac_Com_Approval_Prc(); string bizType = ""; if (est_id.Equals("3A")) { bizType = "KRA"; } else if (est_id.Equals("3GA")) { bizType = "TRA"; } DataTable dtEstData = dacEstData.Select_Est_Data_Join_Est_Esu(conn, trx , comp_id , est_id , estterm_ref_id , estterm_sub_id , 1 //estterm_step_id , est_dept_id , est_emp_id , tgt_dept_id , tgt_emp_id , "" , "" , OwnerType.All).Tables[0]; if (dtEstData.Rows.Count > 0 && bizType.Length > 0) { try { string prj_point = DataTypeUtility.GetString(dtEstData.Rows[0]["POINT"]); int app_ref_id = dacComApprovalInfo.SelectMaxAppRefID(conn, trx); affectedRow += dacComApprovalInfo.InsertApprovalinfo_DB(conn, trx , app_ref_id , 1 //VERSION_NO , "" //APP_CODE , "Y" //ACTIVE_YN , "" //ORI_DOC , "프로젝트 평가" //TITLE , bizType , "CFT" //APP_STATUS , "FD" //DRAFT_STATUS : FD, MD, RD , update_user_ref_id , System.DateTime.Now.ToString("yyyy-MM-dd")); affectedRow += dacComApprovalPrc.InsertApprovalPrc_DB(conn, trx , app_ref_id , 1 //VERSION_NO , 1 //LINE_STEP , update_user_ref_id //APP_EMP_ID , "Y" //COMPLETE_TN , "" //COMMENTS , "" //RETURN_REASON , "D" //LINE_TYPE , "NAME" //APP_METHOD , update_user_ref_id , System.DateTime.Now.ToString("yyyy-MM-dd")); affectedRow += dacBscKpiResult.UpdateData_DB(conn, trx , estterm_ref_id , kpi_ref_id , ymd , prj_point , prj_point , app_ref_id , update_user_ref_id); if (affectedRow == 3) { trx.Commit(); result = true; } else { trx.Rollback(); affectedRow = 0; } } catch (Exception ex) { trx.Rollback(); affectedRow = 0; } finally { conn.Close(); } } return(result); }
public bool GetOuterData(int comp_id , string est_id , int estterm_ref_id , int estterm_sub_id , int estterm_ste_id , out string msg) { int intTxrCnt = 0; IDbConnection conn = DbAgentHelper.CreateDbConnection(); conn.Open(); IDbTransaction trx = conn.BeginTransaction(); DataTable dtOuter = _outerDataPro.Select(comp_id, est_id).Tables[0]; msg = ""; int cnt = dtOuter.Rows.Count; bool isContainQueryString = false; int affectedRow = 0; if (dtOuter.Columns.Contains("QUERY_STRING")) { if (cnt > 0) { isContainQueryString = true; } } if (cnt == 0) { msg = "평가별 프로시져 또는 쿼리 정보가 등록되어 있지 않습니다."; return(false); } try { MicroBSC.Integration.EST.Dac.Dac_Est_Data dacEstData = new Dac_Est_Data(); int delCnt = dacEstData.Delete(null , null , comp_id , est_id , estterm_ref_id , estterm_sub_id); if (isContainQueryString) { msg = "(쿼리스트링)"; string query_string = DataTypeUtility.GetValue(dtOuter.Rows[0]["QUERY_STRING"]); affectedRow = _outerDataPro.DoInsertingDataByUsingQuery(comp_id , est_id , estterm_ref_id , estterm_sub_id , estterm_ste_id , query_string); } else { msg = "(프로시져)"; affectedRow = _outerDataPro.GetData(comp_id , est_id , estterm_ref_id , estterm_sub_id , estterm_ste_id , DataTypeUtility.GetValue(dtOuter.Rows[0]["PROC_NAME"])); } trx.Commit(); } catch (Exception ex) { trx.Rollback(); msg += ex.Message; return(false); } finally { conn.Close(); } return(true); }