public string AddData_DB(string kpi_pool_ver_name , string kpi_pool_ver_note , 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_Ver dacBscKpiPoolVer = new MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Pool_Ver(); try { int kpi_pool_ver_id = dacBscKpiPoolVer.SelectMax_DB(conn, trx); affectedRow += dacBscKpiPoolVer.InsertData_DB(conn , trx , kpi_pool_ver_id , kpi_pool_ver_name , kpi_pool_ver_note , create_date , create_user); trx.Commit(); } catch (Exception ex) { reVal = ex.Message; trx.Rollback(); return(ex.Message); } finally { conn.Close(); } return(reVal); }
public string RemoveData_DB(string kpi_pool_ver_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_Pool_Ver dacBscKpiPoolVer = new MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Pool_Ver(); MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Pool_Ver_MAP dacBscKpiPoolVerMap = new MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Pool_Ver_MAP(); try { affectedRow = dacBscKpiPoolVer.DeleteData_DB(conn , trx , kpi_pool_ver_id); affectedRow = dacBscKpiPoolVerMap.DeleteData_DB(conn , trx , kpi_pool_ver_id); trx.Commit(); } catch (Exception ex) { reVal = ex.Message; trx.Rollback(); return(ex.Message); } finally { conn.Close(); } return(reVal); }
public DataTable GetBscKpiPoolVer_DB() { MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Pool_Ver dacBscKpiPoolVer = new MicroBSC.Integration.BSC.Dac.Dac_Bsc_Kpi_Pool_Ver(); return(dacBscKpiPoolVer.Select_DB()); }