示例#1
0
        /// <summary>
        ///  部門詳細の取得

        ///
        /// 使用画面:MstMgmtLevelMnt
        /// </summary>
        public int GetMGMTDetail()
        {
            ComDB         db     = new ComDB(_db_type);
            StringBuilder strSQL = new StringBuilder();
            int           rtn    = 0;

            strSQL.Append(" SELECT                                                                                                      ");
            strSQL.Append(" M.MANAGEMENT_LEVEL,	M.MANAGEMENT_DESCRIPTION,	                             	                            ");
            strSQL.Append(" M.ENTRY_DATE,	    M.UPDATE_DATE,            M.USER_CREATE,            M.USER_UPDATE	                    ");

            strSQL.Append(" FROM MANAGEMENT_MASTER M ");
            //strSQL.Append(" WHERE D.DEPT_CD            = @DEPT_CD");
            strSQL.Append(" WHERE M.MANAGEMENT_LEVEL   = @MGMT_CD");
            db.DbParametersClear();
            db.DbPsetString("@MGMT_CD", _mgmt_cd);
            rtn = db.DbExecuteReader(strSQL.ToString());
            if (rtn == ComConst.FAILED)
            {
                _dbmsg  = db.expmsg;
                _strErr = db.strErr;
            }
            else
            {
                _mgmt_cd   = db.Row("MANAGEMENT_LEVEL");
                _mgmt_desc = db.Row("MANAGEMENT_DESCRIPTION");
            }

            if (db.State() == ConnectionState.Open)
            {
                db.DbClose();
            }
            return(rtn);
        }
示例#2
0
        /// <summary>
        /// 画面ラベル詳細の取得
        /// </summary>
        public int GetScreenLabelDetail()
        {
            ComDB         db     = new ComDB(_db_type);
            StringBuilder strSQL = new StringBuilder();
            int           rtn    = 0;

            //--- sql
            strSQL.Append("SELECT STD_ITEM,");
            strSQL.Append(" ENTRY_DATE, CHG_DATE, CHG_USER_ID,");
            strSQL.Append(" UPDATE_CNTR");
            strSQL.Append(" FROM DICTIONARY_MASTER ");
            if (_db_type == "ORACLE")
            {
                strSQL.Append(" WHERE SCREEN_ID = :SCREEN_ID");
                strSQL.Append("   AND CONTROL_ID = :CONTROL_ID");

                db.DbParametersClear();
                db.DbPsetString("SCREEN_ID", _screen_id);
                db.DbPsetString("CONTROL_ID", _control_id);
            }
            else
            {
                strSQL.Append(" WHERE SCREEN_ID = @SCREEN_ID");
                strSQL.Append("   AND CONTROL_ID = @CONTROL_ID");

                db.DbParametersClear();
                db.DbPsetString("@SCREEN_ID", _screen_id);
                db.DbPsetString("@CONTROL_ID", _control_id);
            }


            rtn = db.DbExecuteReader(strSQL.ToString());
            if (rtn == ComConst.FAILED)
            {
                _dbmsg  = db.expmsg;
                _strErr = db.strErr;
            }
            else
            {
                _std_item    = db.Row("STD_ITEM");
                _entry_date  = DateTime.Parse(db.Row("ENTRY_DATE"));
                _chg_date    = DateTime.Parse(db.Row("CHG_DATE"));
                _chg_user_id = db.Row("CHG_USER_ID");
                _update_cntr = int.Parse(db.Row("UPDATE_CNTR"));
            }
            //if (db.State() == ConnectionState.Open)
            if (db.State() == ConnectionState.Open)
            {
                db.DbClose();
            }

            return(rtn);
        }
示例#3
0
        /// <summary>
        /// 製番検索2のチェック
        ///
        /// <para>使用画面:[MstBOMMnt][MstItemEntry]</para>
        /// </summary>
        public int GetJOC2Detail()
        {
            ComDB         db     = new ComDB(_db_type);
            StringBuilder strSQL = new StringBuilder();
            int           rtn    = 0;

            //--- sql
            strSQL.Append(" SELECT                                                    ");
            strSQL.Append(" J.JOC_CD ,J.JOC_DESC                                      ");
            strSQL.Append(" FROM JOC_MASTER J                                         ");
            if (_db_type == "ORACLE")
            {
                strSQL.Append(" WHERE J.JOC_CD            = :JOC_CD                   ");
                strSQL.Append(" UNION ALL                                             ");
                strSQL.Append(" SELECT                                                ");
                strSQL.Append(" P.JOC_CD ,P.ITEM_NO JOC_DESC                          ");
                strSQL.Append(" FROM PRODUCTION_PLAN P                                ");
                strSQL.Append(" WHERE P.JOC_CD            = :JOC_CD                   ");
                db.DbParametersClear();
                db.DbPsetString("JOC_CD", _joc_cd);
            }
            else
            {
                strSQL.Append(" WHERE J.JOC_CD            = @JOC_CD                   ");
                strSQL.Append(" UNION ALL                                             ");
                strSQL.Append(" SELECT                                                ");
                strSQL.Append(" P.JOC_CD ,P.ITEM_NO JOC_DESC                          ");
                strSQL.Append(" FROM PRODUCTION_PLAN P                                ");
                strSQL.Append(" WHERE P.JOC_CD            = @JOC_CD                   ");
                db.DbParametersClear();
                db.DbPsetString("@JOC_CD", _joc_cd);
            }
            rtn = db.DbExecuteReader(strSQL.ToString());
            if (rtn == ComConst.FAILED)
            {
                _dbmsg  = db.expmsg;
                _strErr = db.strErr;
            }
            else
            {
                _joc_cd   = db.Row("JOC_CD");
                _joc_desc = db.Row("JOC_DESC");
            }
            if (db.State() == ConnectionState.Open)
            {
                db.DbClose();
            }
            return(rtn);
        }
示例#4
0
        /// <summary>
        /// メッセージの取得
        /// </summary>
        public string GetMessage(string msgcd)
        {
            ComDB         db     = new ComDB(_db_type);
            StringBuilder strSQL = new StringBuilder();
            int           rtn    = 0;

            //--- sql
            strSQL.Append("SELECT MSG_DESC, RANK ");
            strSQL.Append(" FROM MESSAGE_MASTER ");
            if (_db_type == "ORACLE")
            {
                strSQL.Append(" WHERE MSG_CD = :MSG_CD");
                strSQL.Append("   AND LANG = :LANG");

                db.DbParametersClear();
                db.DbPsetString("MSG_CD", msgcd);
                db.DbPsetInt("LANG", _lang);
            }
            else
            {
                strSQL.Append(" WHERE MSG_CD = @MSG_CD");
                strSQL.Append("   AND LANG = @LANG");

                db.DbParametersClear();
                db.DbPsetString("@MSG_CD", msgcd);
                db.DbPsetInt("@LANG", _lang);
            }

            rtn = db.DbExecuteReader(strSQL.ToString());
            if (rtn == ComConst.FAILED)
            {
                _dbmsg    = db.expmsg;
                _strErr   = db.strErr;
                _msg_desc = "No Corresponding Message.";
            }
            else
            {
                _msg_desc = db.Row("MSG_DESC");
                _rank     = db.Row("RANK");
            }
            if (db.State() == ConnectionState.Open)
            {
                db.DbClose();
            }

            return(_msg_desc);
        }
示例#5
0
        /// <summary>
        /// ロケーション詳細の取得

        ///
        /// 使用画面:InvStockInq
        /// </summary>
        public int GetLocationDetail()
        {
            ComDB         db     = new ComDB(_db_type);
            StringBuilder strSQL = new StringBuilder();
            int           rtn    = 0;

            //--- sql
            //strSQL.Append(" SELECT ");
            //strSQL.Append(" L.WHS_CD,   L.LOCATION,			L.LOCATION_DESC			                          ");
            //strSQL.Append(" FROM LOCATION_MASTER L                                                ");
            //strSQL.Append(" WHERE L.WHS_CD = @WHS_CD                                              ");
            //strSQL.Append("   AND L.LOCATION = @LOCATION                                          ");
            strSQL.Append("SELECT ");
            strSQL.Append("LOCATION_NO,     LOCATION_NAME,      LOCATION_DESCRIPTION,       DEPT_NO,     	");
            strSQL.Append("ENTRY_DATE,      UPDATE_DATE,        USER_CREATE,               USER_UPDATE     	");
            strSQL.Append(" FROM LOCATION_MASTER L ");
            strSQL.Append(" WHERE L.LOCATION_NO = @LOCATION                                                 ");

            db.DbParametersClear();
            //db.DbPsetString("@WHS_CD", _whs_cd);
            db.DbPsetString("@LOCATION", _location);

            rtn = db.DbExecuteReader(strSQL.ToString());
            if (rtn == ComConst.FAILED)
            {
                _dbmsg  = db.expmsg;
                _strErr = db.strErr;
            }
            else
            {
                //_whs_cd = db.Row("WHS_CD");
                //_location = db.Row("LOCATION");
                //_location_desc = db.Row("LOCATION_DESC");
                _location       = db.Row("LOCATION_NO");
                _location_desc  = db.Row("LOCATION_NAME");
                _location_desc2 = db.Row("LOCATION_DESCRIPTION");
                _dept_no        = db.Row("DEPT_NO");
            }

            if (db.State() == ConnectionState.Open)
            {
                db.DbClose();
            }
            return(rtn);
        }
示例#6
0
        /// <summary>
        /// 営業倉庫詳細の取得

        /// <para>使用画面:[SrchSDMWhs]</para>
        /// </summary>
        public int GetSDMWarehouseDetail()
        {
            ComDB         db     = new ComDB(_db_type);
            StringBuilder strSQL = new StringBuilder();
            int           rtn    = 0;

            //--- sql
            strSQL.Append(" SELECT  *                   ");
            strSQL.Append(" FROM WHS_MST W              ");
            if (_db_type == "ORACLE")
            {
                strSQL.Append(" WHERE W.WHS_CD = :WHS_CD        ");

                db.DbParametersClear();
                db.DbPsetString("WHS_CD", _whs_cd);
            }
            else
            {
                strSQL.Append(" WHERE W.WHS_CD = @WHS_CD        ");

                db.DbParametersClear();
                db.DbPsetString("@WHS_CD", _whs_cd);
            }

            rtn = db.DbExecuteReader(strSQL.ToString());
            if (rtn == ComConst.FAILED)
            {
                _dbmsg  = db.expmsg;
                _strErr = db.strErr;
            }
            else
            {
                _whs_cd        = db.Row("WHS_CD");
                _whs_desc      = db.Row("WHS_NAME");
                _recv_loc      = db.Row("RECV_LOC");
                _whs_type      = int.Parse(db.Row("WHS_TYPE"));
                _whs_item_type = int.Parse(db.Row("WHS_ITEM_TYPE"));
            }

            if (db.State() == ConnectionState.Open)
            {
                db.DbClose();
            }
            return(rtn);
        }
示例#7
0
        /// <summary>
        /// 資源ダウン理由明細の取得

        ///
        /// 使用画面:
        /// </summary>
        public int GetDetail()
        {
            ComDB         db     = new ComDB(_db_type);
            StringBuilder strSQL = new StringBuilder();
            int           rtn    = 0;

            //--- sql
            strSQL.Append("SELECT                                                                        ");
            strSQL.Append("D.RESOURCE_CD,		    R.RESOURCE_DESC,		    D.DOWN_REASON_CD,        ");
            strSQL.Append("D.DOWN_REASON_DESC                                                            ");

            strSQL.Append(" FROM DOWN_REASON_MASTER D                                        ");
            strSQL.Append(" LEFT JOIN RESOURCE_MASTER R ON D.RESOURCE_CD = R.RESOURCE_CD     ");
            strSQL.Append(" WHERE D.RESOURCE_CD = @RESOURCE_CD  ");
            strSQL.Append(" AND D.DOWN_REASON_CD = @DOWN_REASON_CD ");

            db.DbParametersClear();
            db.DbPsetString("@RESOURCE_CD", _resource_cd);
            db.DbPsetString("@DOWN_REASON_CD", _down_reason_cd);

            rtn = db.DbExecuteReader(strSQL.ToString());
            if (rtn == ComConst.FAILED)
            {
                _dbmsg  = db.expmsg;
                _strErr = db.strErr;
            }
            else
            {
                _resource_cd      = db.Row("RESOURCE_CD");
                _resource_desc    = db.Row("RESOURCE_DESC");
                _down_reason_cd   = db.Row("DOWN_REASON_CD");
                _down_reason_desc = db.Row("DOWN_REASON_DESC");
            }
            if (db.State() == ConnectionState.Open)
            {
                db.DbClose();
            }
            return(rtn);
        }
示例#8
0
        /// <summary>
        /// メッセージ詳細の取得
        /// </summary>
        public int GetMessageDetail()
        {
            ComDB         db     = new ComDB(_db_type);
            StringBuilder strSQL = new StringBuilder();
            int           rtn    = 0;

            //--- sql
            strSQL.Append("SELECT MSG_DESC, RANK, ");
            strSQL.Append(" ENTRY_DATE, CHG_DATE, CHG_USER_ID,");
            strSQL.Append(" UPDATE_CNTR");
            strSQL.Append(" FROM MESSAGE_MASTER ");
            if (_db_type == "ORACLE")
            {
                strSQL.Append(" WHERE MSG_CD = :MSG_CD");
                strSQL.Append("   AND LANG = :LANG");

                db.DbParametersClear();
                db.DbPsetString("MSG_CD", _msg_cd);
                db.DbPsetInt("LANG", _lang);
            }
            else
            {
                strSQL.Append(" WHERE MSG_CD = @MSG_CD");
                strSQL.Append("   AND LANG = @LANG");

                db.DbParametersClear();
                db.DbPsetString("@MSG_CD", _msg_cd);
                db.DbPsetInt("@LANG", _lang);
            }

            rtn = db.DbExecuteReader(strSQL.ToString());
            if (rtn == ComConst.FAILED)
            {
                _dbmsg  = db.expmsg;
                _strErr = db.strErr;
            }
            else
            {
                _msg_desc    = db.Row("MSG_DESC");
                _rank        = db.Row("RANK");
                _entry_date  = DateTime.Parse(db.Row("ENTRY_DATE"));
                _chg_date    = DateTime.Parse(db.Row("CHG_DATE"));
                _chg_user_id = db.Row("CHG_USER_ID");
                _update_cntr = int.Parse(db.Row("UPDATE_CNTR"));
            }
            if (db.State() == ConnectionState.Open)
            {
                db.DbClose();
            }

            return(rtn);
        }
示例#9
0
        public int whs_nameSelect()
        {
            ComDB         db     = new ComDB(_db_type);
            StringBuilder strSQL = new StringBuilder();
            int           rtn    = 0;

            //sql
            strSQL.Append("SELECT ");
            strSQL.Append("WHS_CD,			    WHS_DESC	");
            strSQL.Append(" FROM WAREHOUSE_MASTER ");
            if (_db_type == "ORACLE")
            {
                strSQL.Append(" WHERE WHS_CD              = :WHS_CD");

                db.DbParametersClear();
                db.DbPsetString("WHS_CD", _whs_cd);
            }
            else
            {
                strSQL.Append(" WHERE WHS_CD = @WHS_CD");

                db.DbParametersClear();
                db.DbPsetString("@WHS_CD", _whs_cd);
            }

            rtn = db.DbExecuteReader(strSQL.ToString());
            if (rtn == ComConst.FAILED)
            {
                _dbmsg  = db.expmsg;
                _strErr = db.strErr;
            }
            else
            {
                _whs_desc = db.Row("WHS_DESC");
            }

            if (db.State() == ConnectionState.Open)
            {
                db.DbClose();
            }
            return(rtn);
        }
