public DataTable GetBscKpiTargetGoalTong_DB(int estterm_ref_id , int kpi_ref_id , string ymd) { MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Target_Goal dacBscKpiTargetGoal = new MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Target_Goal(); return(dacBscKpiTargetGoal.Select_DB(estterm_ref_id, kpi_ref_id, ymd).Tables[0]); }
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 int ModifyData(DataTable dt) { 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 { foreach (DataRow dataRow in dt.Rows) { affectedRow += dacBscKpiTargetGoal.UpdateData_DB(conn , trx , dataRow["ESTTERM_REF_ID"] , dataRow["KPI_REF_ID"] , dataRow["TARGET_VERSION_ID"] , dataRow["YMD"] , dataRow["TARGET_MS"] , dataRow["TARGET_TS"] , dataRow["UPDATE_USER"]); } trx.Commit(); } catch (Exception ex) { trx.Rollback(); affectedRow = 0; } finally { conn.Close(); } return(affectedRow); }