public string ModifyKpiResult_DB(int iestterm_ref_id , int ikpi_ref_id , string iymd , double iresult_ms , double iresult_ts , int isequence , double ical_result_ms , double ical_result_ts , string cal_apply_yn , string cal_apply_reason , string cause_text_ms , string cause_text_ts , string cause_file_id , string imeasure_text_ms , string imeasure_text_ts , string imeasure_file_id , string iremark , string initiative_do , string do_file , DateTime create_date , int create_user) { string returnVal = string.Empty; int affectedRow = 0; IDbConnection conn = DbAgentHelper.CreateDbConnection(); conn.Open(); IDbTransaction trx = conn.BeginTransaction(); MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Initiative dacBscKpiInitiative = new MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Initiative(); DataTable dtBscKpiInitiative = dacBscKpiInitiative.SelectData_DB(iestterm_ref_id , ikpi_ref_id , iymd).Tables[0]; try { MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Result dacBscKpiResult = new MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Result(); affectedRow = dacBscKpiResult.UpdataData_DB(conn , trx , iestterm_ref_id , ikpi_ref_id , iymd , iresult_ms , iresult_ts , isequence , "Y" , ical_result_ms , ical_result_ts , cal_apply_yn , cal_apply_reason , cause_text_ms , cause_text_ts , cause_file_id , imeasure_text_ms , imeasure_text_ts , imeasure_file_id , iremark , create_user , create_date); if (dtBscKpiInitiative.Rows.Count > 0) { affectedRow = dacBscKpiInitiative.UpdateDo_DB(conn , trx , iestterm_ref_id , ikpi_ref_id , iymd , initiative_do , do_file , create_date , create_user); } else { affectedRow = dacBscKpiInitiative.InsertData_DB(conn , trx , iestterm_ref_id , ikpi_ref_id , iymd , DBNull.Value , initiative_do , do_file , DBNull.Value , create_user); } //trx.Rollback(); trx.Commit(); } catch (Exception ex) { trx.Rollback(); returnVal = ex.Message; return(returnVal); } finally { conn.Close(); } return(returnVal); }
/// <summary> /// 조직KPI에서 복사한 MBO를 삭제 /// </summary> /// <param></param> /// <returns></returns> public string RemoveMboToKpi_DB(int estterm_ref_id , string[] objList) { string rtnValue = string.Empty; int okCnt = 0; IDbConnection conn = DbAgentHelper.CreateDbConnection(); conn.Open(); IDbTransaction trx = conn.BeginTransaction(); try { MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Info dacBscKpiInfo = new MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Info(); MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Target_Version dacBscKpiTargetVersion = new MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Target_Version(); MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Result dacBscKpiResult = new MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Result(); MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Term dacBscKpiTerm = new MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Term(); MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Target dacBscKpiTarget = new MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Target(); MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Threshold_Info dacBscKpiThresholdInfo = new MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Threshold_Info(); MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Initiative dacBscKpiInitiative = new MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Initiative(); MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Classification dacBscKpiClassification = new MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Classification(); foreach (string obj in objList) { okCnt = dacBscKpiInfo.Delete_DB(conn , trx , estterm_ref_id , obj); okCnt = dacBscKpiTargetVersion.Delete_DB(conn , trx , estterm_ref_id , obj); okCnt = dacBscKpiResult.DeleteData_DB(conn , trx , estterm_ref_id , obj); okCnt = dacBscKpiTerm.Delete_DB(conn , trx , estterm_ref_id , obj); okCnt = dacBscKpiTarget.Delete_DB(conn , trx , estterm_ref_id , obj); okCnt = dacBscKpiThresholdInfo.Delete_DB(conn , trx , estterm_ref_id , obj); okCnt = dacBscKpiInitiative.DeleteData_DB(conn , trx , estterm_ref_id , obj); okCnt = dacBscKpiClassification.Delete_DB(conn , trx , estterm_ref_id , obj); } trx.Commit(); } catch (Exception ex) { rtnValue = ex.Message; trx.Rollback(); } finally { conn.Close(); } return(rtnValue); }