示例#10
0
        //--> ADD BY UBIQ-SUO 2010/9/17
        /// <summary>
        /// 获取系统日期以后最开始的歴日
        /// </summary>
        /// <param name="flag"></param>
        /// <returns></returns>
        public int GetMinCalendardate()
        {
            ComDB         db     = new ComDB(_db_type);
            StringBuilder strSQL = new StringBuilder();
            int           rtn    = 0;

            db.DbParametersClear();
            //--- sql
            strSQL.Append("SELECT                                                           ");
            strSQL.Append("MIN(CALENDAR_DATE)  CALENDAR_DATE   FROM CALENDAR_MASTER         ");

            if (_db_type == "ORACLE")
            {
                strSQL.Append("WHERE CALENDAR_DATE > TO_CHAR(SYSDATE,'YYYYMMDD')                ");
                strSQL.Append("AND PO_RLS_FLAG = 1                                              ");
            }
            else
            {
                strSQL.Append("WHERE CALENDAR_DATE > CONVERT(VARCHAR(30),GETDATE(),112)         ");
                strSQL.Append("AND PO_RLS_FLAG = 1        ");
            }

            rtn = db.DbExecuteReader(strSQL.ToString());
            if (rtn == ComConst.FAILED)
            {
                _dbmsg  = db.expmsg;
                _strErr = db.strErr;
            }
            else
            {
                _calendar_date = int.Parse(db.Row("CALENDAR_DATE"));
            }

            if (db.State() == ConnectionState.Open)
            {
                db.DbClose();
            }
            return(rtn);
        }
示例#11
0
        /// <summary>
        /// 工程NG理由明細の取得

        ///
        /// 使用画面:
        /// </summary>
        public int GetDetail()
        {
            ComDB         db     = new ComDB(_db_type);
            StringBuilder strSQL = new StringBuilder();
            int           rtn    = 0;

            //--- sql
            strSQL.Append("SELECT                                                                        ");
            strSQL.Append("D.WS_CD,	R.WS_DESC, D.PROCESS_CD, P.PROCESS_DESC, D.NG_REASON_CD,        ");
            strSQL.Append("D.NG_REASON_DESC                                                         ");

            strSQL.Append(" FROM PROCESS_NG_REASON_MASTER D                                        ");
            strSQL.Append(" LEFT JOIN WORKSHOP_MASTER R ON D.WS_CD = R.WS_CD     ");
            strSQL.Append(" LEFT JOIN PROCESS_MASTER P ON D.WS_CD = P.WS_CD AND D.PROCESS_CD = P.PROCESS_CD     ");
            strSQL.Append(" WHERE D.WS_CD = @WS_CD  ");
            strSQL.Append("   AND D.PROCESS_CD = @PROCESS_CD  ");
            strSQL.Append("   AND D.NG_REASON_CD = @NG_REASON_CD ");

            db.DbParametersClear();
            db.DbPsetString("@WS_CD", _ws_cd);
            db.DbPsetString("@PROCESS_CD", _process_cd);
            db.DbPsetString("@NG_REASON_CD", _ng_reason_cd);

            rtn = db.DbExecuteReader(strSQL.ToString());
            if (rtn == ComConst.FAILED)
            {
                _dbmsg  = db.expmsg;
                _strErr = db.strErr;
            }
            else
            {
                _ws_cd          = db.Row("WS_CD");
                _ws_desc        = db.Row("WS_DESC");
                _process_cd     = db.Row("PROCESS_CD");
                _process_desc   = db.Row("PROCESS_DESC");
                _ng_reason_cd   = db.Row("NG_REASON_CD");
                _ng_reason_desc = db.Row("NG_REASON_DESC");
            }
            if (db.State() == ConnectionState.Open)
            {
                db.DbClose();
            }
            return(rtn);
        }
示例#12
0
        /// <summary>
        /// 获取某月第一周的TTL_WEEK
        /// </summary>
        /// <param name="flag"></param>
        /// <returns></returns>
        public int GetMonthFirstWeek()
        {
            ComDB         db     = new ComDB(_db_type);
            StringBuilder strSQL = new StringBuilder();
            int           rtn    = 0;

            db.DbParametersClear();
            //--- sql
            strSQL.Append("SELECT                                                           ");
            strSQL.Append("CALENDAR_DATE,   CALENDAR_CYM,   WEEK_NO,		DAY_OF_WEEK,    ");
            strSQL.Append("HOLIDAY_FLAG,    PO_RLS_FLAG,    TTL_WORK_DAYS,  CALENDAR_ID,    ");
            strSQL.Append("TTL_DAYS,        TTL_WEEK,       STD_WORKING_HOUR,               ");
            strSQL.Append("CHG_PGM,         CHG_USERID,     UPDATE_CNTR                     ");
            if (_db_type == "ORACLE")
            {
                strSQL.Append(" FROM CALENDAR_MASTER                                                ");
                strSQL.Append(" WHERE CALENDAR_ID = :CALENDAR_ID                                    ");
                strSQL.Append(" AND CALENDAR_DATE = (SELECT MIN(CALENDAR_DATE) FROM CALENDAR_MASTER ");
                strSQL.Append(" WHERE CALENDAR_ID = :CALENDAR_ID AND DAY_OF_WEEK = :DAY_OF_WEEK     ");
                strSQL.Append(" AND CALENDAR_CYM = :CALENDAR_CYM)                                   ");

                db.DbParametersClear();
                db.DbPsetString("CALENDAR_ID", _calendar_id);
                db.DbPsetInt("DAY_OF_WEEK", _day_of_week);
                db.DbPsetInt("CALENDAR_CYM", _calendar_cym);
            }
            else
            {
                strSQL.Append(" FROM CALENDAR_MASTER                                                ");
                strSQL.Append(" WHERE CALENDAR_ID = @CALENDAR_ID                                    ");
                strSQL.Append(" AND CALENDAR_DATE = (SELECT MIN(CALENDAR_DATE) FROM CALENDAR_MASTER ");
                strSQL.Append(" WHERE CALENDAR_ID = @CALENDAR_ID AND DAY_OF_WEEK = @DAY_OF_WEEK     ");
                strSQL.Append(" AND CALENDAR_CYM = @CALENDAR_CYM)                                   ");

                db.DbPsetString("@CALENDAR_ID", _calendar_id);
                db.DbPsetInt("@DAY_OF_WEEK", _day_of_week);
                db.DbPsetInt("@CALENDAR_CYM", _calendar_cym);
            }

            rtn = db.DbExecuteReader(strSQL.ToString());
            if (rtn == ComConst.FAILED)
            {
                _dbmsg  = db.expmsg;
                _strErr = db.strErr;
            }
            else
            {
                _calendar_date    = int.Parse(db.Row("CALENDAR_DATE"));
                _calendar_cym     = int.Parse(db.Row("CALENDAR_CYM"));
                _week_no          = int.Parse(db.Row("WEEK_NO"));
                _day_of_week      = int.Parse(db.Row("DAY_OF_WEEK"));
                _holiday_flag     = int.Parse(db.Row("HOLIDAY_FLAG"));
                _po_rls_flag      = int.Parse(db.Row("PO_RLS_FLAG"));
                _ttl_work_days    = int.Parse(db.Row("TTL_WORK_DAYS"));
                _ttl_days         = int.Parse(db.Row("TTL_DAYS"));
                _ttl_week         = int.Parse(db.Row("TTL_WEEK"));
                _std_working_hour = double.Parse(db.Row("STD_WORKING_HOUR"));
                _chg_pgm          = db.Row("CHG_PGM");
                _update_cntr      = int.Parse(db.Row("UPDATE_CNTR"));
            }

            if (db.State() == ConnectionState.Open)
            {
                db.DbClose();
            }
            return(rtn);
        }
示例#13
0
        /// <summary>
        /// 仕様別段取条件マスタ詳細の取得

        ///
        /// 使用画面:MstSpecSetupMnt
        /// </summary>
        public int GetSpecSetupDetail()
        {
            ComDB         db     = new ComDB(_db_type);
            StringBuilder strSQL = new StringBuilder();
            int           rtn    = 0;

            //--- sql
            strSQL.Append("SELECT                                                                                            ");
            strSQL.Append(" SSM.RESOURCE_CD, R.RESOURCE_DESC,SSM.SPEC_CD,  S1.DATA_CHAR AS SPEC_DESC,                        ");
            strSQL.Append(" SSM.PREV_SPEC_CD,S2.DATA_CHAR AS PREV_SPEC_DESC, SSM.SETUP_TIME                                  ");
            if (_db_type == "ORACLE")
            {
                db.DbParametersClear();

                strSQL.Append(" FROM SPEC_SETUP_MASTER SSM                                                                   ");
                strSQL.Append(" LEFT OUTER JOIN RESOURCE_MASTER R ON SSM.RESOURCE_CD = R.RESOURCE_CD                         ");
                strSQL.Append(" LEFT OUTER JOIN SYSTEM_PARAMETER S1 ON SSM.SPEC_CD = S1.KEY02 AND S1.KEY01 ='SPEC_CD'        ");
                strSQL.Append(" LEFT OUTER JOIN SYSTEM_PARAMETER S2 ON SSM.PREV_SPEC_CD = S2.KEY02 AND S2.KEY01 ='SPEC_CD'   ");
                strSQL.Append(" WHERE                                                                                        ");
                strSQL.Append(" ISM.RESOURCE_CD = :RESOURCE_CD                                                               ");
                strSQL.Append(" AND ISM.SPEC_NO = :SPEC_NO                                                                   ");
                strSQL.Append(" AND ISM.PREV_SPEC_NO = :PREV_SPEC_NO                                                         ");

                db.DbPsetString("RESOURCE_CD", _resource_cd);
                db.DbPsetString("SPEC_NO", _spec_no);
                db.DbPsetString("PREV_SPEC_NO", _prev_spec_no);
            }
            else
            {
                db.DbParametersClear();

                strSQL.Append(" FROM SPEC_SETUP_MASTER SSM                                                                  ");
                strSQL.Append(" LEFT OUTER JOIN RESOURCE_MASTER R ON SSM.RESOURCE_CD = R.RESOURCE_CD                        ");
                strSQL.Append(" LEFT OUTER JOIN SYSTEM_PARAMETER S1 ON SSM.SPEC_CD = S1.KEY02 AND S1.KEY01 = 'SPEC_CD'      ");
                strSQL.Append(" LEFT OUTER JOIN SYSTEM_PARAMETER S2 ON SSM.PREV_SPEC_CD = S2.KEY02 AND S2.KEY01 = 'SPEC_CD' ");
                strSQL.Append(" WHERE                                                                                       ");
                strSQL.Append(" SSM.RESOURCE_CD = @RESOURCE_CD                                                              ");
                strSQL.Append(" AND SSM.SPEC_CD = @SPEC_CD                                                                  ");
                strSQL.Append(" AND SSM.PREV_SPEC_CD = @PREV_SPEC_CD                                                        ");

                db.DbPsetString("@RESOURCE_CD", _resource_cd);
                db.DbPsetString("@SPEC_CD", _spec_no);
                db.DbPsetString("@PREV_SPEC_CD", _prev_spec_no);
            }

            rtn = db.DbExecuteReader(strSQL.ToString());
            if (rtn == ComConst.FAILED)
            {
                _dbmsg  = db.expmsg;
                _strErr = db.strErr;
            }//SETUP_SPEC
            else
            {
                _resource_cd    = db.Row("RESOURCE_CD");
                _resource_desc  = db.Row("RESOURCE_DESC");
                _spec_desc      = db.Row("SPEC_CD");
                _prev_spec_no   = db.Row("PREV_SPEC_CD");
                _setup_time     = double.Parse(db.Row("SETUP_TIME"));
                _spec_desc      = db.Row("SPEC_DESC");
                _prev_spec_desc = db.Row("PREV_SPEC_DESC");
            }

            if (db.State() == ConnectionState.Open)
            {
                db.DbClose();
            }
            return(rtn);
        }
示例#14
0
        /// <summary>
        /// JOCの取得

        ///
        /// 使用画面:Mst JOCMnt
        /// </summary>
        public int GetJOCDetail()
        {
            ComDB         db     = new ComDB(_db_type);
            StringBuilder strSQL = new StringBuilder();
            int           rtn    = 0;

            //--- sql
            strSQL.Append("SELECT                                                                             ");
            strSQL.Append("J.JOC_CD     ,         J.BEG_EFF_DATE   ,          J.END_EFF_DATE ,                ");
            strSQL.Append("J.JOC_STATUS ,         J.JOC_TYPE ,                                                ");
            strSQL.Append("J.JOC_DESC   ,         J.JOC_DESC2 ,                                               ");
            strSQL.Append("J.COST_CENTER,         J.WS_CD ,                                                   ");
            strSQL.Append("J.PROCESS_CD,			 J.CHG_PGM,			J.CHG_USERID, J.ENTRY_DATE,              ");
            strSQL.Append("J.UPDATE_CNTR,         J.CHG_DATE ,                                                ");
            strSQL.Append("W.WS_DESC AS WS_DESC ,                                                             ");
            strSQL.Append("D.DEPT_DESC1 AS COST_CENTER_DESC                                                    ");
            if (_db_type == "ORACLE")
            {
                strSQL.Append(" FROM JOC_MASTER J, WORKSHOP_MASTER W, SYSTEM_PARAMETER S ,   ");
                strSQL.Append(" WHERE J.JOC_CD            = :JOC_CD                          ");
                strSQL.Append("   AND J.WS_CD             = W.WS_CD (+)                      ");
                strSQL.Append("   AND J.COST_CENTER       = S.KEY02 (+)                      ");
                strSQL.Append("   AND S.KEY01             = 'COST_CENTER'                    ");


                db.DbParametersClear();
                db.DbPsetString("JOC_CD", _joc_cd);
            }
            else
            {
                strSQL.Append("  FROM JOC_MASTER J ");
                strSQL.Append(" LEFT OUTER JOIN WORKSHOP_MASTER W  ON J.WS_CD  = W.WS_CD         ");
                strSQL.Append(" LEFT OUTER JOIN DEPT_MASTER D ON J.COST_CENTER =D.DEPT_CD        ");
                strSQL.Append(" WHERE J.JOC_CD = @JOC_CD                                         ");

                db.DbParametersClear();
                db.DbPsetString("@JOC_CD", _joc_cd);
            }
            rtn = db.DbExecuteReader(strSQL.ToString());
            if (rtn == ComConst.FAILED)
            {
                _dbmsg  = db.expmsg;
                _strErr = db.strErr;
            }
            else
            {
                _joc_cd           = db.Row("JOC_CD");
                _beg_eff_date     = int.Parse(db.Row("BEG_EFF_DATE"));
                _end_eff_date     = int.Parse(db.Row("END_EFF_DATE"));
                _joc_status       = int.Parse(db.Row("JOC_STATUS"));
                _joc_type         = int.Parse(db.Row("JOC_TYPE"));
                _joc_desc         = db.Row("JOC_DESC");
                _joc_desc2        = db.Row("JOC_DESC2");
                _cost_center      = db.Row("COST_CENTER");
                _ws_cd            = db.Row("WS_CD");
                _process_cd       = db.Row("PROCESS_CD");
                _ws_desc          = db.Row("WS_DESC");
                _cost_center_desc = db.Row("COST_CENTER_DESC");

                _entry_date  = DateTime.Parse(db.Row("ENTRY_DATE"));
                _chg_date    = DateTime.Parse(db.Row("CHG_DATE"));
                _chg_pgm     = db.Row("CHG_PGM");
                _chg_user_id = db.Row("CHG_USERID");
                _update_cntr = int.Parse(db.Row("UPDATE_CNTR"));
            }
            if (db.State() == ConnectionState.Open)
            {
                db.DbClose();
            }
            return(rtn);
        }
