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 bool AddPDTAndAHPStgEstDeptDatas(int ver_id
                                                , int estterm_ref_id
                                                , DataTable stgData
                                                , DataTable estDeptData
                                                , int est_dept_ref_id
                                                , int create_update_user)
        {
            IDbConnection conn = DbAgentHelper.CreateDbConnection();

            conn.Open();
            IDbTransaction trx = conn.BeginTransaction();

            try
            {
                for (int i = 0; i < stgData.Rows.Count; i++)
                {
                    Biz_PDTAndAHPStgInfos pdtAndAhpStgInfo = new Biz_PDTAndAHPStgInfos();
                    pdtAndAhpStgInfo.AddPDTAndAHPStgInfo_Dac(conn
                                                             , trx
                                                             , ver_id
                                                             , estterm_ref_id
                                                             , Convert.ToInt32(stgData.Rows[i]["STG_REF_ID"])
                                                             , Convert.ToInt32(stgData.Rows[i]["UP_STG_ID"])
                                                             , stgData.Rows[i]["STG_MAP_YN"].ToString()
                                                             , stgData.Rows[i]["F_YN"].ToString()
                                                             , stgData.Rows[i]["C_YN"].ToString()
                                                             , stgData.Rows[i]["P_YN"].ToString()
                                                             , stgData.Rows[i]["L_YN"].ToString()
                                                             , ""
                                                             , DateTime.Now
                                                             , create_update_user);
                }

                Biz_AHPEstDeptStgDatas ahpEstDeptStgDatas = new Biz_AHPEstDeptStgDatas();
                ahpEstDeptStgDatas.RemoveAHPEstDeptStgData(conn
                                                           , trx
                                                           , ver_id
                                                           , estterm_ref_id
                                                           , est_dept_ref_id);

                RemovePDTAndAHPStgEstDeptData(conn
                                              , trx
                                              , ver_id
                                              , estterm_ref_id
                                              , est_dept_ref_id
                                              , 0);


                for (int i = 0; i < estDeptData.Rows.Count; i++)
                {
                    if (est_dept_ref_id == Convert.ToInt32(estDeptData.Rows[i]["EST_DEPT_REF_ID"]))
                    {
                        AddPDTAndAHPStgEstDeptData_Dac(conn
                                                       , trx
                                                       , ver_id
                                                       , estterm_ref_id
                                                       , Convert.ToInt32(estDeptData.Rows[i]["EST_DEPT_REF_ID"])
                                                       , Convert.ToInt32(estDeptData.Rows[i]["STG_REF_ID"])
                                                       , estDeptData.Rows[i]["CHECK_YN"].ToString()
                                                       , ""
                                                       , DateTime.Now
                                                       , create_update_user);
                    }
                }

                trx.Commit();
            }
            catch (Exception e)
            {
                trx.Rollback();
                return(false);
            }
            finally
            {
                conn.Close();
            }

            return(true);
        }