Esempio n. 1
0
        public int UnSet_Est_Target(DataTable PRJ_IDs)
        {
            Dac_Prj_Data dacPrjData = new Dac_Prj_Data();

            IDbConnection conn = DbAgentHelper.CreateDbConnection();

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

            int    affectedRow     = 1;
            string prj_ref_id_list = "";

            try
            {
                for (int i = 0; i < PRJ_IDs.Rows.Count; i++)
                {
                    string PRJ_ID     = PRJ_IDs.Rows[i]["PRJ_ID"].ToString();
                    int    PRJ_REF_ID = _data.Select_Prj_Ref_Id(conn, trx, PRJ_ID);

                    if (prj_ref_id_list.Length > 0)
                    {
                        prj_ref_id_list += ", ";
                    }
                    prj_ref_id_list += PRJ_REF_ID;

                    _data.Delete_Prj_Info(conn, trx, PRJ_ID);

                    dacPrjData.Delete_Prj_Data(conn, trx, PRJ_REF_ID);
                }

                //프로젝트 평가 질의 매핑 삭제
                Biz_Prj_Question_Prj_Map bizPrjQuestionPrjMap = new Biz_Prj_Question_Prj_Map();
                bizPrjQuestionPrjMap.Remove_Question_Prj_Map_Data(conn, trx, 0, "", 0, 0, 0, prj_ref_id_list);


                trx.Commit();
            }
            catch (Exception ex)
            {
                trx.Rollback();
                affectedRow = 0;
            }
            finally
            {
                conn.Close();
            }

            return(affectedRow);
        }
Esempio n. 2
0
        /// <summary>
        /// PMS_INFO에서 프로젝트 투입인원 평가 및 프로젝트 평가 바탕 정보를 추가
        /// </summary>
        public int Add_Prj_Data(IDbConnection conn, IDbTransaction trx
                                , string PRJ_ID
                                , int COMP_ID
                                , string EST_ID
                                , int ESTTERM_REF_ID
                                , int ESTTERM_SUB_ID
                                , int ESTTERM_STEP_ID
                                , int USER_REF_ID)
        {
            MicroBSC.Integration.PMS.Dac.Dac_Pms_Info     dacPmsInfo    = new MicroBSC.Integration.PMS.Dac.Dac_Pms_Info();
            MicroBSC.Integration.COM.Dac.Dac_Rel_Dept_Emp dacRelDeptEmp = new MicroBSC.Integration.COM.Dac.Dac_Rel_Dept_Emp();
            Dac_Prj_Info dacPrjInfo = new Dac_Prj_Info();

            DataTable PmsInfo = dacPmsInfo.Select_Prj_Detail(conn, trx, PRJ_ID);


            int affectedRow = 0;

            int prj_ref_id = dacPrjInfo.Select_Prj_Ref_Id(conn, trx, PRJ_ID);

            _data.Delete_Prj_Data(conn, trx, prj_ref_id);



            for (int i = 0; i < PmsInfo.Rows.Count; i++)
            {
                string est_dept_id = PmsInfo.Rows[i]["TEAM_BSC_DEPT_ID"].ToString();
                string est_emp_id  = PmsInfo.Rows[i]["PM_BSC_EMP_ID"].ToString();


                string tgt_emp_id  = PmsInfo.Rows[i]["EMPLOYEE_BSC_EMP_ID"].ToString();
                string tgt_dept_id = dacRelDeptEmp.Select_Dept_ID_of_Emp_ID(conn, trx, tgt_emp_id);


                string STATUS_ID = "N";



                //PM이 피평가자로 설정되어있는 경우는 프로젝트 평가로 입력
                if (tgt_emp_id.Equals(est_emp_id))
                {
                    tgt_dept_id = "-1";
                    tgt_emp_id  = "-1";

                    affectedRow += _data.Insert_Prj_Data(conn, trx
                                                         , COMP_ID
                                                         , EST_ID
                                                         , ESTTERM_REF_ID
                                                         , ESTTERM_SUB_ID
                                                         , ESTTERM_STEP_ID
                                                         , est_dept_id
                                                         , est_emp_id
                                                         , tgt_dept_id
                                                         , tgt_emp_id
                                                         , prj_ref_id.ToString()
                                                         , DBNull.Value
                                                         , DBNull.Value
                                                         , STATUS_ID
                                                         , USER_REF_ID);
                }
                else
                {
                    affectedRow += _data.Insert_Prj_Data(conn, trx
                                                         , COMP_ID
                                                         , EST_ID
                                                         , ESTTERM_REF_ID
                                                         , ESTTERM_SUB_ID
                                                         , ESTTERM_STEP_ID
                                                         , est_dept_id
                                                         , est_emp_id
                                                         , tgt_dept_id
                                                         , tgt_emp_id
                                                         , prj_ref_id.ToString()
                                                         , DBNull.Value
                                                         , DBNull.Value
                                                         , STATUS_ID
                                                         , USER_REF_ID);
                }
            }


            return(affectedRow);
        }