示例#15
0
        /// <summary>
        /// 仕入先詳細の取得

        ///
        /// 使用画面:MstVendorMnt
        /// </summary>
        public int GetCustomerDetail()
        {
            ComDB         db     = new ComDB(_db_type);
            StringBuilder strSQL = new StringBuilder();
            int           rtn    = 0;

            //--- sql
            strSQL.Append("SELECT ");
            strSQL.Append("C.CUST_CD,			C.CUST_SUB_CD,	");
            strSQL.Append("C.CUST_NAME,			C.CUST_DESC,        C.CUST_NAME2,		C.CUST_DESC2,	");
            strSQL.Append("C.COUNTRY_CD,		C.FOREIGN_FLAG,	    C.CUR_CD,	        C.SHIP_WHS,		");
            strSQL.Append("C.TRANS_LT,		    C.SHIP_SLIP_TYPE,	C.PAY_TERMS, 	    W.WHS_DESC,     ");
            strSQL.Append("C.EVAL_RATIO,   		C.CUST_ATTN,    	C.TELNO,      	    C.FAXNO,  		");
            strSQL.Append("C.ZIP_CD,         	C.STATE,          	C.ADDRESS1,      	C.ADDRESS2,  	");
            strSQL.Append("C.ADDRESS3,         	C.ADDRESS4,         C.STATE2,          	C.ADDRESS2_1,   ");
            strSQL.Append("C.ADDRESS2_2,        C.ADDRESS2_3,       C.ADDRESS2_4,                       ");
            strSQL.Append("C.DATA_CHAR1,		C.DATA_CHAR2,			                                ");
            strSQL.Append("C.DATA_CHAR3,		C.DATA_CHAR4,		C.DATA_CHAR5,		C.DATA_CHAR6,	");
            strSQL.Append("C.DATA_CHAR7,		C.DATA_CHAR8,		C.DATA_CHAR9,		C.DATA_CHAR10,	");
            strSQL.Append("C.DATA_NUM1,			C.DATA_NUM2,		C.DATA_NUM3,		C.DATA_NUM4,	");
            strSQL.Append("C.DATA_NUM5,			C.DATA_NUM6,		C.DATA_NUM7,		C.DATA_NUM8,	");
            strSQL.Append("C.DATA_NUM9,			C.DATA_NUM10,		C.DATA_FLAG1,		C.DATA_FLAG2,	");
            strSQL.Append("C.DATA_FLAG3,		C.DATA_FLAG4,		C.DATA_FLAG5,		C.DATA_FLAG6,	");
            strSQL.Append("C.DATA_FLAG7,		C.DATA_FLAG8,		C.DATA_FLAG9,		C.DATA_FLAG10,	");
            strSQL.Append("C.CHG_PGM,			C.CHG_USERID,			                                ");
            strSQL.Append("C.UPDATE_CNTR,       S.DATA_CHAR CUR_DESC                                    ");
            if (_db_type == "ORACLE")
            {
                strSQL.Append(" FROM CUSTOMER_MASTER C, WAREHOUSE_MASTER W");
                strSQL.Append(" WHERE C.CUST_CD = :CUST_CD");
                strSQL.Append(" AND C.CUST_SUB_CD = :CUST_SUB_CD");
                strSQL.Append(" AND C.SHIP_WHS = W.WHS_CD(+)");
                db.DbParametersClear();
                db.DbPsetString("CUST_CD", _cust_cd);
                db.DbPsetString("CUST_SUB_CD", _cust_sub_cd);
            }
            else
            {
                strSQL.Append(" FROM CUSTOMER_MASTER C ");
                strSQL.Append(" LEFT OUTER JOIN WAREHOUSE_MASTER W ON C.SHIP_WHS = W.WHS_CD                         ");
                strSQL.Append(" LEFT OUTER JOIN SYSTEM_PARAMETER S ON S.KEY01 = 'CURRENCY_CD' AND KEY02 = C.CUR_CD  ");
                strSQL.Append(" WHERE CUST_CD = @CUST_CD");
                strSQL.Append(" AND CUST_SUB_CD = @CUST_SUB_CD");
                db.DbParametersClear();
                db.DbPsetString("@CUST_CD", _cust_cd);
                db.DbPsetString("@CUST_SUB_CD", _cust_sub_cd);
            }

            rtn = db.DbExecuteReader(strSQL.ToString());
            if (rtn == ComConst.FAILED)
            {
                _dbmsg  = db.expmsg;
                _strErr = db.strErr;
            }
            else
            {
                _cust_cd        = db.Row("CUST_CD");
                _cust_sub_cd    = db.Row("CUST_SUB_CD");
                _cust_name      = db.Row("CUST_NAME");
                _cust_desc      = db.Row("CUST_DESC");
                _cust_name2     = db.Row("CUST_NAME2");
                _cust_desc2     = db.Row("CUST_DESC2");
                _country_cd     = db.Row("COUNTRY_CD");
                _foreign_flag   = int.Parse(db.Row("FOREIGN_FLAG"));
                _cur_cd         = db.Row("CUR_CD");
                _ship_whs       = db.Row("SHIP_WHS");
                _ship_whs_desc  = db.Row("WHS_DESC");
                _trans_lt       = int.Parse(db.Row("TRANS_LT"));
                _ship_slip_type = db.Row("SHIP_SLIP_TYPE");
                //_po_slip_type = db.Row("PO_SLIP_TYPE");
                //_fcst_flag = int.Parse(db.Row("FCST_FLAG"));
                _eval_ratio  = double.Parse(db.Row("EVAL_RATIO"));
                _pay_terms   = db.Row("PAY_TERMS");
                _cust_attn   = db.Row("CUST_ATTN");
                _telno       = db.Row("TELNO");
                _faxno       = db.Row("FAXNO");
                _zip_cd      = db.Row("ZIP_CD");
                _state       = db.Row("STATE");
                _address1    = db.Row("ADDRESS1");
                _address2    = db.Row("ADDRESS2");
                _address3    = db.Row("ADDRESS3");
                _address4    = db.Row("ADDRESS4");
                _state2      = db.Row("STATE2");
                _address2_1  = db.Row("ADDRESS2_1");
                _address2_2  = db.Row("ADDRESS2_2");
                _address2_3  = db.Row("ADDRESS2_3");
                _address2_4  = db.Row("ADDRESS2_4");
                _data_char1  = db.Row("DATA_CHAR1");
                _data_char2  = db.Row("DATA_CHAR2");
                _data_char3  = db.Row("DATA_CHAR3");
                _data_char4  = db.Row("DATA_CHAR4");
                _data_char5  = db.Row("DATA_CHAR5");
                _data_char6  = db.Row("DATA_CHAR6");
                _data_char7  = db.Row("DATA_CHAR7");
                _data_char8  = db.Row("DATA_CHAR8");
                _data_char9  = db.Row("DATA_CHAR9");
                _data_char10 = db.Row("DATA_CHAR10");
                _data_num1   = double.Parse(db.Row("DATA_NUM1"));
                _data_num2   = double.Parse(db.Row("DATA_NUM2"));
                _data_num3   = double.Parse(db.Row("DATA_NUM3"));
                _data_num4   = double.Parse(db.Row("DATA_NUM4"));
                _data_num5   = double.Parse(db.Row("DATA_NUM5"));
                _data_num6   = double.Parse(db.Row("DATA_NUM6"));
                _data_num7   = double.Parse(db.Row("DATA_NUM7"));
                _data_num8   = double.Parse(db.Row("DATA_NUM8"));
                _data_num9   = double.Parse(db.Row("DATA_NUM9"));
                _data_num10  = double.Parse(db.Row("DATA_NUM10"));
                _data_flag1  = int.Parse(db.Row("DATA_FLAG1"));
                _data_flag2  = int.Parse(db.Row("DATA_FLAG2"));
                _data_flag3  = int.Parse(db.Row("DATA_FLAG3"));
                _data_flag4  = int.Parse(db.Row("DATA_FLAG4"));
                _data_flag5  = int.Parse(db.Row("DATA_FLAG5"));
                _data_flag6  = int.Parse(db.Row("DATA_FLAG6"));
                _data_flag7  = int.Parse(db.Row("DATA_FLAG7"));
                _data_flag8  = int.Parse(db.Row("DATA_FLAG8"));
                _data_flag9  = int.Parse(db.Row("DATA_FLAG9"));
                _data_flag10 = int.Parse(db.Row("DATA_FLAG10"));
                _cur_desc    = db.Row("CUR_DESC");
                //_entry_date = DateTime.Parse(db.Row("ENTRY_DATE"));
                //_chg_date = DateTime.Parse(db.Row("CHG_DATE"));
                _chg_pgm     = db.Row("CHG_PGM");
                _chg_userid  = db.Row("CHG_USERID");
                _update_cntr = int.Parse(db.Row("UPDATE_CNTR"));
            }

            if (db.State() == ConnectionState.Open)
            {
                db.DbClose();
            }
            return(rtn);
        }
示例#16
0
        /// <summary>
        /// 辞書詳細の取得
        ///
        /// 使用画面:AppUserMenu, MstDicMnt
        /// </summary>
        public int GetDictionaryDetail()
        {
            ComDB         db     = new ComDB(_db_type);
            StringBuilder strSQL = new StringBuilder();
            int           rtn    = 0;

            //--- sql
            strSQL.Append("SELECT ITEM_DESC1, ITEM_DESC2, ITEM_DESC3, ITEM_DESC4,");

            switch (_lang)
            {
            case 2:
                strSQL.Append(" ITEM_DESC2 AS ITEM_DESC, ");
                break;

            case 3:
                strSQL.Append(" ITEM_DESC3 AS ITEM_DESC, ");
                break;

            case 4:
                strSQL.Append(" ITEM_DESC4 AS ITEM_DESC, ");
                break;

            default:
                strSQL.Append(" ITEM_DESC1 AS ITEM_DESC, ");
                break;
            }

            strSQL.Append(" ENTRY_DATE, CHG_DATE, CHG_USER_ID,");
            strSQL.Append(" UPDATE_CNTR");
            strSQL.Append(" FROM DICTIONARY_MASTER ");

            if (_db_type == "ORACLE")
            {
                strSQL.Append(" WHERE STD_ITEM = :STD_ITEM");

                db.DbParametersClear();
                db.DbPsetString("STD_ITEM", _std_item);
            }
            else
            {
                strSQL.Append(" WHERE STD_ITEM = @STD_ITEM");

                db.DbParametersClear();
                db.DbPsetString("@STD_ITEM", _std_item);
            }


            rtn = db.DbExecuteReader(strSQL.ToString());
            if (rtn == ComConst.FAILED)
            {
                _dbmsg  = db.expmsg;
                _strErr = db.strErr;
            }
            else
            {
                _item_desc1  = db.Row("ITEM_DESC1");
                _item_desc2  = db.Row("ITEM_DESC2");
                _item_desc3  = db.Row("ITEM_DESC3");
                _item_desc4  = db.Row("ITEM_DESC4");
                _item_desc   = db.Row("ITEM_DESC");
                _entry_date  = DateTime.Parse(db.Row("ENTRY_DATE"));
                _chg_date    = DateTime.Parse(db.Row("CHG_DATE"));
                _chg_user_id = db.Row("CHG_USER_ID");
                _update_cntr = int.Parse(db.Row("UPDATE_CNTR"));
            }

            if (db.State() == ConnectionState.Open)
            {
                db.DbClose();
            }
            return(rtn);
        }
示例#17
0
        /// <summary>
        /// 工程詳細の取得
        ///
        /// 使用画面:MstProcessMnt
        /// </summary>
        public int GetProcessDetail()
        {
            ComDB         db     = new ComDB(_db_type);
            StringBuilder strSQL = new StringBuilder();
            int           rtn    = 0;

            //--- sql
            strSQL.Append("SELECT ");
            strSQL.Append("P.WS_CD,			    P.PROCESS_CD,		P.PROCESS_DESC,	    P.PROCESS_DESC2,    P.COST_CENTER,");
            strSQL.Append("P.SC_FLAG,			P.VENDOR_CD,        P.CAPA_MH,  	    P.TIME_CONSTRAINT,  P.DATA_CHAR1,		P.DATA_CHAR2, ");
            strSQL.Append("P.DATA_CHAR3,		P.DATA_CHAR4,		P.DATA_CHAR5,		P.DATA_CHAR6,			");
            strSQL.Append("P.DATA_CHAR7,		P.DATA_CHAR8,		P.DATA_CHAR9,		P.DATA_CHAR10,  		");
            strSQL.Append("P.DATA_NUM1,			P.DATA_NUM2,		P.DATA_NUM3,		P.DATA_NUM4,			");
            strSQL.Append("P.DATA_NUM5,			P.DATA_NUM6,		P.DATA_NUM7,		P.DATA_NUM8,			");
            strSQL.Append("P.DATA_NUM9,			P.DATA_NUM10,		P.DATA_FLAG1,		P.DATA_FLAG2,			");
            strSQL.Append("P.DATA_FLAG3,		P.DATA_FLAG4,		P.DATA_FLAG5,		P.DATA_FLAG6,			");
            strSQL.Append("P.DATA_FLAG7,		P.DATA_FLAG8,		P.DATA_FLAG9,		P.DATA_FLAG10,	    	");
            strSQL.Append("P.ENTRY_DATE,		P.CHG_DATE,			P.CHG_PGM,			P.CHG_USERID,			");
            strSQL.Append("P.UPDATE_CNTR,       V.VENDOR_NAME,                                                  ");
            strSQL.Append("W.WS_DESC                                      ");   // IMV3
            //strSQL.Append("S.DATA_CHAR AS COST_CENTER_NAME,        V.VENDOR_NAME  ");
            if (_db_type == "ORACLE")
            {
                strSQL.Append(" FROM PROCESS_MASTER P, SYSTEM_PARAMETER S, VENDOR_MASTER V");
                strSQL.Append(" WHERE P.WS_CD              = :WS_CD");
                //strSQL.Append(" AND P.PROCESS_CD          = :PROCESS_CD");
                //strSQL.Append("   AND P.COST_CENTER         = S.KEY02(+)");
                strSQL.Append("   AND S.KEY01         = 'COST_CENTER'");
                strSQL.Append("   AND P.VENDOR_CD           = V.VENDOR_CD(+)");

                db.DbParametersClear();
                db.DbPsetString("WS_CD", _ws_cd);
                db.DbPsetString("PROCESS_CD", _process_cd);
            }
            else
            {
                strSQL.Append(" FROM PROCESS_MASTER P ");
                //strSQL.Append(" LEFT OUTER JOIN SYSTEM_PARAMETER S ON S.KEY01 = 'COST_CENTER' AND P.COST_CENTER = S.KEY02 ");
                strSQL.Append(" LEFT OUTER JOIN VENDOR_MASTER V ON P.VENDOR_CD = V.VENDOR_CD");
                strSQL.Append(" LEFT OUTER JOIN WORKSHOP_MASTER W ON W.WS_CD = P.WS_CD");
                strSQL.Append(" WHERE P.WS_CD = @WS_CD AND P.PROCESS_CD = @PROCESS_CD ");

                db.DbParametersClear();
                db.DbPsetString("@WS_CD", _ws_cd);
                db.DbPsetString("@PROCESS_CD", _process_cd);
            }

            rtn = db.DbExecuteReader(strSQL.ToString());
            if (rtn == ComConst.FAILED)
            {
                _dbmsg  = db.expmsg;
                _strErr = db.strErr;
            }
            else
            {
                _ws_cd           = db.Row("WS_CD");
                _process_cd      = db.Row("PROCESS_CD");
                _process_desc    = db.Row("PROCESS_DESC");
                _process_desc2   = db.Row("PROCESS_DESC2");
                _cost_center     = db.Row("COST_CENTER");
                _sc_flag         = int.Parse(db.Row("SC_FLAG"));
                _vendor_cd       = db.Row("VENDOR_CD");
                _capa_mh         = double.Parse(db.Row("CAPA_MH"));
                _time_constraint = db.Row("TIME_CONSTRAINT");   // IMV3
                _data_char1      = db.Row("DATA_CHAR1");
                _data_char2      = db.Row("DATA_CHAR2");
                _data_char3      = db.Row("DATA_CHAR3");
                _data_char4      = db.Row("DATA_CHAR4");
                _data_char5      = db.Row("DATA_CHAR5");
                _data_char6      = db.Row("DATA_CHAR6");
                _data_char7      = db.Row("DATA_CHAR7");
                _data_char8      = db.Row("DATA_CHAR8");
                _data_char9      = db.Row("DATA_CHAR9");
                _data_char10     = db.Row("DATA_CHAR10");
                _data_num1       = double.Parse(db.Row("DATA_NUM1"));
                _data_num2       = double.Parse(db.Row("DATA_NUM2"));
                _data_num3       = double.Parse(db.Row("DATA_NUM3"));
                _data_num4       = double.Parse(db.Row("DATA_NUM4"));
                _data_num5       = double.Parse(db.Row("DATA_NUM5"));
                _data_num6       = double.Parse(db.Row("DATA_NUM6"));
                _data_num7       = double.Parse(db.Row("DATA_NUM7"));
                _data_num8       = double.Parse(db.Row("DATA_NUM8"));
                _data_num9       = double.Parse(db.Row("DATA_NUM9"));
                _data_num10      = double.Parse(db.Row("DATA_NUM10"));
                _data_flag1      = int.Parse(db.Row("DATA_FLAG1"));
                _data_flag2      = int.Parse(db.Row("DATA_FLAG2"));
                _data_flag3      = int.Parse(db.Row("DATA_FLAG3"));
                _data_flag4      = int.Parse(db.Row("DATA_FLAG4"));
                _data_flag5      = int.Parse(db.Row("DATA_FLAG5"));
                _data_flag6      = int.Parse(db.Row("DATA_FLAG6"));
                _data_flag7      = int.Parse(db.Row("DATA_FLAG7"));
                _data_flag8      = int.Parse(db.Row("DATA_FLAG8"));
                _data_flag9      = int.Parse(db.Row("DATA_FLAG9"));
                _data_flag10     = int.Parse(db.Row("DATA_FLAG10"));
                _entry_date      = DateTime.Parse(db.Row("ENTRY_DATE"));
                _chg_date        = DateTime.Parse(db.Row("CHG_DATE"));
                _chg_pgm         = db.Row("CHG_PGM");
                _chg_user_id     = db.Row("CHG_USERID");
                _update_cntr     = int.Parse(db.Row("UPDATE_CNTR"));
                //_cost_center_name = db.Row("COST_CENTER_NAME");
                _vendor_name = db.Row("VENDOR_NAME");
                _ws_desc     = db.Row("WS_DESC");
            }

            if (db.State() == ConnectionState.Open)
            {
                db.DbClose();
            }
            return(rtn);
        }
