public bool RemoveQuestionObject(string q_obj_id) { int affectedRow = 0; Dac_QuestionEstMaps questionEstMap = new Dac_QuestionEstMaps(); Dac_QuestionSubjects questionSubject = new Dac_QuestionSubjects(); Dac_QuestionItems questionItem = new Dac_QuestionItems(); Dac_QuestionDatas questionData = new Dac_QuestionDatas(); IDbConnection conn = DbAgentHelper.CreateDbConnection(); conn.Open(); IDbTransaction trx = conn.BeginTransaction(); try { affectedRow += questionItem.DeleteByQObjID(conn, trx, q_obj_id); affectedRow += questionSubject.Delete(conn, trx, "", q_obj_id); affectedRow += questionEstMap.Delete(conn, trx, "", q_obj_id); affectedRow += _questionObject.Delete(conn, trx, q_obj_id); trx.Commit(); } catch (Exception ex) { trx.Rollback(); return(false); } finally { conn.Close(); } return((affectedRow > 0) ? true : false); }
public bool CopyDataFromTo(int comp_id , string est_id , int estterm_ref_id_from , int estterm_sub_id_from , int estterm_step_id_from , int estterm_ref_id_to , int estterm_sub_id_to , int estterm_step_id_to , DateTime create_date , int create_user) { int affectedRow = 0; Dac_QuestionEstMaps questionEstMap = new Dac_QuestionEstMaps(); IDbConnection conn = DbAgentHelper.CreateDbConnection(); conn.Open(); IDbTransaction trx = conn.BeginTransaction(); try { affectedRow += _empEstTargetMap.Delete(conn , trx , comp_id , "" , estterm_ref_id_to , estterm_sub_id_to , estterm_step_id_to , 0 , 0 , 0 , 0); affectedRow += _empEstTargetMap.InsertDataFromTo(conn , trx , comp_id , estterm_ref_id_from , estterm_sub_id_from , estterm_step_id_from , estterm_ref_id_to , estterm_sub_id_to , estterm_step_id_to , create_date , create_user); trx.Commit(); } catch (Exception ex) { trx.Rollback(); return(false); } finally { conn.Close(); } return((affectedRow > 0) ? true : false); }
public bool ModifyQuestionObject(string q_obj_id , string q_obj_name , string q_obj_title , string q_obj_preface , string[] est_id_arr , DateTime update_date , int update_user) { int affectedRow = 0; Dac_QuestionEstMaps questionEstMap = new Dac_QuestionEstMaps(); IDbConnection conn = DbAgentHelper.CreateDbConnection(); conn.Open(); IDbTransaction trx = conn.BeginTransaction(); try { affectedRow += _questionObject.Update(conn , trx , q_obj_id , q_obj_name , q_obj_title , q_obj_preface , update_date , update_user); affectedRow += questionEstMap.Delete(conn, trx, "", q_obj_id); foreach (string est_id in est_id_arr) { affectedRow += questionEstMap.Insert(conn , trx , est_id , q_obj_id , update_date , update_user); } trx.Commit(); } catch (Exception ex) { trx.Rollback(); return(false); } finally { conn.Close(); } return((affectedRow > 0) ? true : false); }
public bool AddQuestionObject(string q_obj_name , string q_obj_title , string q_obj_preface , string[] est_id_arr , DateTime create_date , int create_user) { int affectedRow = 0; Dac_QuestionEstMaps questionEstMap = new Dac_QuestionEstMaps(); Dac_KeyGens keyGen = new Dac_KeyGens(); IDbConnection conn = DbAgentHelper.CreateDbConnection(); conn.Open(); IDbTransaction trx = conn.BeginTransaction(); try { string q_obj_id = keyGen.GetCode(conn, trx, "EST_QUESTION_OBJECT"); affectedRow += _questionObject.Insert(conn , trx , q_obj_id , q_obj_name , q_obj_title , q_obj_preface , create_date , create_user); foreach (string est_id in est_id_arr) { affectedRow += questionEstMap.Insert(conn , trx , est_id , q_obj_id , create_date , create_user); } trx.Commit(); } catch (Exception ex) { trx.Rollback(); return(false); } finally { conn.Close(); } return((affectedRow > 0) ? true : false); }
public bool CopyEstTermDataFromTo(bool check_1, bool check_2, bool check_3, bool check_4) { int affectedRow = 0; Dac_QuestionEstMaps questionEstMap = new Dac_QuestionEstMaps(); Dac_QuestionSubjects questionSubject = new Dac_QuestionSubjects(); Dac_QuestionItems questionItem = new Dac_QuestionItems(); Dac_QuestionDatas questionData = new Dac_QuestionDatas(); IDbConnection conn = DbAgentHelper.CreateDbConnection(); conn.Open(); IDbTransaction trx = conn.BeginTransaction(); try { if (check_1) { } if (check_2) { } if (check_3) { } if (check_4) { } trx.Commit(); } catch (Exception ex) { trx.Rollback(); return(false); } finally { conn.Close(); } return((affectedRow > 0) ? true : false); }
public bool RemoveEmpEstTargetMap(DataTable dataTable) { int affectedRow = 0; Dac_QuestionEstMaps questionEstMap = new Dac_QuestionEstMaps(); IDbConnection conn = DbAgentHelper.CreateDbConnection(); conn.Open(); IDbTransaction trx = conn.BeginTransaction(); try { foreach (DataRow dataRow in dataTable.Rows) { affectedRow += _empEstTargetMap.Delete(conn , trx , dataRow["COMP_ID"] , dataRow["EST_ID"] , dataRow["ESTTERM_REF_ID"] , dataRow["ESTTERM_SUB_ID"] , dataRow["ESTTERM_STEP_ID"] , dataRow["EST_DEPT_ID"] , dataRow["EST_EMP_ID"] , dataRow["TGT_DEPT_ID"] , dataRow["TGT_EMP_ID"]); } trx.Commit(); } catch (Exception ex) { trx.Rollback(); return(false); } finally { conn.Close(); } return((affectedRow > 0) ? true : false); }
public bool CopyQuestionObject(DataTable dataTable) { int affectedRow = 0; Dac_QuestionEstMaps questionEstMap = new Dac_QuestionEstMaps(); Dac_QuestionSubjects questionSubject = new Dac_QuestionSubjects(); Dac_QuestionItems questionItem = new Dac_QuestionItems(); Dac_QuestionDatas questionData = new Dac_QuestionDatas(); Dac_KeyGens keyGen = new Dac_KeyGens(); IDbConnection conn = DbAgentHelper.CreateDbConnection(); conn.Open(); IDbTransaction trx = conn.BeginTransaction(); try { //EST_QUESTION_OBJECT - 복사 foreach (DataRow dataRowDT in dataTable.Rows) { DataTable dtObj = _questionObject.Select(conn , trx , DataTypeUtility.GetValue(dataRowDT["EST_ID"]) , DataTypeUtility.GetValue(dataRowDT["Q_OBJ_ID"])).Tables[0]; DataTable dtEstMap = questionEstMap.Select(conn , trx , "" , DataTypeUtility.GetValue(dataRowDT["Q_OBJ_ID"])).Tables[0]; foreach (DataRow dataRowObj in dtObj.Rows) { string q_obj_id = keyGen.GetCode(conn , trx , "EST_QUESTION_OBJECT"); // 질의 그룹 등록 affectedRow += _questionObject.Insert(conn , trx , q_obj_id , "Copy of " + DataTypeUtility.GetValue(dataRowObj["Q_OBJ_NAME"]) , DataTypeUtility.GetValue(dataRowObj["Q_OBJ_TITLE"]) , DataTypeUtility.GetValue(dataRowObj["Q_OBJ_PREFACE"]) , DataTypeUtility.GetToDateTime(dataRowDT["DATE"]) , DataTypeUtility.GetToInt32(dataRowDT["USER"])); // 질의 매핑 등록 foreach (DataRow dataRowEstMap in dtEstMap.Rows) { affectedRow += questionEstMap.Insert(conn , trx , DataTypeUtility.GetValue(dataRowEstMap["EST_ID"]) , q_obj_id , DataTypeUtility.GetToDateTime(dataRowDT["DATE"]) , DataTypeUtility.GetToInt32(dataRowDT["USER"])); } DataTable dtSub = questionSubject.Select(conn , trx , "" , DataTypeUtility.GetValue(dataRowObj["Q_OBJ_ID"]) , "").Tables[0]; // 질의 제목 등록 foreach (DataRow dataRowSub in dtSub.Rows) { string q_sbj_id = keyGen.GetCode(conn , trx , "EST_QUESTION_SUBJECT"); affectedRow += questionSubject.Insert(conn , trx , q_sbj_id , q_obj_id , DataTypeUtility.GetValue(dataRowSub["Q_DFN_ID"]) , DataTypeUtility.GetToInt32(dataRowSub["NUM"]) , DataTypeUtility.GetValue(dataRowSub["Q_SBJ_NAME"]) , DataTypeUtility.GetToDouble(dataRowSub["WEIGHT"]) , DataTypeUtility.GetValue(dataRowSub["Q_SBJ_DEFINE"]) , DataTypeUtility.GetValue(dataRowSub["Q_SBJ_DESC"]) , DataTypeUtility.GetToDateTime(dataRowDT["DATE"]) , DataTypeUtility.GetToInt32(dataRowDT["USER"])); DataTable dtItem = questionItem.Select(conn , trx , "" , DataTypeUtility.GetValue(dataRowSub["Q_SBJ_ID"]) , DataTypeUtility.GetValue(dataRowObj["Q_OBJ_ID"])).Tables[0]; // 질의 항목 등록 foreach (DataRow dataRowItem in dtItem.Rows) { string q_itm_id = keyGen.GetCode(conn , trx , "EST_QUESTION_ITEM"); affectedRow += questionItem.Insert(conn , trx , q_itm_id , q_sbj_id , DataTypeUtility.GetToInt32(dataRowItem["NUM"]) , DataTypeUtility.GetValue(dataRowItem["Q_ITEM_NAME"]) , DataTypeUtility.GetToDouble(dataRowItem["POINT"]) , DataTypeUtility.GetValue(dataRowItem["COMMENT"]) , DataTypeUtility.GetValue(dataRowItem["SUBJECT_ITEM_YN"]) , DataTypeUtility.GetToDateTime(dataRowDT["DATE"]) , DataTypeUtility.GetToInt32(dataRowDT["USER"])); } } } } trx.Commit(); } catch (Exception ex) { trx.Rollback(); return(false); } finally { conn.Close(); } return((affectedRow > 0) ? true : false); }
public bool AddEmpEstTargetMap(int comp_id , string est_id , int estterm_ref_id , int estterm_sub_id , int estterm_step_id , int est_dept_id , int est_emp_id , int tgt_dept_id , int tgt_emp_id , string tgt_pos_cls_id , string tgt_pos_cls_name , string tgt_pos_dut_id , string tgt_pos_dut_name , string tgt_pos_grp_id , string tgt_pos_grp_name , string tgt_pos_rnk_id , string tgt_pos_rnk_name , string tgt_pos_knd_id , string tgt_pos_knd_name , string direction_type , string status_id , DateTime create_date , int create_user) { int affectedRow = 0; Dac_QuestionEstMaps questionEstMap = new Dac_QuestionEstMaps(); IDbConnection conn = DbAgentHelper.CreateDbConnection(); conn.Open(); IDbTransaction trx = conn.BeginTransaction(); try { // 존재하는 데이터가 있다면 삭제 후 추가 if (IsExist(comp_id , est_id , estterm_ref_id , estterm_sub_id , estterm_step_id , 0 , 0 , tgt_dept_id , tgt_emp_id)) { affectedRow += _empEstTargetMap.Delete(conn , trx , comp_id , est_id , estterm_ref_id , estterm_sub_id , estterm_step_id , 0 , 0 , tgt_dept_id , tgt_emp_id); } affectedRow += _empEstTargetMap.Insert(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 , tgt_pos_cls_id.Replace(" ", "") , tgt_pos_cls_name.Replace(" ", "") , tgt_pos_dut_id.Replace(" ", "") , tgt_pos_dut_name.Replace(" ", "") , tgt_pos_grp_id.Replace(" ", "") , tgt_pos_grp_name.Replace(" ", "") , tgt_pos_rnk_id.Replace(" ", "") , tgt_pos_rnk_name.Replace(" ", "") , tgt_pos_knd_id.Replace(" ", "") , tgt_pos_knd_name.Replace(" ", "") , direction_type , status_id , create_date , create_user); trx.Commit(); } catch (Exception ex) { trx.Rollback(); return(false); } finally { conn.Close(); } return((affectedRow > 0) ? true : false); }
public bool AddPrjEmpEstPrjMap(int comp_id , string est_id , int estterm_ref_id , int estterm_sub_id , int estterm_step_id , int est_dept_id , int est_emp_id , int prj_ref_id , string status_id , DateTime create_date , int create_user) { int affectedRow = 0; Dac_QuestionEstMaps questionEstMap = new Dac_QuestionEstMaps(); IDbConnection conn = DbAgentHelper.CreateDbConnection(); conn.Open(); IDbTransaction trx = conn.BeginTransaction(); try { // 존재하는 데이터가 있다면 삭제 후 추가 if (IsExist(comp_id , est_id , estterm_ref_id , estterm_sub_id , estterm_step_id , 0 , 0 , prj_ref_id)) { affectedRow += _prjEstPrjMap.Delete(conn , trx , comp_id , est_id , estterm_ref_id , estterm_sub_id , estterm_step_id , 0 , 0 , prj_ref_id); } affectedRow += _prjEstPrjMap.Insert(conn , trx , comp_id , est_id , estterm_ref_id , estterm_sub_id , estterm_step_id , est_dept_id , est_emp_id , prj_ref_id , status_id , create_date , create_user); trx.Commit(); } catch (Exception ex) { trx.Rollback(); return(false); } finally { conn.Close(); } return((affectedRow > 0) ? true : false); }