/// <summary> /// PMS_INFO에서 PRJ_INFO로 프로젝트 정보를 추가 /// </summary> public int Add_Prj_Info(IDbConnection conn, IDbTransaction trx, string PRJ_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_Com_Dept_Info dacDeptInfo = new MicroBSC.Integration.COM.Dac.Dac_Com_Dept_Info(); DataTable PmsInfo = dacPmsInfo.Select_Prj_List(conn, trx, PRJ_ID); int affectedRow = 0; if (PmsInfo.Rows.Count > 0) { _data.Delete_Prj_Info(conn, trx, PRJ_ID); string PRJ_CODE = PRJ_ID; string PRJ_NAME = PmsInfo.Rows[0]["PROJECTNAME"].ToString(); string DEFINITION = PRJ_NAME; string OWNER_DEPT_ID = DataTypeUtility.GetToInt32(PmsInfo.Rows[0]["TEAM_BSC_DEPT_ID"]).ToString(); string OWNER_EMP_ID = PmsInfo.Rows[0]["PM_BSC_EMP_ID"].ToString(); //string PLAN_START_DATE = PmsInfo.Rows[0]["PLN_STR_DATE"].ToString(); //string PLAN_END_DATE = PmsInfo.Rows[0]["PLN_END_DATE"].ToString(); string ACTUAL_START_DATE = Convert.ToDateTime(PmsInfo.Rows[0]["PROJECTSTARTDATE"].ToString()).ToString("yyyy-MM-dd"); string ACTUAL_END_DATE = Convert.ToDateTime(PmsInfo.Rows[0]["PROJECTENDDATE"].ToString()).ToString("yyyy-MM-dd"); affectedRow = _data.Insert_Prj_Info(conn, trx , PRJ_CODE , PRJ_NAME , DBNull.Value , DEFINITION , DBNull.Value , DBNull.Value , DBNull.Value , OWNER_DEPT_ID , OWNER_EMP_ID.Length == 0? DBNull.Value : (object)OWNER_EMP_ID , DBNull.Value , DBNull.Value , DBNull.Value , DBNull.Value , DBNull.Value , DBNull.Value //PLAN_START_DATE , DBNull.Value //PLAN_END_DATE , ACTUAL_START_DATE , ACTUAL_END_DATE , USER_REF_ID); } return(affectedRow); }
/// <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); }