示例#18
0
        //<--ADD BY UBIQ-SUO 2010/09/19

        /// <summary>
        /// 倉庫詳細の取得

        ///
        /// 使用画面:MstWhsMnt
        /// </summary>
        public int GetWarehouseDetail()
        {
            ComDB         db     = new ComDB(_db_type);
            StringBuilder strSQL = new StringBuilder();
            int           rtn    = 0;

            //--- sql
            strSQL.Append(" SELECT                                                                                                        ");
            strSQL.Append(" W.WHS_CD,			W.MRP_WHS,			W.WHS_DESC,			W.WHS_DESC2,			                          ");
            strSQL.Append(" W.RECV_LOC,			W.WHS_TYPE,			W.WHS_ITEM_TYPE,	W.LOCATION_CTRL_FLAG,	W.AUTO_HOUSING_TYPE,      ");
            strSQL.Append(" W.DIRECT_SHIP_FLAG,	W.VENDOR_CD,		W.CONS_WHS_FLAG,	W.CONS_VENDOR_CD,		                          ");
            strSQL.Append(" W.PASS_THRU_WHS_CD,	W.BOND_FLAG,		W.DATA_CHAR1,		W.DATA_CHAR2,			                          ");
            strSQL.Append(" W.DATA_CHAR3,		W.DATA_CHAR4,		W.DATA_CHAR5,		W.DATA_CHAR6,			                          ");
            strSQL.Append(" W.DATA_CHAR7,		W.DATA_CHAR8,		W.DATA_CHAR9,		W.DATA_CHAR10,  		                          ");
            strSQL.Append(" W.DATA_NUM1,		W.DATA_NUM2,		W.DATA_NUM3,		W.DATA_NUM4,			                          ");
            strSQL.Append(" W.DATA_NUM5,		W.DATA_NUM6,		W.DATA_NUM7,		W.DATA_NUM8,			                          ");
            strSQL.Append(" W.DATA_NUM9,		W.DATA_NUM10,		W.DATA_FLAG1,		W.DATA_FLAG2,			                          ");
            strSQL.Append(" W.DATA_FLAG3,		W.DATA_FLAG4,		W.DATA_FLAG5,		W.DATA_FLAG6,			                          ");
            strSQL.Append(" W.DATA_FLAG7,		W.DATA_FLAG8,		W.DATA_FLAG9,		W.DATA_FLAG10,	    	                          ");
            strSQL.Append(" W.ENTRY_DATE,		W.CHG_DATE,			W.CHG_PGM,			W.CHG_USERID,			                          ");
            strSQL.Append(" W.UPDATE_CNTR,      W.SUPPLY_TYPE,                                                                            ");
            strSQL.Append(" W2.WHS_DESC AS MRP_WHS_DESC,         W3.WHS_DESC AS PASS_THRU_WHS_DESC,        V.VENDOR_NAME,               ");
            strSQL.Append(" V2.VENDOR_NAME AS CONS_VENDOR_NAME                                                                          ");
            if (_db_type == "ORACLE")
            {
                strSQL.Append(" FROM WAREHOUSE_MASTER W, WAREHOUSE_MASTER W2, WAREHOUSE_MASTER W3,VENDOR_MASTER V, VENDOR_MASTER V2       ");
                strSQL.Append(" WHERE W.WHS_CD              = :WHS_CD                                                                     ");
                strSQL.Append("   AND W.MRP_WHS             = W2.WHS_CD(+)                                                                ");
                strSQL.Append("   AND W.PASS_THRU_WHS_CD    = W3.WHS_CD(+)                                                                ");
                strSQL.Append("   AND W.VENDOR_CD           = V.VENDOR_CD(+)                                                              ");
                strSQL.Append("   AND W.CONS_VENDOR_CD      = V2.VENDOR_CD(+)                                                             ");

                db.DbParametersClear();
                db.DbPsetString("WHS_CD", _whs_cd);
            }
            else
            {
                strSQL.Append(" FROM WAREHOUSE_MASTER W                                                                                    ");
                strSQL.Append(" LEFT OUTER JOIN WAREHOUSE_MASTER W2 ON W.MRP_WHS = W2.WHS_CD                                               ");
                strSQL.Append(" LEFT OUTER JOIN WAREHOUSE_MASTER W3 ON W.PASS_THRU_WHS_CD = W3.WHS_CD                                      ");
                strSQL.Append(" LEFT OUTER JOIN VENDOR_MASTER V ON W.VENDOR_CD = V.VENDOR_CD                                               ");
                strSQL.Append(" LEFT OUTER JOIN VENDOR_MASTER V2 ON W.CONS_VENDOR_CD = V2.VENDOR_CD                                        ");
                strSQL.Append(" WHERE W.WHS_CD = @WHS_CD                                                                                   ");

                db.DbParametersClear();
                db.DbPsetString("@WHS_CD", _whs_cd);
            }

            rtn = db.DbExecuteReader(strSQL.ToString());
            if (rtn == ComConst.FAILED)
            {
                _dbmsg  = db.expmsg;
                _strErr = db.strErr;
            }
            else
            {
                _whs_cd             = db.Row("WHS_CD");
                _mrp_whs            = db.Row("MRP_WHS");
                _whs_desc           = db.Row("WHS_DESC");
                _whs_desc2          = db.Row("WHS_DESC2");
                _recv_loc           = db.Row("RECV_LOC");
                _whs_type           = int.Parse(db.Row("WHS_TYPE"));
                _whs_item_type      = int.Parse(db.Row("WHS_ITEM_TYPE"));
                _location_ctrl_flag = int.Parse(db.Row("LOCATION_CTRL_FLAG"));
                _auto_housing_type  = int.Parse(db.Row("AUTO_HOUSING_TYPE"));
                _direct_ship_flag   = int.Parse(db.Row("DIRECT_SHIP_FLAG"));
                _vendor_cd          = db.Row("VENDOR_CD");
                _cons_whs_flag      = int.Parse(db.Row("CONS_WHS_FLAG"));
                _cons_vendor_cd     = db.Row("CONS_VENDOR_CD");
                _pass_thru_whs_cd   = db.Row("PASS_THRU_WHS_CD");
                _bond_flag          = int.Parse(db.Row("BOND_FLAG"));
                _data_char1         = db.Row("DATA_CHAR1");
                _data_char2         = db.Row("DATA_CHAR2");
                _data_char3         = db.Row("DATA_CHAR3");
                _data_char4         = db.Row("DATA_CHAR4");
                _data_char5         = db.Row("DATA_CHAR5");
                _data_char6         = db.Row("DATA_CHAR6");
                _data_char7         = db.Row("DATA_CHAR7");
                _data_char8         = db.Row("DATA_CHAR8");
                _data_char9         = db.Row("DATA_CHAR9");
                _data_char10        = db.Row("DATA_CHAR10");
                _data_num1          = double.Parse(db.Row("DATA_NUM1"));
                _data_num2          = double.Parse(db.Row("DATA_NUM2"));
                _data_num3          = double.Parse(db.Row("DATA_NUM3"));
                _data_num4          = double.Parse(db.Row("DATA_NUM4"));
                _data_num5          = double.Parse(db.Row("DATA_NUM5"));
                _data_num6          = double.Parse(db.Row("DATA_NUM6"));
                _data_num7          = double.Parse(db.Row("DATA_NUM7"));
                _data_num8          = double.Parse(db.Row("DATA_NUM8"));
                _data_num9          = double.Parse(db.Row("DATA_NUM9"));
                _data_num10         = double.Parse(db.Row("DATA_NUM10"));
                _data_flag1         = int.Parse(db.Row("DATA_FLAG1"));
                _data_flag2         = int.Parse(db.Row("DATA_FLAG2"));
                _data_flag3         = int.Parse(db.Row("DATA_FLAG3"));
                _data_flag4         = int.Parse(db.Row("DATA_FLAG4"));
                _data_flag5         = int.Parse(db.Row("DATA_FLAG5"));
                _data_flag6         = int.Parse(db.Row("DATA_FLAG6"));
                _data_flag7         = int.Parse(db.Row("DATA_FLAG7"));
                _data_flag8         = int.Parse(db.Row("DATA_FLAG8"));
                _data_flag9         = int.Parse(db.Row("DATA_FLAG9"));
                _data_flag10        = int.Parse(db.Row("DATA_FLAG10"));
                _entry_date         = DateTime.Parse(db.Row("ENTRY_DATE"));
                _chg_date           = DateTime.Parse(db.Row("CHG_DATE"));
                _chg_pgm            = db.Row("CHG_PGM");
                _chg_user_id        = db.Row("CHG_USERID");
                _update_cntr        = int.Parse(db.Row("UPDATE_CNTR"));
                _mrp_whs_desc       = db.Row("MRP_WHS_DESC");
                _vendor_name        = db.Row("VENDOR_NAME");
                _cons_vendor_name   = db.Row("CONS_VENDOR_NAME");
                _pass_thru_whs_desc = db.Row("PASS_THRU_WHS_DESC");
                _supply_type        = int.Parse(db.Row("SUPPLY_TYPE"));
            }

            if (db.State() == ConnectionState.Open)
            {
                db.DbClose();
            }
            return(rtn);
        }
示例#19
0
        }                                                                                                       // IMV3
        #endregion

        /// <summary>
        /// 製造工順詳細の取得

        ///
        /// 使用画面:MstRoutineMnt
        /// </summary>
        public int GetRoutineDetail()
        {
            ComDB         db     = new ComDB(_db_type);
            StringBuilder strSQL = new StringBuilder();
            int           rtn    = 0;

            //--- sql
            strSQL.Append("SELECT ");
            strSQL.Append("R.ITEM_NO,			R.WS_CD,			R.ROUTINE_SEQ,      R.BEG_EFF_DATE,	        ");
            strSQL.Append("R.END_EFF_DATE,	    R.PROCESS_CD,       R.LT_TYPE,          R.NEXT_PROC_CONT_FLAG,  ");
            strSQL.Append("R.SETUP_TIME,	    R.UNIT_TIME,		R.UNIT_QTY,	        R.TRANSFER_TIME,        ");
            strSQL.Append("R.DAILY_PROD_QTY,    R.MFG_LT,           R.TRANSFER_LT,      R.YIELD,                ");
            strSQL.Append("R.MH_ADOPT_FLAG,     R.COMPL_UMSR,       R.PROCESS_CONV_RATIO,R.ENG_CONV_RATIO,      ");
            strSQL.Append("R.COMPL_ROUND_UNIT,  R.SUPPLY_LT,        R.RESOURCE_CD,                              ");
            strSQL.Append("R.DATA_CHAR1,	    R.DATA_CHAR2,			    ");
            strSQL.Append("R.DATA_CHAR3,		R.DATA_CHAR4,		R.DATA_CHAR5,		R.DATA_CHAR6,			");
            strSQL.Append("R.DATA_CHAR7,		R.DATA_CHAR8,		R.DATA_CHAR9,		R.DATA_CHAR10,  		");
            strSQL.Append("R.DATA_NUM1,			R.DATA_NUM2,		R.DATA_NUM3,		R.DATA_NUM4,			");
            strSQL.Append("R.DATA_NUM5,			R.DATA_NUM6,		R.DATA_NUM7,		R.DATA_NUM8,			");
            strSQL.Append("R.DATA_NUM9,			R.DATA_NUM10,		R.DATA_FLAG1,		R.DATA_FLAG2,			");
            strSQL.Append("R.DATA_FLAG3,		R.DATA_FLAG4,		R.DATA_FLAG5,		R.DATA_FLAG6,			");
            strSQL.Append("R.DATA_FLAG7,		R.DATA_FLAG8,		R.DATA_FLAG9,		R.DATA_FLAG10,	    	");
            strSQL.Append("R.ENTRY_DATE,		R.CHG_DATE,			R.CHG_PGM,			R.CHG_USERID,			");
            strSQL.Append("R.UPDATE_CNTR,       R.AFTER_SETUP_TIME,");   // IMV3
            strSQL.Append("I.ITEM_DESC AS ITEM_DESC,");
            strSQL.Append("M.WS_DESC AS WS_DESC, P.PROCESS_DESC AS PROCESS_DESC ");
            if (_db_type == "ORACLE")
            {
                strSQL.Append(" FROM ROUTINE_MASTER R, ITEM_MASTER I ,WORKSHOP_MASTER M ,PROCESS_MASTER P");
                strSQL.Append(" WHERE R.ITEM_NO             = :ITEM_NO");
                strSQL.Append("   AND R.WS_CD               = :WS_CD");
                strSQL.Append("   AND R.ROUTINE_SEQ         = :ROUTINE_SEQ");
                strSQL.Append("   AND R.BEG_EFF_DATE        <= :BEG_EFF_DATE");
                strSQL.Append("   AND R.END_EFF_DATE        >= :BEG_EFF_DATE");
                strSQL.Append("   AND R.ITEM_NO             = I.ITEM_NO(+)");
                strSQL.Append("   AND R.WS_CD               = M.WS_CD(+)");
                strSQL.Append("   AND R.WS_CD               = P.WS_CD(+)");
                strSQL.Append("   AND R.PROCESS_CD          = P.PROCESS_CD(+)");

                db.DbParametersClear();
                db.DbPsetString("ITEM_NO", _item_no);
                db.DbPsetString("WS_CD", _ws_cd);
                db.DbPsetInt("ROUTINE_SEQ", _routine_seq);
                db.DbPsetInt("BEG_EFF_DATE", _beg_eff_date);
            }
            else
            {
                strSQL.Append(" FROM ROUTINE_MASTER R ");
                strSQL.Append(" LEFT OUTER JOIN WORKSHOP_MASTER M ON R.WS_CD = M.WS_CD");
                strSQL.Append(" LEFT OUTER JOIN ITEM_MASTER I ON R.ITEM_NO = I.ITEM_NO");
                strSQL.Append(" LEFT OUTER JOIN PROCESS_MASTER P ON R.WS_CD = P.WS_CD AND R.PROCESS_CD = P.PROCESS_CD");
                strSQL.Append(" WHERE R.ITEM_NO = @ITEM_NO");
                strSQL.Append("   AND R.WS_CD = @WS_CD");
                strSQL.Append("   AND R.ROUTINE_SEQ = @ROUTINE_SEQ");
                strSQL.Append("   AND R.BEG_EFF_DATE <= @BEG_EFF_DATE");
                strSQL.Append("   AND R.END_EFF_DATE >= @BEG_EFF_DATE");

                db.DbParametersClear();
                db.DbPsetString("@ITEM_NO", _item_no);
                db.DbPsetString("@WS_CD", _ws_cd);
                db.DbPsetInt("@ROUTINE_SEQ", _routine_seq);
                db.DbPsetInt("@BEG_EFF_DATE", _beg_eff_date);
            }

            rtn = db.DbExecuteReader(strSQL.ToString());
            if (rtn == ComConst.FAILED)
            {
                _dbmsg  = db.expmsg;
                _strErr = db.strErr;
            }
            else
            {
                _item_no             = db.Row("ITEM_NO");
                _ws_cd               = db.Row("WS_CD");
                _routine_seq         = int.Parse(db.Row("ROUTINE_SEQ"));
                _beg_eff_date        = int.Parse(db.Row("BEG_EFF_DATE"));
                _end_eff_date        = int.Parse(db.Row("END_EFF_DATE"));
                _process_cd          = db.Row("PROCESS_CD");
                _lt_type             = int.Parse(db.Row("LT_TYPE"));
                _next_proc_cont_flag = int.Parse(db.Row("NEXT_PROC_CONT_FLAG"));
                _setup_time          = double.Parse(db.Row("SETUP_TIME"));
                _unit_time           = double.Parse(db.Row("UNIT_TIME"));
                _unit_qty            = double.Parse(db.Row("UNIT_QTY"));
                _transfer_time       = double.Parse(db.Row("TRANSFER_TIME"));
                _daily_prod_qty      = double.Parse(db.Row("DAILY_PROD_QTY"));
                _mfg_lt              = double.Parse(db.Row("MFG_LT"));
                _transfer_lt         = double.Parse(db.Row("TRANSFER_LT"));
                _yield               = double.Parse(db.Row("YIELD"));
                _mh_adopt_flag       = int.Parse(db.Row("MH_ADOPT_FLAG"));
                _compl_umsr          = db.Row("COMPL_UMSR");
                _process_conv_ratio  = double.Parse(db.Row("PROCESS_CONV_RATIO"));
                _eng_conv_ratio      = double.Parse(db.Row("ENG_CONV_RATIO"));
                _compl_round_unit    = int.Parse(db.Row("COMPL_ROUND_UNIT"));
                _supply_lt           = int.Parse(db.Row("SUPPLY_LT"));
                _resource_cd         = db.Row("RESOURCE_CD");
                _data_char1          = db.Row("DATA_CHAR1");
                _data_char2          = db.Row("DATA_CHAR2");
                _data_char3          = db.Row("DATA_CHAR3");
                _data_char4          = db.Row("DATA_CHAR4");
                _data_char5          = db.Row("DATA_CHAR5");
                _data_char6          = db.Row("DATA_CHAR6");
                _data_char7          = db.Row("DATA_CHAR7");
                _data_char8          = db.Row("DATA_CHAR8");
                _data_char9          = db.Row("DATA_CHAR9");
                _data_char10         = db.Row("DATA_CHAR10");
                _data_num1           = double.Parse(db.Row("DATA_NUM1"));
                _data_num2           = double.Parse(db.Row("DATA_NUM2"));
                _data_num3           = double.Parse(db.Row("DATA_NUM3"));
                _data_num4           = double.Parse(db.Row("DATA_NUM4"));
                _data_num5           = double.Parse(db.Row("DATA_NUM5"));
                _data_num6           = double.Parse(db.Row("DATA_NUM6"));
                _data_num7           = double.Parse(db.Row("DATA_NUM7"));
                _data_num8           = double.Parse(db.Row("DATA_NUM8"));
                _data_num9           = double.Parse(db.Row("DATA_NUM9"));
                _data_num10          = double.Parse(db.Row("DATA_NUM10"));
                _data_flag1          = int.Parse(db.Row("DATA_FLAG1"));
                _data_flag2          = int.Parse(db.Row("DATA_FLAG2"));
                _data_flag3          = int.Parse(db.Row("DATA_FLAG3"));
                _data_flag4          = int.Parse(db.Row("DATA_FLAG4"));
                _data_flag5          = int.Parse(db.Row("DATA_FLAG5"));
                _data_flag6          = int.Parse(db.Row("DATA_FLAG6"));
                _data_flag7          = int.Parse(db.Row("DATA_FLAG7"));
                _data_flag8          = int.Parse(db.Row("DATA_FLAG8"));
                _data_flag9          = int.Parse(db.Row("DATA_FLAG9"));
                _data_flag10         = int.Parse(db.Row("DATA_FLAG10"));
                _entry_date          = DateTime.Parse(db.Row("ENTRY_DATE"));
                _chg_date            = DateTime.Parse(db.Row("CHG_DATE"));
                _chg_pgm             = db.Row("CHG_PGM");
                _chg_user_id         = db.Row("CHG_USERID");
                _update_cntr         = int.Parse(db.Row("UPDATE_CNTR"));
                _item_desc           = db.Row("ITEM_DESC");
                _ws_desc             = db.Row("WS_DESC");
                _setup_time          = double.Parse(db.Row("SETUP_TIME"));
                _after_setup_time    = double.Parse(db.Row("AFTER_SETUP_TIME")); // IMV3
            }

            if (db.State() == ConnectionState.Open)
            {
                db.DbClose();
            }
            return(rtn);
        }
