Ejemplo n.º 1
0
        public float GetAHPEstDeptStgSumPoint(int ver_id
                                              , int estterm_ref_id
                                              , int est_dept_ref_id
                                              , int target_stg_ref_id)
        {
            float sum_point = 0;

            Biz_PDTAndAHPStgEstDeptDatas pdtAhpEstDept = new Biz_PDTAndAHPStgEstDeptDatas();
            DataSet ds = pdtAhpEstDept.GetPDTAndAHPEstDeptStgList(ver_id
                                                                  , estterm_ref_id
                                                                  , est_dept_ref_id
                                                                  , "Y");

            IDbConnection conn = DbAgentHelper.CreateDbConnection();

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

            try
            {
                foreach (DataRow drRow in ds.Tables[0].Rows)
                {
                    int   stg_ref_id = int.Parse(drRow["STG_REF_ID"].ToString());
                    float point      = 0;

                    if (stg_ref_id == target_stg_ref_id)
                    {
                        point = 1;
                    }
                    else
                    {
                        point = GetAHPEstDeptStgHorizonPoint_Dac(ver_id
                                                                 , estterm_ref_id
                                                                 , est_dept_ref_id
                                                                 , stg_ref_id
                                                                 , target_stg_ref_id);
                    }

                    sum_point += point;
                }

                trx.Commit();
            }
            catch (Exception ex)
            {
                trx.Rollback();
                throw ex;
            }
            finally
            {
                conn.Close();
            }

            return(sum_point);
        }
Ejemplo n.º 2
0
        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);
        }