Пример #1
0
        public bool AddCtrlInfo(int comp_id
                                , int estterm_ref_id
                                , int estterm_sub_id
                                , int ctrl_emp_id
                                , float scope
                                , string point_grade_type
                                , string scope_unit_id
                                , string all_est_yn
                                , string all_est_dept_yn
                                , string confirm_emp_yn
                                , int ctrl_order
                                , DateTime create_date
                                , int create_user)
        {
            int affectedRow = 0;

            IDbConnection conn = DbAgentHelper.CreateDbConnection();

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

            try
            {
                Dac_KeyGens keyGen  = new Dac_KeyGens();
                string      ctrl_id = keyGen.GetCode(conn, trx, "EST_CTRL_INFO");

                affectedRow = _ctrlInfo.Insert(conn
                                               , trx
                                               , ctrl_id
                                               , comp_id
                                               , estterm_ref_id
                                               , estterm_sub_id
                                               , ctrl_emp_id
                                               , scope
                                               , point_grade_type
                                               , scope_unit_id
                                               , all_est_yn
                                               , all_est_dept_yn
                                               , confirm_emp_yn
                                               , ctrl_order
                                               , create_date
                                               , create_user);

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

            return((affectedRow > 0) ? true : false);
        }
Пример #2
0
        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);
        }