示例#20
0
        /// <summary>
        /// 資源明細の取得

        ///
        /// 使用画面:MstResourceMnt
        /// </summary>
        public int GetResourceDetail()
        {
            ComDB         db     = new ComDB(_db_type);
            StringBuilder strSQL = new StringBuilder();
            int           rtn    = 0;

            //--- sql
            strSQL.Append("SELECT                                                                        ");
            strSQL.Append("R.RESOURCE_CD,		    R.RESOURCE_DESC,		    R.RESOURCE_DESC2,        ");
            strSQL.Append("R.RESOURCE_TYPE,		    R.RESOURCE_GRP,		        R.WS_CD,                 ");
            strSQL.Append("R.PROCESS_CD,			R.DISPLAY_SEQ,		        R.STD_WORKING_TIME,      ");
            strSQL.Append("R.TIME_DESC,             W.WS_DESC,			        P.PROCESS_DESC           ");

            if (_db_type == "ORACLE")
            {
                strSQL.Append(" FROM RESOURCE_MASTER R, WORKSHOP_MASTER W, PROCESS_MASTER P ");
                strSQL.Append(" WHERE R.RESOURCE_CD =: RESOURCE_CD  ");
                strSQL.Append(" AND R.WS_CD=W.WS_CD                 ");
                strSQL.Append(" AND R.PROCESS_CD=P.PROCESS_CD       ");

                db.DbParametersClear();
                db.DbPsetString("RESOURCE_CD", _resource_cd);
            }
            else
            {
                strSQL.Append(" FROM RESOURCE_MASTER R                                        ");
                strSQL.Append(" LEFT OUTER JOIN WORKSHOP_MASTER W ON R.WS_CD=W.WS_CD          ");
                strSQL.Append(" LEFT OUTER JOIN PROCESS_MASTER P ON R.PROCESS_CD=P.PROCESS_CD ");
                strSQL.Append(" WHERE R.RESOURCE_CD = @RESOURCE_CD  ");

                db.DbParametersClear();
                db.DbPsetString("@RESOURCE_CD", _resource_cd);
            }
            rtn = db.DbExecuteReader(strSQL.ToString());
            if (rtn == ComConst.FAILED)
            {
                _dbmsg  = db.expmsg;
                _strErr = db.strErr;
            }
            else
            {
                _resource_cd      = db.Row("RESOURCE_CD");
                _resource_desc    = db.Row("RESOURCE_DESC");
                _resource_desc2   = db.Row("RESOURCE_DESC2");
                _resource_type    = int.Parse(db.Row("RESOURCE_TYPE"));
                _resource_grp     = db.Row("RESOURCE_GRP");
                _ws_cd            = db.Row("WS_CD");
                _ws_desc          = db.Row("WS_DESC");
                _process_cd       = db.Row("PROCESS_CD");
                _process_desc     = db.Row("PROCESS_DESC");
                _display_seq      = int.Parse(db.Row("DISPLAY_SEQ"));
                _std_working_time = int.Parse(db.Row("STD_WORKING_TIME"));
                _time_desc        = db.Row("TIME_DESC");

                //_entry_date = DateTime.Parse(db.Row("ENTRY_DATE"));
                //_chg_date = DateTime.Parse(db.Row("CHG_DATE"));
                //_chg_pgm = db.Row("CHG_PGM");
                //_chg_user_id = db.Row("CHG_USER_ID");
                //_update_cntr = int.Parse(db.Row("UPDATE_CNTR"));
            }
            if (db.State() == ConnectionState.Open)
            {
                db.DbClose();
            }
            return(rtn);
        }
示例#21
0
        /// <summary>
        /// 仕入先詳細の取得
        ///
        /// 使用画面:MstVendorMnt
        /// </summary>
        public int GetVendorDetail()
        {
            ComDB         db     = new ComDB(_db_type);
            StringBuilder strSQL = new StringBuilder();
            int           rtn    = 0;

            //--- sql
            strSQL.Append("SELECT                                                                           ");
            strSQL.Append("V.VENDOR_CD,			BEG_EFF_DATE,			END_EFF_DATE,		PO_STOP_FLAG,	");
            strSQL.Append("VENDOR_NAME,			VENDOR_DESC,            VENDOR_NAME2,		VENDOR_DESC2,	");
            strSQL.Append("COUNTRY_CD,		    FOREIGN_FLAG,	        CUR_CD,	            SUPPLY_WHS,		");
            strSQL.Append("BOND_SUPPLY_WHS,		PO_SLIPLESS_FLAG,	    PO_SLIP_TYPE,	    FCST_FLAG,		");
            strSQL.Append("PAY_TERMS,   		VENDOR_ATTN,    	    TELNO,      	    FAXNO,  		");
            strSQL.Append("ZIP_CD,         		STATE,          	    ADDRESS1,      	    ADDRESS2,  		");
            strSQL.Append("ADDRESS3,         	ADDRESS4,           	STATE2,          	ADDRESS2_1,     ");
            strSQL.Append("ADDRESS2_2,         	ADDRESS2_3,           	ADDRESS2_4,                         ");
            strSQL.Append("V.DATA_CHAR1,		V.DATA_CHAR2,			                                    ");
            strSQL.Append("V.DATA_CHAR3,		V.DATA_CHAR4,			V.DATA_CHAR5,		V.DATA_CHAR6,	");
            strSQL.Append("V.DATA_CHAR7,		V.DATA_CHAR8,			V.DATA_CHAR9,		V.DATA_CHAR10,	");
            strSQL.Append("V.DATA_NUM1,			V.DATA_NUM2,			V.DATA_NUM3,		V.DATA_NUM4,	");
            strSQL.Append("V.DATA_NUM5,			V.DATA_NUM6,			V.DATA_NUM7,		V.DATA_NUM8,	");
            strSQL.Append("V.DATA_NUM9,			V.DATA_NUM10,			V.DATA_FLAG1,		V.DATA_FLAG2,	");
            strSQL.Append("V.DATA_FLAG3,		V.DATA_FLAG4,			V.DATA_FLAG5,		V.DATA_FLAG6,	");
            strSQL.Append("V.DATA_FLAG7,		V.DATA_FLAG8,			V.DATA_FLAG9,		V.DATA_FLAG10,	");
            strSQL.Append("V.ENTRY_DATE,		V.CHG_DATE,			    V.CHG_PGM,			V.CHG_USERID,	");
            strSQL.Append("V.UPDATE_CNTR,                                                                   ");
            strSQL.Append("V.REJ_WHS,			W2.WHS_DESC REJ_WHS_DESC,									");
            strSQL.Append("W.WHS_DESC AS SUPPLY_WHS_DESC,         W1.WHS_DESC AS BOND_SUPPLY_WHS_DESC,      ");
            strSQL.Append("S1.DATA_CHAR AS CUR_DESC                                                         ");
            //strSQL.Append(" FROM VENDOR_MASTER V");
            if (_db_type == "ORACLE")
            {
                strSQL.Append(" FROM VENDOR_MASTER V, WAREHOUSE_MASTER W, WAREHOUSE_MASTER W1   ");
                strSQL.Append(" WHERE V.VENDOR_CD              = :VENDOR_CD                     ");
                strSQL.Append("   AND W.SUPPLY_WHS             = W.WHS_CD(+)                    ");
                strSQL.Append("   AND W.BOND_SUPPLY_WHS    = W1.WHS_CD(+)                       ");

                db.DbParametersClear();
                db.DbPsetString("VENDOR_CD", _vendor_cd);
            }
            else
            {
                strSQL.Append(" FROM VENDOR_MASTER V                                                ");
                strSQL.Append(" LEFT OUTER JOIN WAREHOUSE_MASTER W ON V.SUPPLY_WHS = W.WHS_CD       ");
                strSQL.Append(" LEFT OUTER JOIN WAREHOUSE_MASTER W1 ON V.BOND_SUPPLY_WHS = W1.WHS_CD");
                strSQL.Append(" LEFT OUTER JOIN WAREHOUSE_MASTER W2 ON V.REJ_WHS = W2.WHS_CD		");
                strSQL.Append(" LEFT OUTER JOIN SYSTEM_PARAMETER S1 ON S1.KEY01 = 'CURRENCY_CD'     ");
                strSQL.Append(" AND S1.KEY02 = V.CUR_CD                                             ");
                strSQL.Append(" WHERE V.VENDOR_CD = @VENDOR_CD                                      ");

                db.DbParametersClear();
                db.DbPsetString("@VENDOR_CD", _vendor_cd);
            }

            rtn = db.DbExecuteReader(strSQL.ToString());
            if (rtn == ComConst.FAILED)
            {
                _dbmsg  = db.expmsg;
                _strErr = db.strErr;
            }
            else
            {
                _vendor_cd            = db.Row("VENDOR_CD");
                _beg_eff_date         = int.Parse(db.Row("BEG_EFF_DATE"));
                _end_eff_date         = int.Parse(db.Row("END_EFF_DATE"));
                _po_stop_flag         = int.Parse(db.Row("PO_STOP_FLAG"));
                _vendor_name          = db.Row("VENDOR_NAME");
                _vendor_desc          = db.Row("VENDOR_DESC");
                _vendor_name2         = db.Row("VENDOR_NAME2");
                _vendor_desc2         = db.Row("VENDOR_DESC2");
                _country_cd           = db.Row("COUNTRY_CD");
                _foreign_flag         = int.Parse(db.Row("FOREIGN_FLAG"));
                _cur_cd               = db.Row("CUR_CD");
                _supply_whs           = db.Row("SUPPLY_WHS");
                _bond_supply_whs      = db.Row("BOND_SUPPLY_WHS");
                _rej_whs              = db.Row("REJ_WHS");      //ADD BY UBIQ-LIU 2010/11/23
                _rej_whs_desc         = db.Row("REJ_WHS_DESC"); //ADD BY UBIQ-LIU 2010/11/23
                _po_slipless_flag     = int.Parse(db.Row("PO_SLIPLESS_FLAG"));
                _po_slip_type         = db.Row("PO_SLIP_TYPE");
                _fcst_flag            = int.Parse(db.Row("FCST_FLAG"));
                _pay_terms            = db.Row("PAY_TERMS");
                _vendor_attn          = db.Row("VENDOR_ATTN");
                _telno                = db.Row("TELNO");
                _faxno                = db.Row("FAXNO");
                _zip_cd               = db.Row("ZIP_CD");
                _state                = db.Row("STATE");
                _address1             = db.Row("ADDRESS1");
                _address2             = db.Row("ADDRESS2");
                _address3             = db.Row("ADDRESS3");
                _address4             = db.Row("ADDRESS4");
                _state2               = db.Row("STATE2");
                _address2_1           = db.Row("ADDRESS2_1");
                _address2_2           = db.Row("ADDRESS2_2");
                _address2_3           = db.Row("ADDRESS2_3");
                _address2_4           = db.Row("ADDRESS2_4");
                _data_char1           = db.Row("DATA_CHAR1");
                _data_char2           = db.Row("DATA_CHAR2");
                _data_char3           = db.Row("DATA_CHAR3");
                _data_char4           = db.Row("DATA_CHAR4");
                _data_char5           = db.Row("DATA_CHAR5");
                _data_char6           = db.Row("DATA_CHAR6");
                _data_char7           = db.Row("DATA_CHAR7");
                _data_char8           = db.Row("DATA_CHAR8");
                _data_char9           = db.Row("DATA_CHAR9");
                _data_char10          = db.Row("DATA_CHAR10");
                _data_num1            = double.Parse(db.Row("DATA_NUM1"));
                _data_num2            = double.Parse(db.Row("DATA_NUM2"));
                _data_num3            = double.Parse(db.Row("DATA_NUM3"));
                _data_num4            = double.Parse(db.Row("DATA_NUM4"));
                _data_num5            = double.Parse(db.Row("DATA_NUM5"));
                _data_num6            = double.Parse(db.Row("DATA_NUM6"));
                _data_num7            = double.Parse(db.Row("DATA_NUM7"));
                _data_num8            = double.Parse(db.Row("DATA_NUM8"));
                _data_num9            = double.Parse(db.Row("DATA_NUM9"));
                _data_num10           = double.Parse(db.Row("DATA_NUM10"));
                _data_flag1           = int.Parse(db.Row("DATA_FLAG1"));
                _data_flag2           = int.Parse(db.Row("DATA_FLAG2"));
                _data_flag3           = int.Parse(db.Row("DATA_FLAG3"));
                _data_flag4           = int.Parse(db.Row("DATA_FLAG4"));
                _data_flag5           = int.Parse(db.Row("DATA_FLAG5"));
                _data_flag6           = int.Parse(db.Row("DATA_FLAG6"));
                _data_flag7           = int.Parse(db.Row("DATA_FLAG7"));
                _data_flag8           = int.Parse(db.Row("DATA_FLAG8"));
                _data_flag9           = int.Parse(db.Row("DATA_FLAG9"));
                _data_flag10          = int.Parse(db.Row("DATA_FLAG10"));
                _entry_date           = DateTime.Parse(db.Row("ENTRY_DATE"));
                _chg_date             = DateTime.Parse(db.Row("CHG_DATE"));
                _chg_pgm              = db.Row("CHG_PGM");
                _chg_user_id          = db.Row("CHG_USERID");
                _update_cntr          = int.Parse(db.Row("UPDATE_CNTR"));
                _supply_whs_desc      = db.Row("SUPPLY_WHS_DESC");
                _bond_supply_whs_desc = db.Row("BOND_SUPPLY_WHS_DESC");
                //ADD BY LIU 2008.11.19
                _cur_desc = db.Row("CUR_DESC");
            }

            if (db.State() == ConnectionState.Open)
            {
                db.DbClose();
            }
            return(rtn);
        }
