public int Remove_Tgt_Emp_Pool(DataTable DT_dept_id , int comp_id , string est_id , int estterm_ref_id , int estterm_sub_id) { MicroBSC.Integration.COM.Dac.Dac_Rel_Dept_Emp dacRelDeptEmp = new MicroBSC.Integration.COM.Dac.Dac_Rel_Dept_Emp(); Dac_Mul_Est_Emp dacEstEmp = new Dac_Mul_Est_Emp(); int affectedRow = 0; IDbConnection conn = DbAgentHelper.CreateDbConnection(); conn.Open(); IDbTransaction trx = conn.BeginTransaction(); try { //부서갯수만큼 루프 for (int i = 0; i < DT_dept_id.Rows.Count; i++) { string dept_ref_id = DT_dept_id.Rows[i]["DEPT_ID"].ToString(); DataTable DT_tgt_emp_id = dacRelDeptEmp.SelectRelDeptEmp_DB(0 , comp_id , dept_ref_id , est_id , estterm_ref_id , estterm_sub_id).Tables[0]; affectedRow += _data.Delete_Pool_Data(conn, trx , comp_id , est_id , estterm_ref_id , estterm_sub_id , DT_tgt_emp_id); } trx.Commit(); } catch (Exception ex) { trx.Rollback(); affectedRow = 0; } finally { conn.Close(); } return(affectedRow); }
public int Add_Tgt_Emp_Pool(DataTable DT_dept_id , int comp_id , string est_id , int estterm_ref_id , int estterm_sub_id , int create_user_ref_id) { MicroBSC.Integration.COM.Dac.Dac_Rel_Dept_Emp dacRelDeptEmp = new MicroBSC.Integration.COM.Dac.Dac_Rel_Dept_Emp(); Dac_Mul_Est_Emp dacEstEmp = new Dac_Mul_Est_Emp(); DataTable DT_est_emp_id = dacEstEmp.SelectEstEmp_DB(comp_id, est_id, estterm_ref_id, estterm_sub_id, 0, "EST"); int affectedRow = 0; IDbConnection conn = DbAgentHelper.CreateDbConnection(); conn.Open(); IDbTransaction trx = conn.BeginTransaction(); try { //부서 갯수만큼 루프 for (int i = 0; i < DT_dept_id.Rows.Count; i++) { string dept_ref_id = DT_dept_id.Rows[i]["DEPT_ID"].ToString(); DataTable DT_tgt_emp_id = dacEstEmp.SelectRelDeptEmp(0 , comp_id , dept_ref_id , est_id , estterm_ref_id , estterm_sub_id , "TGT").Tables[0]; //해당 부서의 직원 수만큼 루프 for (int j = 0; j < DT_tgt_emp_id.Rows.Count; j++) { string tgt_emp_id = DT_tgt_emp_id.Rows[j]["EMP_REF_ID"].ToString(); //셀렉트한 결과 모두 인서트 //전체 평가자 //affectedRow += _data.Insert_Pool_Data(conn, trx // , comp_id // , est_id // , estterm_ref_id // , estterm_sub_id // , tgt_emp_id // , create_user_ref_id); //피평가자의 부서에 해당하는 평가자 affectedRow += _data.Insert_Pool_Data_Dept(conn, trx , comp_id , est_id , estterm_ref_id , estterm_sub_id , dept_ref_id , tgt_emp_id , create_user_ref_id); } } trx.Commit(); } catch (Exception ex) { trx.Rollback(); affectedRow = 0; } finally { conn.Close(); } 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); }