Пример #3
0
        public bool AddQuestionSubject(string q_obj_id
                                       , string q_dfn_id
                                       , int num
                                       , string q_sbj_name
                                       , double weight
                                       , string q_sbj_define
                                       , string q_sbj_desc
                                       , DateTime create_date
                                       , int create_user)
        {
            int affectedRow = 0;

            IDbConnection conn = DbAgentHelper.CreateDbConnection();

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

            try
            {
                Dac_KeyGens keyGen   = new Dac_KeyGens();
                string      q_sbj_id = keyGen.GetCode(conn, trx, "EST_QUESTION_SUBJECT");

                affectedRow = _questionsubject.Insert(conn
                                                      , trx
                                                      , q_sbj_id
                                                      , q_obj_id
                                                      , q_dfn_id
                                                      , num
                                                      , q_sbj_name
                                                      , weight
                                                      , q_sbj_define
                                                      , q_sbj_desc
                                                      , create_date
                                                      , create_user);

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

            return((affectedRow > 0) ? true : false);
        }
Пример #4
0
        public bool AddRelGroupPosInfo(int comp_id
                                       , string rel_grp_id
                                       , string est_id
                                       , int estterm_ref_id
                                       , string rel_grp_pos_name
                                       , string rel_grp_pos_desc
                                       , string opt_value
                                       , DateTime create_date
                                       , int create_user)
        {
            int affectedRow = 0;

            IDbConnection conn = DbAgentHelper.CreateDbConnection();

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

            try
            {
                Dac_KeyGens keyGen         = new Dac_KeyGens();
                string      rel_grp_pos_id = keyGen.GetCode(conn, trx, "EST_REL_GROUP_POS_INFO");

                affectedRow = _relGroupPosInfo.Insert(conn
                                                      , trx
                                                      , comp_id
                                                      , rel_grp_pos_id
                                                      , rel_grp_id
                                                      , est_id
                                                      , estterm_ref_id
                                                      , rel_grp_pos_name
                                                      , rel_grp_pos_desc
                                                      , opt_value
                                                      , create_date
                                                      , create_user);

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

            return((affectedRow > 0) ? true : false);
        }
Пример #5
0
        public bool AddQuestionItem(string q_sbj_id
                                    , int num
                                    , string q_item_name
                                    , double point
                                    , string comment
                                    , string subject_item_yn
                                    , DateTime create_date
                                    , int create_user)
        {
            int affectedRow = 0;

            IDbConnection conn = DbAgentHelper.CreateDbConnection();

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

            try
            {
                Dac_KeyGens keyGen   = new Dac_KeyGens();
                string      q_itm_id = keyGen.GetCode(conn, trx, "EST_QUESTION_ITEM");

                affectedRow = _questionItem.Insert(conn
                                                   , trx
                                                   , q_itm_id
                                                   , q_sbj_id
                                                   , num
                                                   , q_item_name
                                                   , point
                                                   , comment
                                                   , subject_item_yn
                                                   , create_date
                                                   , create_user);

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

            return((affectedRow > 0) ? true : false);
        }
Пример #6
0
        public bool AddQuestionDefine(string num
                                      , string q_dfn_name
                                      , string q_dfn_define
                                      , string q_dfn_notice
                                      , string q_dfn_desc
                                      , string est_id
                                      , DateTime create_date
                                      , int create_user)
        {
            int affectedRow = 0;

            IDbConnection conn = DbAgentHelper.CreateDbConnection();

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

            try
            {
                Dac_KeyGens keyGen   = new Dac_KeyGens();
                string      q_dfn_id = keyGen.GetCode(conn, trx, "EST_QUESTION_DEFINE");

                affectedRow = _questionDefine.Insert(conn
                                                     , trx
                                                     , q_dfn_id
                                                     , num
                                                     , q_dfn_name
                                                     , q_dfn_define
                                                     , q_dfn_notice
                                                     , q_dfn_desc
                                                     , est_id
                                                     , create_date
                                                     , create_user);

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

            return((affectedRow > 0) ? true : false);
        }
Пример #7
0
        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);
        }
Пример #8
0
        public bool CopyDataFromTo(int comp_id
                                   , int estterm_ref_id_from
                                   , int estterm_ref_id_to
                                   , DateTime create_date
                                   , int create_user)
        {
            int affectedRow = 0;

            Dac_KeyGens keyGen = new Dac_KeyGens();

            IDbConnection conn = DbAgentHelper.CreateDbConnection();

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

            try
            {
                DataTable dtRelGrpInfo = _relGroupInfo.Select(conn, trx, comp_id, "", "", estterm_ref_id_from).Tables[0];

                foreach (DataRow drRelGrpInfo in dtRelGrpInfo.Rows)
                {
                    string rel_grp_id = keyGen.GetCode(conn, trx, "EST_REL_GROUP_INFO");

                    affectedRow += _relGroupInfo.Insert(conn
                                                        , trx
                                                        , comp_id
                                                        , rel_grp_id
                                                        , DataTypeUtility.GetValue(drRelGrpInfo["EST_ID"])
                                                        , estterm_ref_id_to
                                                        , DataTypeUtility.GetValue(drRelGrpInfo["REL_GRP_NAME"])
                                                        , DataTypeUtility.GetValue(drRelGrpInfo["REL_GRP_DESC"])
                                                        , create_date
                                                        , create_user);

                    DataTable dtRelGrpDept = _relGroupDept.Select(conn
                                                                  , trx
                                                                  , comp_id
                                                                  , DataTypeUtility.GetValue(drRelGrpInfo["REL_GRP_ID"])
                                                                  , 0
                                                                  , ""
                                                                  , estterm_ref_id_from).Tables[0];

                    foreach (DataRow drRelGrpDept in dtRelGrpDept.Rows)
                    {
                        affectedRow += _relGroupDept.Insert(conn
                                                            , trx
                                                            , comp_id
                                                            , rel_grp_id
                                                            , DataTypeUtility.GetToInt32(drRelGrpDept["DEPT_REF_ID"])
                                                            , DataTypeUtility.GetValue(drRelGrpDept["EST_ID"])
                                                            , estterm_ref_id_to
                                                            , create_date
                                                            , create_user);
                    }

                    DataTable dtRelGrpPosInfo = _relGroupPosInfo.Select(conn
                                                                        , trx
                                                                        , comp_id
                                                                        , ""
                                                                        , DataTypeUtility.GetValue(drRelGrpInfo["REL_GRP_ID"])
                                                                        , ""
                                                                        , estterm_ref_id_from).Tables[0];

                    foreach (DataRow drRelGrpPosInfo in dtRelGrpPosInfo.Rows)
                    {
                        string rel_grp_pos_id = keyGen.GetCode(conn, trx, "EST_REL_GROUP_POS_INFO");

                        affectedRow += _relGroupPosInfo.Insert(conn
                                                               , trx
                                                               , comp_id
                                                               , rel_grp_pos_id
                                                               , DataTypeUtility.GetValue(drRelGrpInfo["REL_GRP_ID"])
                                                               , DataTypeUtility.GetValue(drRelGrpPosInfo["EST_ID"])
                                                               , estterm_ref_id_to
                                                               , DataTypeUtility.GetValue(drRelGrpPosInfo["REL_GRP_POS_NAME"])
                                                               , DataTypeUtility.GetValue(drRelGrpPosInfo["REL_GRP_POS_DESC"])
                                                               , DataTypeUtility.GetValue(drRelGrpPosInfo["OPT_VALUE"])
                                                               , create_date
                                                               , create_user);

                        DataTable dtRelGrpPosData = _relGroupPosData.Select(conn
                                                                            , trx
                                                                            , comp_id
                                                                            , ""
                                                                            , DataTypeUtility.GetValue(drRelGrpInfo["REL_GRP_ID"])
                                                                            , DataTypeUtility.GetValue(drRelGrpPosInfo["REL_GRP_POS_ID"])
                                                                            , ""
                                                                            , estterm_ref_id_from).Tables[0];

                        foreach (DataRow drRelGrpPosData in dtRelGrpPosData.Rows)
                        {
                            string rel_grp_pos_data_id = keyGen.GetCode(conn, trx, "EST_REL_GROUP_POS_DATA");

                            affectedRow += _relGroupPosData.Insert(conn
                                                                   , trx
                                                                   , comp_id
                                                                   , rel_grp_pos_data_id
                                                                   , DataTypeUtility.GetValue(drRelGrpInfo["REL_GRP_ID"])
                                                                   , DataTypeUtility.GetValue(drRelGrpPosData["REL_GRP_POS_ID"])
                                                                   , DataTypeUtility.GetValue(drRelGrpPosData["EST_ID"])
                                                                   , estterm_ref_id_to
                                                                   , DataTypeUtility.GetValue(drRelGrpPosData["POS_ID"])
                                                                   , DataTypeUtility.GetValue(drRelGrpPosData["POS_ID_NAME"])
                                                                   , DataTypeUtility.GetValue(drRelGrpPosData["POS_VALUE"])
                                                                   , DataTypeUtility.GetValue(drRelGrpPosData["POS_VALUE_NAME"])
                                                                   , DataTypeUtility.GetValue(drRelGrpPosData["OPT_VALUE"])
                                                                   , create_date
                                                                   , create_user);
                        }
                    }
                }

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

            return((affectedRow > 0) ? true : false);
        }
Пример #9
0
        public string GetKey(string tableName, string columnName)
        {
            Dac_KeyGens keyGen = new Dac_KeyGens();

            return(keyGen.GetCode(tableName, columnName));
        }
Пример #10
0
        public bool AddBoard(string board_category_id
                             , string subject_text
                             , string content_text
                             , int read_count
                             , string attach_no
                             , string p_board_id
                             , string group_id
                             , int level_id
                             , int seq_id
                             , object start_date
                             , object end_date
                             , int menu_ref_id
                             , string pop_up_yn
                             , int write_emp_id
                             , DateTime create_date
                             , int create_user)
        {
            int affectedRow = 0;

            IDbConnection conn = DbAgentHelper.CreateDbConnection();

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

            try
            {
                Dac_KeyGens keyGen   = new Dac_KeyGens();
                string      board_id = keyGen.GetCode(conn, trx, "EST_BOARD");

                affectedRow = _board.Insert(conn
                                            , trx
                                            , board_id.Trim()
                                            , board_category_id
                                            , subject_text
                                            , content_text
                                            , read_count
                                            , attach_no
                                            , p_board_id
                                            , group_id
                                            , level_id
                                            , seq_id
                                            , start_date
                                            , end_date
                                            , menu_ref_id
                                            , pop_up_yn
                                            , write_emp_id
                                            , create_date
                                            , create_user);

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

            return((affectedRow > 0) ? true : false);
        }