示例#22
0
        /// <summary>
        /// 製造資源詳細の取得

        ///
        /// 使用画面:MstRoutineResourceMnt
        /// </summary>
        public int GetRoutineResourceDetail()
        {
            ComDB         db     = new ComDB(_db_type);
            StringBuilder strSQL = new StringBuilder();
            int           rtn    = 0;

            //--- sql
            strSQL.Append("SELECT ");
            strSQL.Append("R.ITEM_NO,			R.WS_CD,			R.ROUTINE_SEQ,		R.PROCESS_CD,	  ");
            strSQL.Append("R.PTY_NO,			R.RESOURCE_CD,		R.SETUP_TIME,	    R.UNIT_TIME,      ");
            strSQL.Append("R.UNIT_QTY,			R.TRANSFER_TIME,	R.MFG_LOT_QTY,		R.SPEC_CD,        ");
            strSQL.Append("R.JIGU,				R.DIE,                                                    ");
            strSQL.Append("I.ITEM_DESC AS ITEM_DESC,");
            strSQL.Append("W.WS_DESC AS WS_DESC, P.PROCESS_DESC AS PROCESS_DESC, ");
            strSQL.Append("RO.BEG_EFF_DATE AS BEG_EFF_DATE, RO.END_EFF_DATE AS END_EFF_DATE, ");
            strSQL.Append("RE.RESOURCE_DESC AS RESOURCE_DESC, ");
            strSQL.Append("SP.DATA_CHAR AS SPEC_DESC ");
            if (_db_type == "ORACLE")
            {
                strSQL.Append(" FROM ROUTINE_RESOURCE_MASTER R, ROUTINE_MASTER RO, ITEM_MASTER I, ");
                strSQL.Append(" WORKSHOP_MASTER W, PROCESS_MASTER P, RESOURCE_MASTER RE, SYSTEM_PARAMETER SP");
                strSQL.Append(" WHERE R.ITEM_NO             = :ITEM_NO");
                strSQL.Append("   AND R.WS_CD               = :WS_CD");
                strSQL.Append("   AND R.ROUTINE_SEQ         = :ROUTINE_SEQ");
                strSQL.Append("   AND R.PROCESS_CD          = :PROCESS_CD");
                //strSQL.Append("   AND R.PTY_NO              = :PTY_NO");
                strSQL.Append("   AND R.RESOURCE_CD         = :RESOURCE_CD");
                strSQL.Append("   AND R.ITEM_NO             = RO.ITEM_NO(+)");
                strSQL.Append("   AND R.WS_CD               = RO.WS_CD(+)");
                strSQL.Append("   AND R.ROUTINE_SEQ         = RO.ROUTINE_SEQ(+)");
                strSQL.Append("   AND R.ITEM_NO             = I.ITEM_NO(+)");
                strSQL.Append("   AND R.WS_CD               = W.WS_CD(+)");
                strSQL.Append("   AND R.WS_CD               = P.WS_CD(+)");
                strSQL.Append("   AND R.PROCESS_CD          = P.PROCESS_CD(+)");
                strSQL.Append("   AND R.RESOURCE_CD         = RE.RESOURCE_CD(+)");
                strSQL.Append("   AND SP.KEY01              = 'SPEC_CD'");
                strSQL.Append("   AND SP.KEY02              = R.SPEC_CD(+)");

                db.DbParametersClear();
                db.DbPsetString("ITEM_NO", _item_no);
                db.DbPsetString("WS_CD", _ws_cd);
                db.DbPsetInt("ROUTINE_SEQ", _routine_seq);
                db.DbPsetString("PROCESS_CD", _process_cd);
                //db.DbPsetInt("PTY_NO", _pty_no);
                db.DbPsetString("RESOURCE_CD", _resource_cd);
            }
            else
            {
                strSQL.Append(" FROM ROUTINE_RESOURCE_MASTER R ");
                strSQL.Append(" LEFT OUTER JOIN ROUTINE_MASTER RO ON R.ITEM_NO=RO.ITEM_NO ");
                strSQL.Append("      AND R.WS_CD=RO.WS_CD AND R.ROUTINE_SEQ=RO.ROUTINE_SEQ");
                strSQL.Append(" LEFT OUTER JOIN WORKSHOP_MASTER W ON R.WS_CD = W.WS_CD");
                strSQL.Append(" LEFT OUTER JOIN ITEM_MASTER I ON R.ITEM_NO = I.ITEM_NO");
                strSQL.Append(" LEFT OUTER JOIN PROCESS_MASTER P ON R.WS_CD = P.WS_CD AND R.PROCESS_CD = P.PROCESS_CD");
                strSQL.Append(" LEFT OUTER JOIN RESOURCE_MASTER RE ON R.RESOURCE_CD=RE.RESOURCE_CD");
                strSQL.Append(" LEFT OUTER JOIN SYSTEM_PARAMETER SP ON SP.KEY01 = 'SPEC_CD' AND SP.KEY02=R.SPEC_CD");
                strSQL.Append(" WHERE R.ITEM_NO = @ITEM_NO ");
                strSQL.Append("   AND R.WS_CD = @WS_CD ");
                strSQL.Append("   AND R.ROUTINE_SEQ = @ROUTINE_SEQ");
                strSQL.Append("   AND R.PROCESS_CD = @PROCESS_CD");
                //strSQL.Append("   AND R.PTY_NO = @PTY_NO");
                strSQL.Append("   AND R.RESOURCE_CD = @RESOURCE_CD");

                db.DbParametersClear();
                db.DbPsetString("@ITEM_NO", _item_no);
                db.DbPsetString("@WS_CD", _ws_cd);
                db.DbPsetInt("@ROUTINE_SEQ", _routine_seq);
                db.DbPsetString("@PROCESS_CD", _process_cd);
                //db.DbPsetInt("@PTY_NO", _pty_no);
                db.DbPsetString("@RESOURCE_CD", _resource_cd);
            }

            rtn = db.DbExecuteReader(strSQL.ToString());
            if (rtn == ComConst.FAILED)
            {
                _dbmsg  = db.expmsg;
                _strErr = db.strErr;
            }
            else
            {
                _item_no       = db.Row("ITEM_NO");
                _ws_cd         = db.Row("WS_CD");
                _routine_seq   = int.Parse(db.Row("ROUTINE_SEQ"));
                _process_cd    = db.Row("PROCESS_CD");
                _pty_no        = int.Parse(db.Row("PTY_NO"));
                _resource_cd   = db.Row("RESOURCE_CD");
                _setup_time    = double.Parse(db.Row("SETUP_TIME"));
                _unit_time     = double.Parse(db.Row("UNIT_TIME"));
                _unit_qty      = double.Parse(db.Row("UNIT_QTY"));
                _transfer_time = double.Parse(db.Row("TRANSFER_TIME"));
                _mfg_lot_qty   = double.Parse(db.Row("MFG_LOT_QTY"));
                _spec_cd       = db.Row("SPEC_CD");
                _jigu          = db.Row("JIGU");
                _die           = db.Row("DIE");
                _item_desc     = db.Row("ITEM_DESC");
                _ws_desc       = db.Row("WS_DESC");
                _process_desc  = db.Row("PROCESS_DESC");
                _resource_desc = db.Row("RESOURCE_DESC");
                _spec_desc     = db.Row("SPEC_DESC");
            }

            if (db.State() == ConnectionState.Open)
            {
                db.DbClose();
            }
            return(rtn);
        }
示例#23
0
        /// <summary>
        /// 購入単価詳細の取得
        ///
        /// 使用画面:MstPurPriceMnt
        /// </summary>
        public int GetPurPriceDetail()
        {
            ComDB         db     = new ComDB(_db_type);
            StringBuilder strSQL = new StringBuilder();
            int           rtn    = 0;

            //--- sql
            strSQL.Append("SELECT ");
            //strSQL.Append("P.ITEM_NO,			P.WS_CD,			P.PROCESS_CD,		P.VENDOR_CD,	P.BEG_EFF_DATE,");
            strSQL.Append("P.END_EFF_DATE,		P.UNIT_PRC_TYPE,	P.UNIT_PRC_BASE,	P.COM_PRC_FLAG,");
            strSQL.Append("P.TENTATIVE_PRC,	    P.TENTATIVE_CUR,	P.ACT_PRC,	        P.ACT_CUR,		");
            strSQL.Append("P.DUTY_PCT,	        P.TAX_TYPE,		    P.TAX_CD,		    P.VALUE_ADD_TAX_PCT,			");
            strSQL.Append("P.PAY_TERMS,	        P.DATA_CHAR1,		P.DATA_CHAR2,			");
            strSQL.Append("P.DATA_CHAR3,		P.DATA_CHAR4,		P.DATA_CHAR5,		P.DATA_CHAR6,			");
            strSQL.Append("P.DATA_CHAR7,		P.DATA_CHAR8,		P.DATA_CHAR9,		P.DATA_CHAR10,  		");
            strSQL.Append("P.DATA_NUM1,			P.DATA_NUM2,		P.DATA_NUM3,		P.DATA_NUM4,			");
            strSQL.Append("P.DATA_NUM5,			P.DATA_NUM6,		P.DATA_NUM7,		P.DATA_NUM8,			");
            strSQL.Append("P.DATA_NUM9,			P.DATA_NUM10,		P.DATA_FLAG1,		P.DATA_FLAG2,			");
            strSQL.Append("P.DATA_FLAG3,		P.DATA_FLAG4,		P.DATA_FLAG5,		P.DATA_FLAG6,			");
            strSQL.Append("P.DATA_FLAG7,		P.DATA_FLAG8,		P.DATA_FLAG9,		P.DATA_FLAG10,	    	");
            strSQL.Append("P.ENTRY_DATE,		P.CHG_DATE,			P.CHG_PGM,			P.CHG_USERID,			");
            strSQL.Append("P.UPDATE_CNTR,");
            strSQL.Append("I.ITEM_DESC ");
            if (_db_type == "ORACLE")
            {
                strSQL.Append(" FROM PURCHASE_PRICE_MASTER P, ITEM_MASTER I ");
                strSQL.Append(" WHERE P.ITEM_NO       = :ITEM_NO");
                strSQL.Append("   AND P.WS_CD         = :WS_CD");
                strSQL.Append("   AND P.PROCESS_CD    = :PROCESS_CD");
                strSQL.Append("   AND P.VENDOR_CD     = :VENDOR_CD");
                strSQL.Append("   AND P.BEG_EFF_DATE  = :BEG_EFF_DATE");
                strSQL.Append("   AND P.ITEM_NO  = I.ITEM_NO");

                db.DbParametersClear();
                db.DbPsetString("ITEM_NO", _item_no);
                db.DbPsetString("WS_CD", _ws_cd);
                db.DbPsetString("PROCESS_CD", _process_cd);
                db.DbPsetString("VENDOR_CD", _vendor_cd);
                db.DbPsetInt("BEG_EFF_DATE", _beg_eff_date);
            }
            else
            {
                db.DbParametersClear();
                strSQL.Append(" FROM PURCHASE_PRICE_MASTER P ");
                strSQL.Append(" LEFT OUTER JOIN ITEM_MASTER I ON P.ITEM_NO  = I.ITEM_NO ");
                strSQL.Append(" WHERE P.ITEM_NO = @ITEM_NO");
                strSQL.Append("   AND P.WS_CD         = @WS_CD");
                strSQL.Append("   AND P.PROCESS_CD    = @PROCESS_CD");
                strSQL.Append("   AND P.VENDOR_CD     = @VENDOR_CD");
                strSQL.Append("   AND P.BEG_EFF_DATE  = @BEG_EFF_DATE");

                db.DbPsetString("@ITEM_NO", _item_no);
                db.DbPsetString("@WS_CD", _ws_cd);
                db.DbPsetString("@PROCESS_CD", _process_cd);
                db.DbPsetString("@VENDOR_CD", _vendor_cd);
                db.DbPsetInt("@BEG_EFF_DATE", _beg_eff_date);
            }

            rtn = db.DbExecuteReader(strSQL.ToString());
            if (rtn == ComConst.FAILED)
            {
                _dbmsg  = db.expmsg;
                _strErr = db.strErr;
            }
            else
            {
                //_item_no = db.Row("ITEM_NO");
                //_ws_cd = db.Row("WS_CD");
                //_process_cd = db.Row("PROCESS_CD");
                //_vendor_cd = db.Row("VENDOR_CD");
                //_beg_eff_date = int.Parse(db.Row("BEG_EFF_DATE"));
                _end_eff_date      = int.Parse(db.Row("END_EFF_DATE"));
                _unit_prc_type     = int.Parse(db.Row("UNIT_PRC_TYPE"));
                _unit_prc_base     = int.Parse(db.Row("UNIT_PRC_BASE"));
                _com_prc_flag      = int.Parse(db.Row("COM_PRC_FLAG"));
                _tentative_prc     = double.Parse(db.Row("TENTATIVE_PRC"));
                _tentative_cur     = db.Row("TENTATIVE_CUR");
                _act_prc           = double.Parse(db.Row("ACT_PRC"));
                _act_cur           = db.Row("ACT_CUR");
                _duty_pct          = double.Parse(db.Row("DUTY_PCT"));
                _tax_type          = int.Parse(db.Row("TAX_TYPE"));
                _tax_cd            = db.Row("TAX_CD");
                _value_add_tax_pct = double.Parse(db.Row("VALUE_ADD_TAX_PCT"));
                _pay_terms         = db.Row("PAY_TERMS");
                _data_char1        = db.Row("DATA_CHAR1");
                _data_char2        = db.Row("DATA_CHAR2");
                _data_char3        = db.Row("DATA_CHAR3");
                _data_char4        = db.Row("DATA_CHAR4");
                _data_char5        = db.Row("DATA_CHAR5");
                _data_char6        = db.Row("DATA_CHAR6");
                _data_char7        = db.Row("DATA_CHAR7");
                _data_char8        = db.Row("DATA_CHAR8");
                _data_char9        = db.Row("DATA_CHAR9");
                _data_char10       = db.Row("DATA_CHAR10");
                _data_num1         = double.Parse(db.Row("DATA_NUM1"));
                _data_num2         = double.Parse(db.Row("DATA_NUM2"));
                _data_num3         = double.Parse(db.Row("DATA_NUM3"));
                _data_num4         = double.Parse(db.Row("DATA_NUM4"));
                _data_num5         = double.Parse(db.Row("DATA_NUM5"));
                _data_num6         = double.Parse(db.Row("DATA_NUM6"));
                _data_num7         = double.Parse(db.Row("DATA_NUM7"));
                _data_num8         = double.Parse(db.Row("DATA_NUM8"));
                _data_num9         = double.Parse(db.Row("DATA_NUM9"));
                _data_num10        = double.Parse(db.Row("DATA_NUM10"));
                _data_flag1        = int.Parse(db.Row("DATA_FLAG1"));
                _data_flag2        = int.Parse(db.Row("DATA_FLAG2"));
                _data_flag3        = int.Parse(db.Row("DATA_FLAG3"));
                _data_flag4        = int.Parse(db.Row("DATA_FLAG4"));
                _data_flag5        = int.Parse(db.Row("DATA_FLAG5"));
                _data_flag6        = int.Parse(db.Row("DATA_FLAG6"));
                _data_flag7        = int.Parse(db.Row("DATA_FLAG7"));
                _data_flag8        = int.Parse(db.Row("DATA_FLAG8"));
                _data_flag9        = int.Parse(db.Row("DATA_FLAG9"));
                _data_flag10       = int.Parse(db.Row("DATA_FLAG10"));
                _entry_date        = DateTime.Parse(db.Row("ENTRY_DATE"));
                _chg_date          = DateTime.Parse(db.Row("CHG_DATE"));
                _chg_pgm           = db.Row("CHG_PGM");
                _chg_user_id       = db.Row("CHG_USERID");
                _update_cntr       = int.Parse(db.Row("UPDATE_CNTR"));
                _item_desc         = db.Row("ITEM_DESC");
            }

            if (db.State() == ConnectionState.Open)
            {
                db.DbClose();
            }
            return(rtn);
        }
示例#24
0
        /// <summary>
        ///  部門詳細の取得

        ///
        /// 使用画面:MstDeptMnt
        /// </summary>
        public int GetDEPTDetail()
        {
            ComDB         db     = new ComDB(_db_type);
            StringBuilder strSQL = new StringBuilder();
            int           rtn    = 0;

            //strSQL.Append(" SELECT                                                                                                     ");
            //strSQL.Append(" D.DEPT_CD,			D.DEPT_DESC1,	          D.DEPT_DESC2,             D.DEPT_DESC3,	                   ");
            //strSQL.Append(" D.DEPT_DESC4,	    D.DEPT_TYPE,              D.NUMBER_DEPT,            D.AREA_DEPT	,                       ");
            //switch (_lang)
            //{
            //    case 2:
            //        strSQL.Append(" DEPT_DESC2 AS DEPT_DESC ");
            //        break;

            //    case 3:
            //        strSQL.Append(" DEPT_DESC3 AS DEPT_DESC ");
            //        break;

            //    case 4:
            //        strSQL.Append(" DEPT_DESC4 AS DEPT_DESC ");
            //        break;

            //    default:
            //        strSQL.Append(" DEPT_DESC1 AS DEPT_DESC ");
            //        break;
            //}
            strSQL.Append(" SELECT                                                                                                      ");
            strSQL.Append(" D.DEPT_NO,			D.DEPT_NAME,	          D.DEPT_DESCRIPTION,             	                            ");
            strSQL.Append(" D.ENTRY_DATE,	    D.UPDATE_DATE,            D.USER_CREATE,            D.USER_UPDATE	                    ");

            if (_db_type == "ORACLE")
            {
                strSQL.Append(" FROM DEPT_MASTER D ");
                strSQL.Append(" WHERE D.DEPT_CD            = :DEPT_CD");

                db.DbParametersClear();
                db.DbPsetString("DEPT_CD", _dept_cd);
            }
            else
            {
                strSQL.Append(" FROM DEPT_MASTER D ");
                //strSQL.Append(" WHERE D.DEPT_CD            = @DEPT_CD");
                strSQL.Append(" WHERE D.DEPT_NO            = @DEPT_CD");
                db.DbParametersClear();
                db.DbPsetString("@DEPT_CD", _dept_cd);
                //if (_dept_type >= 0)
                //{
                //    strSQL.Append("   AND D.DEPT_TYPE       =@DEPT_TYPE");
                //    db.DbPsetInt("@DEPT_TYPE", _dept_type);
                //}
            }
            rtn = db.DbExecuteReader(strSQL.ToString());
            if (rtn == ComConst.FAILED)
            {
                _dbmsg  = db.expmsg;
                _strErr = db.strErr;
            }
            else
            {
                //_dept_cd = db.Row("DEPT_CD");
                //_dept_desc = db.Row("DEPT_DESC");
                //_dept_desc1 = db.Row("DEPT_DESC1");
                //_dept_desc2 = db.Row("DEPT_DESC2");
                //_dept_desc3 = db.Row("DEPT_DESC3");
                //_dept_desc4 = db.Row("DEPT_DESC4");
                //_dept_type = int.Parse(db.Row("DEPT_TYPE"));
                //_number_dept = double.Parse(db.Row("NUMBER_DEPT"));
                //_area_dept = double.Parse(db.Row("AREA_DEPT"));
                _dept_cd    = db.Row("DEPT_NO");
                _dept_desc  = db.Row("DEPT_NAME");
                _dept_desc2 = db.Row("DEPT_DESCRIPTION");
            }

            if (db.State() == ConnectionState.Open)
            {
                db.DbClose();
            }
            return(rtn);
        }
示例#25
0
        /// <summary>
        /// お知らせ情報詳細の取得
        ///
        /// 使用画面:MstInfoMnt
        /// </summary>
        public int GetInfoDetail()
        {
            ComDB         db     = new ComDB(_db_type, "COM");
            StringBuilder strSQL = new StringBuilder();
            int           rtn    = 0;

            //--- sql
            strSQL.Append("SELECT LANG, INFO_DATE, INFO_MSG, ");
            strSQL.Append(" IMPORTANT_FLG, BEG_EFF_DATE, END_EFF_DATE,");
            strSQL.Append(" ENTRY_DATE, CHG_DATE, CHG_USER_ID,");
            strSQL.Append(" UPDATE_CNTR");
            strSQL.Append(" FROM INFO_MASTER ");

            if (_db_type == "ORACLE")
            {
                //strSQL.Append(" WHERE COMPANY_CD = :COMPANY_CD");
                strSQL.Append("   WHERE REC_NO = :REC_NO");

                db.DbParametersClear();

                //db.DbPsetString("COMPANY_CD", _company_cd);
                db.DbPsetInt("REC_NO", _rec_no);
            }
            else
            {
                //strSQL.Append(" WHERE COMPANY_CD = @COMPANY_CD");
                strSQL.Append("   WHERE REC_NO = @REC_NO");

                db.DbParametersClear();

                //db.DbPsetString("@COMPANY_CD", _company_cd);
                db.DbPsetInt("@REC_NO", _rec_no);
            }

            rtn = db.DbExecuteReader(strSQL.ToString());
            if (rtn == ComConst.FAILED)
            {
                _dbmsg  = db.expmsg;
                _strErr = db.strErr;
            }
            else
            {
                _lang          = int.Parse(db.Row("LANG"));
                _info_date     = int.Parse(db.Row("INFO_DATE"));
                _info_msg      = db.Row("INFO_MSG");
                _important_flg = int.Parse(db.Row("IMPORTANT_FLG"));
                _beg_eff_date  = int.Parse(db.Row("BEG_EFF_DATE"));
                _end_eff_date  = int.Parse(db.Row("END_EFF_DATE"));
                _entry_date    = DateTime.Parse(db.Row("ENTRY_DATE"));
                _chg_date      = DateTime.Parse(db.Row("CHG_DATE"));
                _chg_user_id   = db.Row("CHG_USER_ID");
                _update_cntr   = int.Parse(db.Row("UPDATE_CNTR"));
            }

            if (db.State() == ConnectionState.Open)
            {
                db.DbClose();
            }

            return(rtn);
        }
示例#26
0
        /// <summary>
        /// ロール詳細の取得
        ///
        /// 使用画面:MstRoleMnt
        /// </summary>
        public int GetRoleDetail()
        {
            ComDB         db     = new ComDB("", "COM");
            StringBuilder strSQL = new StringBuilder();
            int           rtn    = 0;

            //--- sql
            //strSQL.Append("SELECT ROLE_DESC1, ROLE_DESC2, ROLE_DESC3, DEL_DISABLE_FLAG,");
            //strSQL.Append("ROLE_DESC4, ");

            //switch (_lang)
            //{
            //    case 2:
            //        strSQL.Append("ROLE_DESC2 AS ROLE_DESC, ");
            //        break;
            //    case 3:
            //        strSQL.Append("ROLE_DESC3 AS ROLE_DESC, ");
            //        break;
            //    case 4:
            //        strSQL.Append("ROLE_DESC4 AS ROLE_DESC, ");
            //        break;
            //    default:
            //        strSQL.Append("ROLE_DESC1 AS ROLE_DESC, ");
            //        break;
            //}
            strSQL.Append("SELECT USER_GROUP_CODE, USER_GROUP_NAME, GROUP_ACTIVE,");
            strSQL.Append("MANAGEMENT_LEVEL, DEPT_NO, PROCESS_NO,");

            //strSQL.Append(" ENTRY_DATE, CHG_DATE, CHG_USER_ID,");
            //strSQL.Append(" UPDATE_CNTR");
            //strSQL.Append(" FROM ROLE_MASTER ");
            strSQL.Append(" ENTRY_DATE, UPDATE_DATE, USER_CREATE, USER_UPDATE");
            strSQL.Append(" FROM USER_ROLE_MASTER ");

            //strSQL.Append(" WHERE ROLE = @ROLE");
            strSQL.Append(" WHERE USER_GROUP_CODE = @ROLE");

            db.DbParametersClear();

            db.DbPsetString("@ROLE", _role);

            rtn = db.DbExecuteReader(strSQL.ToString());
            if (rtn == ComConst.FAILED)
            {
                _dbmsg  = db.expmsg;
                _strErr = db.strErr;
            }
            else
            {
                //_role_desc1 = db.Row("ROLE_DESC1");
                //_role_desc2 = db.Row("ROLE_DESC2");
                //_role_desc3 = db.Row("ROLE_DESC3");
                //_role_desc4 = db.Row("ROLE_DESC4");
                //_role_desc = db.Row("ROLE_DESC");
                //_del_disable_flag = int.Parse(db.Row("DEL_DISABLE_FLAG"));
                //_entry_date = DateTime.Parse(db.Row("ENTRY_DATE"));
                //_chg_date = DateTime.Parse(db.Row("CHG_DATE"));
                //_chg_user_id = db.Row("CHG_USER_ID");
                //_update_cntr = int.Parse(db.Row("UPDATE_CNTR"));
                _role_desc   = db.Row("USER_GROUP_NAME");
                _mgmt_level  = db.Row("MANAGEMENT_LEVEL");
                _dept_no     = db.Row("DEPT_NO");
                _process_no  = db.Row("PROCESS_NO");
                _entry_date  = DateTime.Parse(db.Row("ENTRY_DATE"));
                _chg_date    = DateTime.Parse(db.Row("UPDATE_DATE"));
                _chg_user_id = db.Row("USER_UPDATE");
            }
            if (db.State() == ConnectionState.Open)
            {
                db.DbClose();
            }

            return(rtn);
        }
示例#27
0
        /// <summary>
        /// 作業区詳細の取得
        ///
        /// 使用画面:MstWsMnt
        /// </summary>
        public int GetWorkShopDetail()
        {
            ComDB         db     = new ComDB(_db_type);
            StringBuilder strSQL = new StringBuilder();
            int           rtn    = 0;

            //--- sql
            strSQL.Append("SELECT                                                                                           ");
            strSQL.Append("W.WS_CD,			    W.WS_DESC,			W.WS_DESC2,			    W.REP_WS_CD,			        ");
            strSQL.Append("W.COST_CENTER,	    W.SC_FLAG,			W.VENDOR_CD,	        W.INPUT_FLAG,	                ");
            strSQL.Append("W.LOT_CTRL_FLAG,	    W.NEG_BAL_FLAG,		W.FRONT_END_FLAG,	    W.COMPL_FLAG,	                ");
            strSQL.Append("W.AUTO_DISB_FLAG,	W.WORK_INST_TYPE,   W.COMPL_SLIP_PATTERN,	W.DATA_CHAR1,	W.DATA_CHAR2,   ");
            strSQL.Append("W.DATA_CHAR3,		W.DATA_CHAR4,		W.DATA_CHAR5,		    W.DATA_CHAR6,			        ");
            strSQL.Append("W.DATA_CHAR7,		W.DATA_CHAR8,		W.DATA_CHAR9,		    W.DATA_CHAR10,  		        ");
            strSQL.Append("W.DATA_NUM1,			W.DATA_NUM2,		W.DATA_NUM3,		    W.DATA_NUM4,			        ");
            strSQL.Append("W.DATA_NUM5,			W.DATA_NUM6,		W.DATA_NUM7,		    W.DATA_NUM8,			        ");
            strSQL.Append("W.DATA_NUM9,			W.DATA_NUM10,		W.DATA_FLAG1,		    W.DATA_FLAG2,			        ");
            strSQL.Append("W.DATA_FLAG3,		W.DATA_FLAG4,		W.DATA_FLAG5,		    W.DATA_FLAG6,			        ");
            strSQL.Append("W.DATA_FLAG7,		W.DATA_FLAG8,		W.DATA_FLAG9,		    W.DATA_FLAG10,	    	        ");
            strSQL.Append("W.ENTRY_DATE,		W.CHG_DATE,			W.CHG_PGM,			    W.CHG_USERID,			        ");
            strSQL.Append("W.UPDATE_CNTR,       W.WS_PRC,			W.REJ_WHS,				WH.WHS_DESC REJ_WHS_DESC,		");                                            //ADD UBIQ-LIU 2010/11/24 ADD[REJ_WHS]
            //strSQL.Append("W1.WS_DESC AS REP_WS_DESC,  D.DEPT_DESC1 AS COST_CENTER_NAME,        V.VENDOR_NAME				");
            strSQL.Append("W1.WS_DESC AS REP_WS_DESC,  '' AS COST_CENTER_NAME,        V.VENDOR_NAME				");                   // IMV3 COMMENT OUT
            if (_db_type == "ORACLE")
            {
                //strSQL.Append(" FROM WORKSHOP_MASTER W, WORKSHOP_MASTER W1, DEPT_MASTER D,VENDOR_MASTER V ");
                strSQL.Append(" FROM WORKSHOP_MASTER W, WORKSHOP_MASTER W1, VENDOR_MASTER V ");   // IMV3 COMMENT OUT
                strSQL.Append(" WHERE W.WS_CD              = :WS_CD");
                strSQL.Append("   AND W.REP_WS_CD             = W1.WS_CD(+)");
                strSQL.Append("   W.COST_CENTER = D.DEPT_CD ");
                strSQL.Append("   AND W.VENDOR_CD           = V.VENDOR_CD(+)");

                db.DbParametersClear();
                db.DbPsetString("WS_CD", _ws_cd);
                if (_sc_flag_input == 1)
                {
                    strSQL.Append("   AND W.SC_FLAG       =:SC_FLAG");
                    db.DbPsetInt("SC_FLAG", _sc_flag);
                }
            }
            else
            {
                strSQL.Append(" FROM WORKSHOP_MASTER W ");
                strSQL.Append(" LEFT OUTER JOIN WORKSHOP_MASTER W1 ON W.REP_WS_CD = W1.WS_CD		");
                //strSQL.Append(" LEFT OUTER JOIN DEPT_MASTER D ON W.COST_CENTER = D.DEPT_CD			");  // IMV3 COMMENT OUT
                strSQL.Append(" LEFT OUTER JOIN VENDOR_MASTER V ON W.VENDOR_CD = V.VENDOR_CD		");
                strSQL.Append(" LEFT OUTER JOIN WAREHOUSE_MASTER WH ON W.REJ_WHS = WH.WHS_CD		");
                strSQL.Append(" WHERE W.WS_CD = @WS_CD");

                db.DbParametersClear();
                db.DbPsetString("@WS_CD", _ws_cd);
                if (_sc_flag_input == 1)
                {
                    strSQL.Append("   AND W.SC_FLAG       =@SC_FLAG");
                    db.DbPsetInt("@SC_FLAG", _sc_flag);
                }
            }

            rtn = db.DbExecuteReader(strSQL.ToString());
            if (rtn == ComConst.FAILED)
            {
                _dbmsg  = db.expmsg;
                _strErr = db.strErr;
            }
            else
            {
                _ws_cd              = db.Row("WS_CD");
                _ws_desc            = db.Row("WS_DESC");
                _ws_desc2           = db.Row("WS_DESC2");
                _rep_ws_cd          = db.Row("REP_WS_CD");
                _cost_center        = db.Row("COST_CENTER");
                _sc_flag            = int.Parse(db.Row("SC_FLAG"));
                _vendor_cd          = db.Row("VENDOR_CD");
                _input_flag         = int.Parse(db.Row("INPUT_FLAG"));
                _lot_ctrl_flag      = int.Parse(db.Row("LOT_CTRL_FLAG"));
                _neg_bal_flag       = int.Parse(db.Row("NEG_BAL_FLAG"));
                _front_end_flag     = int.Parse(db.Row("FRONT_END_FLAG"));
                _compl_flag         = int.Parse(db.Row("COMPL_FLAG"));
                _auto_disb_flag     = int.Parse(db.Row("AUTO_DISB_FLAG"));
                _work_inst_type     = db.Row("WORK_INST_TYPE");
                _compl_slip_pattern = db.Row("COMPL_SLIP_PATTERN");
                _rej_whs            = db.Row("REJ_WHS");      //ADD BY UBIQ-LIU 2010/11/24
                _rej_whs_desc       = db.Row("REJ_WHS_DESC"); //ADD BY UBIQ-LIU 2010/11/24
                _data_char1         = db.Row("DATA_CHAR1");
                _data_char2         = db.Row("DATA_CHAR2");
                _data_char3         = db.Row("DATA_CHAR3");
                _data_char4         = db.Row("DATA_CHAR4");
                _data_char5         = db.Row("DATA_CHAR5");
                _data_char6         = db.Row("DATA_CHAR6");
                _data_char7         = db.Row("DATA_CHAR7");
                _data_char8         = db.Row("DATA_CHAR8");
                _data_char9         = db.Row("DATA_CHAR9");
                _data_char10        = db.Row("DATA_CHAR10");
                _data_num1          = double.Parse(db.Row("DATA_NUM1"));
                _data_num2          = double.Parse(db.Row("DATA_NUM2"));
                _data_num3          = double.Parse(db.Row("DATA_NUM3"));
                _data_num4          = double.Parse(db.Row("DATA_NUM4"));
                _data_num5          = double.Parse(db.Row("DATA_NUM5"));
                _data_num6          = double.Parse(db.Row("DATA_NUM6"));
                _data_num7          = double.Parse(db.Row("DATA_NUM7"));
                _data_num8          = double.Parse(db.Row("DATA_NUM8"));
                _data_num9          = double.Parse(db.Row("DATA_NUM9"));
                _data_num10         = double.Parse(db.Row("DATA_NUM10"));
                _data_flag1         = int.Parse(db.Row("DATA_FLAG1"));
                _data_flag2         = int.Parse(db.Row("DATA_FLAG2"));
                _data_flag3         = int.Parse(db.Row("DATA_FLAG3"));
                _data_flag4         = int.Parse(db.Row("DATA_FLAG4"));
                _data_flag5         = int.Parse(db.Row("DATA_FLAG5"));
                _data_flag6         = int.Parse(db.Row("DATA_FLAG6"));
                _data_flag7         = int.Parse(db.Row("DATA_FLAG7"));
                _data_flag8         = int.Parse(db.Row("DATA_FLAG8"));
                _data_flag9         = int.Parse(db.Row("DATA_FLAG9"));
                _data_flag10        = int.Parse(db.Row("DATA_FLAG10"));
                _entry_date         = DateTime.Parse(db.Row("ENTRY_DATE"));
                _chg_date           = DateTime.Parse(db.Row("CHG_DATE"));
                _chg_pgm            = db.Row("CHG_PGM");
                _chg_user_id        = db.Row("CHG_USERID");
                _update_cntr        = int.Parse(db.Row("UPDATE_CNTR"));
                _ws_prc             = double.Parse(db.Row("WS_PRC"));
                _rep_ws_desc        = db.Row("REP_WS_DESC");
                _cost_center_name   = db.Row("COST_CENTER_NAME");
                _vendor_name        = db.Row("VENDOR_NAME");
            }

            if (db.State() == ConnectionState.Open)
            {
                db.DbClose();
            }
            return(rtn);
        }
示例#28
0
        /// <summary>
        /// 品目別段取条件マスタ詳細の取得

        ///
        /// 使用画面:MstItemSetupMnt
        /// </summary>
        public int GetItemSetupDetail()
        {
            ComDB         db     = new ComDB(_db_type);
            StringBuilder strSQL = new StringBuilder();
            int           rtn    = 0;

            //--- sql
            strSQL.Append("SELECT                                                                           ");
            strSQL.Append(" ISM.RESOURCE_CD, R.RESOURCE_DESC, ISM.ITEM_NO, ISM.PREV_ITEM_NO, ISM.SETUP_TIME,");
            strSQL.Append(" I1.ITEM_DESC, I2.ITEM_DESC PREV_ITEM_DESC                                       ");
            if (_db_type == "ORACLE")
            {
                db.DbParametersClear();

                strSQL.Append(" FROM ITEM_SETUP_MASTER ISM                                                  ");
                strSQL.Append(" LEFT OUTER JOIN RESOURCE_MASTER R ON ISM.RESOURCE_CD = R.RESOURCE_CD        ");
                strSQL.Append(" LEFT OUTER JOIN ITEM_MASTER I1 ON ISM.ITEM_NO = I1.ITEM_NO                  ");
                strSQL.Append(" LEFT OUTER JOIN ITEM_MASTER I2 ON ISM.PREV_ITEM_NO = I2.ITEM_NO             ");
                strSQL.Append(" WHERE                                                                       ");
                strSQL.Append(" ISM.RESOURCE_CD = :RESOURCE_CD                                              ");
                strSQL.Append(" AND ISM.ITEM_NO = :ITEM_NO                                                  ");
                strSQL.Append(" AND ISM.PREV_ITEM_NO = :PREV_ITEM_NO                                        ");

                db.DbPsetString("RESOURCE_CD", _resource_cd);
                db.DbPsetString("ITEM_NO", _item_no);
                db.DbPsetString("PREV_ITEM_NO", _prev_item_no);
            }
            else
            {
                db.DbParametersClear();

                strSQL.Append(" FROM ITEM_SETUP_MASTER ISM                                                  ");
                strSQL.Append(" LEFT OUTER JOIN RESOURCE_MASTER R ON ISM.RESOURCE_CD = R.RESOURCE_CD        ");
                strSQL.Append(" LEFT OUTER JOIN ITEM_MASTER I1 ON ISM.ITEM_NO = I1.ITEM_NO                  ");
                strSQL.Append(" LEFT OUTER JOIN ITEM_MASTER I2 ON ISM.PREV_ITEM_NO = I2.ITEM_NO             ");
                strSQL.Append(" WHERE                                                                       ");
                strSQL.Append(" ISM.RESOURCE_CD = @RESOURCE_CD                                              ");
                strSQL.Append(" AND ISM.ITEM_NO = @ITEM_NO                                                  ");
                strSQL.Append(" AND ISM.PREV_ITEM_NO = @PREV_ITEM_NO                                        ");

                db.DbPsetString("@RESOURCE_CD", _resource_cd);
                db.DbPsetString("@ITEM_NO", _item_no);
                db.DbPsetString("@PREV_ITEM_NO", _prev_item_no);
            }

            rtn = db.DbExecuteReader(strSQL.ToString());
            if (rtn == ComConst.FAILED)
            {
                _dbmsg  = db.expmsg;
                _strErr = db.strErr;
            }
            else
            {
                _resource_cd    = db.Row("RESOURCE_CD");
                _resource_desc  = db.Row("RESOURCE_DESC");
                _item_desc      = db.Row("ITEM_NO");
                _prev_item_no   = db.Row("PREV_ITEM_NO");
                _setup_time     = double.Parse(db.Row("SETUP_TIME"));
                _item_desc      = db.Row("ITEM_DESC");
                _prev_item_desc = db.Row("PREV_ITEM_DESC");
            }

            if (db.State() == ConnectionState.Open)
            {
                db.DbClose();
            }
            return(rtn);
        }
示例#29
0
        /// <summary>
        /// ロール詳細の取得
        ///
        /// 使用画面:MstRoleMnt
        /// </summary>
        public int GetRoleDetail()
        {
            ComDB         db     = new ComDB("", "COM");
            StringBuilder strSQL = new StringBuilder();
            int           rtn    = 0;

            //--- sql
            strSQL.Append("SELECT ROLE_DESC1, ROLE_DESC2, ROLE_DESC3, DEL_DISABLE_FLAG,");
            strSQL.Append("ROLE_DESC4, ");

            switch (_lang)
            {
            case 2:
                strSQL.Append("ROLE_DESC2 AS ROLE_DESC, ");
                break;

            case 3:
                strSQL.Append("ROLE_DESC3 AS ROLE_DESC, ");
                break;

            case 4:
                strSQL.Append("ROLE_DESC4 AS ROLE_DESC, ");
                break;

            default:
                strSQL.Append("ROLE_DESC1 AS ROLE_DESC, ");
                break;
            }

            strSQL.Append(" ENTRY_DATE, CHG_DATE, CHG_USER_ID,");
            strSQL.Append(" UPDATE_CNTR");
            strSQL.Append(" FROM ROLE_MASTER ");

            strSQL.Append(" WHERE ROLE = @ROLE");

            db.DbParametersClear();

            db.DbPsetString("@ROLE", _role);

            rtn = db.DbExecuteReader(strSQL.ToString());
            if (rtn == ComConst.FAILED)
            {
                _dbmsg  = db.expmsg;
                _strErr = db.strErr;
            }
            else
            {
                _role_desc1       = db.Row("ROLE_DESC1");
                _role_desc2       = db.Row("ROLE_DESC2");
                _role_desc3       = db.Row("ROLE_DESC3");
                _role_desc4       = db.Row("ROLE_DESC4");
                _role_desc        = db.Row("ROLE_DESC");
                _del_disable_flag = int.Parse(db.Row("DEL_DISABLE_FLAG"));
                _entry_date       = DateTime.Parse(db.Row("ENTRY_DATE"));
                _chg_date         = DateTime.Parse(db.Row("CHG_DATE"));
                _chg_user_id      = db.Row("CHG_USER_ID");
                _update_cntr      = int.Parse(db.Row("UPDATE_CNTR"));
            }
            if (db.State() == ConnectionState.Open)
            {
                db.DbClose();
            }

            return(rtn);
        }
示例#30
0
        /// <summary>
        /// お知らせ情報の追加
        ///
        /// 使用画面:MstInfoMnt
        /// </summary>
        public int Insert()
        {
            ComDB         db     = new ComDB(_db_type, "COM");
            StringBuilder strSQL = new StringBuilder();
            int           rtn    = 0;

            // 最大のREC_NOを得る
            strSQL.Append("SELECT ");

            if (_db_type == "ORACLE")
            {
                strSQL.Append("NVL(MAX(REC_NO),0) ");
            }
            else
            {
                strSQL.Append("ISNULL(MAX(REC_NO),0) ");
            }

            strSQL.Append(" AS REC_NO");

            strSQL.Append(" FROM INFO_MASTER ");

            //if (_db_type == "ORACLE")
            //{
            //    strSQL.Append(" WHERE COMPANY_CD = :COMPANY_CD");

            //    db.DbParametersClear();
            //    db.DbPsetString("COMPANY_CD", _company_cd);
            //}
            //else
            //{
            //    strSQL.Append(" WHERE COMPANY_CD = @COMPANY_CD");

            //    db.DbParametersClear();
            //    db.DbPsetString("@COMPANY_CD", _company_cd);
            //}


            rtn = db.DbExecuteReader(strSQL.ToString());
            if (rtn == ComConst.FAILED)
            {
                _rec_no = 1;
            }
            else
            {
                try
                {
                    _rec_no = int.Parse(db.Row("REC_NO"));
                }
                catch
                {
                    _rec_no = 0;
                }

                _rec_no += 1;
            }

            db.DbCloseReader();

            // Insert
            strSQL = new StringBuilder();
            if (_db_type == "ORACLE")
            {
                strSQL.Append("INSERT INTO INFO_MASTER ");
                strSQL.Append("(");
                //strSQL.Append("COMPANY_CD, REC_NO, LANG, INFO_DATE, INFO_MSG,");
                strSQL.Append("REC_NO, LANG, INFO_DATE, INFO_MSG,");
                strSQL.Append("IMPORTANT_FLG, BEG_EFF_DATE, END_EFF_DATE,");
                strSQL.Append("ENTRY_DATE, CHG_DATE, CHG_USER_ID, UPDATE_CNTR");
                strSQL.Append(") VALUES (");
                //strSQL.Append(":COMPANY_CD, :REC_NO, :LANG, :INFO_DATE, :INFO_MSG,");
                strSQL.Append(":REC_NO, :LANG, :INFO_DATE, :INFO_MSG,");
                strSQL.Append(":IMPORTANT_FLG, :BEG_EFF_DATE, :END_EFF_DATE,");
                strSQL.Append(":ENTRY_DATE, :CHG_DATE, :CHG_USER_ID, :UPDATE_CNTR)");

                db.DbParametersClear();

                //db.DbPsetString("COMPANY_CD", _company_cd);
                db.DbPsetInt("REC_NO", _rec_no);
                db.DbPsetInt("LANG", _lang);
                db.DbPsetInt("INFO_DATE", _info_date);
                db.DbPsetString("INFO_MSG", _info_msg);
                db.DbPsetInt("IMPORTANT_FLG", _important_flg);
                db.DbPsetInt("BEG_EFF_DATE", _beg_eff_date);
                db.DbPsetInt("END_EFF_DATE", _end_eff_date);
                db.DbPsetDate("ENTRY_DATE", DateTime.Now);
                db.DbPsetDate("CHG_DATE", DateTime.Now);
                db.DbPsetString("CHG_USER_ID", _chg_user_id);
                db.DbPsetInt("UPDATE_CNTR", _update_cntr);
            }
            else
            {
                strSQL.Append("INSERT INTO INFO_MASTER ");
                strSQL.Append("(");
                //strSQL.Append("COMPANY_CD, REC_NO, LANG, INFO_DATE, INFO_MSG,");
                strSQL.Append("REC_NO, LANG, INFO_DATE, INFO_MSG,");
                strSQL.Append("IMPORTANT_FLG, BEG_EFF_DATE, END_EFF_DATE,");
                strSQL.Append("ENTRY_DATE, CHG_DATE, CHG_USER_ID, UPDATE_CNTR");
                strSQL.Append(") VALUES (");
                //strSQL.Append("@COMPANY_CD, @REC_NO, @LANG, @INFO_DATE, @INFO_MSG,");
                strSQL.Append("@REC_NO, @LANG, @INFO_DATE, @INFO_MSG,");
                strSQL.Append("@IMPORTANT_FLG, @BEG_EFF_DATE, @END_EFF_DATE,");
                strSQL.Append("@ENTRY_DATE, @CHG_DATE, @CHG_USER_ID, @UPDATE_CNTR)");

                db.DbParametersClear();

                //db.DbPsetString("@COMPANY_CD", _company_cd);
                db.DbPsetInt("@REC_NO", _rec_no);
                db.DbPsetInt("@LANG", _lang);
                db.DbPsetInt("@INFO_DATE", _info_date);
                db.DbPsetString("@INFO_MSG", _info_msg);
                db.DbPsetInt("@IMPORTANT_FLG", _important_flg);
                db.DbPsetInt("@BEG_EFF_DATE", _beg_eff_date);
                db.DbPsetInt("@END_EFF_DATE", _end_eff_date);
                db.DbPsetDate("@ENTRY_DATE", DateTime.Now);
                db.DbPsetDate("@CHG_DATE", DateTime.Now);
                db.DbPsetString("@CHG_USER_ID", _chg_user_id);
                db.DbPsetInt("@UPDATE_CNTR", _update_cntr);
            }


            db.DbBeginTrans();

            rtn = db.DbExecute(strSQL.ToString());
            if (rtn != ComConst.FAILED)
            {
                db.DbCommit();
            }
            else
            {
                _dbmsg  = db.expmsg;
                _strErr = db.strErr;
                db.DbRollback();
            }

            return(rtn);
        }