Пример #1
0
        public int GetHeadNo(out string rtnmc_prod_no)
        {
            ComDB db  = new ComDB(_db_type);
            int   rtn = 0;

            rtnmc_prod_no = "";
            db.DbParametersClear();

            db.DbPsetInt("RET", rtn, ComConst.DB_RTN);
            db.DbPsetString("@OptMethod", _OptMethod, ComConst.DB_IN);
            db.DbPsetString("@outHEADNO", rtnmc_prod_no, ComConst.DB_OUT);


            db.DbBeginTrans();
            rtn = db.DbStored("SP_PLAN_PROD_HEADNO");
            rtn = db.DbPgetInt("RET");
            if (rtn == ComConst.SUCCEED)
            {
                db.DbCommit();
            }
            else
            {
                db.DbRollback();
                rtn = ComConst.FAILED;
            }
            rtnmc_prod_no = db.DbPgetString("@outHEADNO");
            return(rtn);
        }
Пример #2
0
        /// <summary>
        /// 指定ユーザー・ロールの追加
        ///
        /// 使用クラス:MstUserMnt→User.Insert
        /// </summary>
        public int InsertUserRole(ComDB db)
        {
            StringBuilder strSQL = new StringBuilder();
            int           rtn    = 0;

            //--- sql
            strSQL.Append("INSERT INTO USER_ROLE_MASTER ");
            strSQL.Append("(");
            strSQL.Append("USER_ID, ROLE, ");
            strSQL.Append("ENTRY_DATE, CHG_DATE, CHG_USER_ID,");
            strSQL.Append("UPDATE_CNTR");
            strSQL.Append(") VALUES (");
            strSQL.Append("@USER_ID, @ROLE,");
            strSQL.Append("@ENTRY_DATE, @CHG_DATE, @CHG_USER_ID, @UPDATE_CNTR)");

            db.DbParametersClear();

            db.DbPsetString("@USER_ID", _user_id);
            db.DbPsetString("@ROLE", _role);
            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);

            rtn = db.DbExecute(strSQL.ToString());
            if (rtn == ComConst.FAILED)
            {
                _dbmsg  = db.expmsg;
                _strErr = db.strErr;
                db.DbRollback();
            }
            return(rtn);
        }
Пример #3
0
        /// <summary>
        /// 指定ユーザー・ロールの削除
        ///
        /// 使用画面:MstRoleMnt
        /// </summary>
        public int DeleteUserRole()
        {
            ComDB         db     = new ComDB("", "COM");
            StringBuilder strSQL = new StringBuilder();
            int           rtn    = 0;

            //--- sql
            strSQL.Append("DELETE FROM USER_ROLE_MASTER ");
            strSQL.Append(" WHERE USER_ID = @USER_ID");
            strSQL.Append("   AND ROLE = @ROLE");

            db.DbParametersClear();

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

            db.DbBeginTrans();

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

            return(rtn);
        }
Пример #4
0
        /// <summary>
        /// ロケーション一覧の取得
        ///
        /// 使用画面:MstLocationLblPrt
        /// </summary>
        public DataSet GetLocationListAll()
        {
            ComDB         db     = new ComDB(_db_type);
            StringBuilder strSQL = new StringBuilder();
            DataSet       ds     = new DataSet();

            //--- sql
            strSQL.Append("SELECT ");
            strSQL.Append("L.WHS_CD,			W.WHS_DESC,	");
            strSQL.Append("L.LOCATION,			L.LOCATION_DESC	");
            strSQL.Append(" FROM LOCATION_MASTER L ");
            strSQL.Append(" INNER JOIN WAREHOUSE_MASTER W ON W.WHS_CD = L.WHS_CD ");
            strSQL.Append(" WHERE 1 = 1 ");
            if (_whs_cd != "")
            {
                strSQL.Append(" AND L.WHS_CD = @WHS_CD ");
            }
            if (_location != "")
            {
                strSQL.Append(" AND L.LOCATION = @LOCATION ");
            }
            strSQL.Append(" ORDER BY  L.WHS_CD, L.LOCATION");

            db.DbParametersClear();
            if (_whs_cd != "")
            {
                db.DbPsetString("@WHS_CD", _whs_cd);
            }
            if (_location != "")
            {
                db.DbPsetString("@LOCATION", _location);
            }

            try
            {
                ds = db.DbDataSet(strSQL.ToString(), "TABLE");
                if (ds == null)
                {
                    _dbmsg  = db.expmsg;
                    _strErr = db.strErr;
                }
                if (db.State() == ConnectionState.Open)
                {
                    db.DbClose();
                }

                return(ds);
            }
            catch
            {
                _dbmsg  = db.expmsg;
                _strErr = db.strErr;
                if (db.State() == ConnectionState.Open)
                {
                    db.DbClose();
                }
                return(null);
            }
        }
Пример #5
0
        /// <summary>
        /// 使用画面:PurManPOPlanRpt
        /// </summary>
        public DataSet GetDayOfWeek()
        {
            ComDB         db     = new ComDB(_db_type);
            StringBuilder strSQL = new StringBuilder();
            DataSet       ds     = new DataSet();

            //--- sql
            strSQL.Append("SELECT DISTINCT                ");
            strSQL.Append("CALENDAR_CYM,  DAY_OF_WEEK,    TTL_WEEK      ");
            if (_db_type == "ORACLE")
            {
                strSQL.Append(" FROM CALENDAR_MASTER                                    ");
                strSQL.Append(" WHERE  CALENDAR_ID   = :CALENDAR_ID                     ");
                strSQL.Append(" AND CALENDAR_DATE  = :CALENDAR_DATE                     ");
                db.DbParametersClear();
                db.DbPsetString("CALENDAR_ID", _calendar_id);
                db.DbPsetInt("CALENDAR_DATE", _calendar_date);
            }
            else
            {
                strSQL.Append(" FROM CALENDAR_MASTER                                    ");
                strSQL.Append(" WHERE  CALENDAR_ID   = @CALENDAR_ID                     ");
                strSQL.Append(" AND CALENDAR_DATE  = @CALENDAR_DATE                     ");
                db.DbParametersClear();
                db.DbPsetString("@CALENDAR_ID", _calendar_id);
                db.DbPsetInt("@CALENDAR_DATE", _calendar_date);
            }
            strSQL.Append(" ORDER BY CALENDAR_CYM ");

            try
            {
                ds = db.DbDataSet(strSQL.ToString(), "Tabel");
                if (ds == null)
                {
                    _dbmsg  = db.expmsg;
                    _strErr = db.strErr;
                }
                if (db.State() == ConnectionState.Open)
                {
                    db.DbClose();
                }

                return(ds);
            }
            catch
            {
                _dbmsg  = db.expmsg;
                _strErr = db.strErr;
                if (db.State() == ConnectionState.Open)
                {
                    db.DbClose();
                }
                return(null);
            }
        }
Пример #6
0
        /// <summary>
        /// 指定画面の画面ラベル一覧
        /// </summary>
        public DataSet GetScreenLabelList()
        {
            ComDB         db     = new ComDB(_db_type);
            StringBuilder strSQL = new StringBuilder();
            DataSet       ds     = new DataSet();

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

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

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

            try
            {
                ds = db.DbDataSet(strSQL.ToString(), "screen");
                if (ds == null)
                {
                    _dbmsg  = db.expmsg;
                    _strErr = db.strErr;
                }
                if (db.State() == ConnectionState.Open)
                {
                    db.DbClose();
                }

                return(ds);
            }
            catch
            {
                _dbmsg  = db.expmsg;
                _strErr = db.strErr;
                if (db.State() == ConnectionState.Open)
                {
                    db.DbClose();
                }
                return(null);
            }
        }
Пример #7
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);
        }
Пример #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
        /// <summary>
        /// DateCheck
        /// <para>1) 指定日付からn日稼働日後の日付を編集
        /// IN: I_DATE1, I_WKDAYS     OUT: O_DATE	</para>
        ///
        /// <para>2) 指定日付からn日稼働日前の日付を編集
        /// IN: I_DATE1, I_WKDAYS     OUT: O_DATE</para>
        ///
        /// <para>3) 指定日付間の稼働日数を編集
        /// IN: I_DATE1, I_DATE2      OUT: O_WKDAYS	</para>
        ///
        /// <para>4) 指定日の情報を編集
        /// IN: I_DATE1    OUT: O_HOLIDAY_FLAG, O_PO_RLS_FLAG, O_STD_WORKING_HOUR</para>
        ///
        /// <para>5) 月の稼働日数数を編集(暦日指定)
        /// IN: I_DATE1	   OUT: O_WKDAYS	</para>
        /// 使用画面:OrdSOEntry
        /// </summary>
        public int Get_Date()
        {
            ComDB db  = new ComDB(_db_type);
            int   rtn = 0;

            db.DbParametersClear();

            db.DbPsetInt("RET", rtn, ComConst.DB_RTN);
            db.DbPsetString("@I_CALENDAR_ID", _calendar_id, ComConst.DB_IN);
            db.DbPsetInt("@I_DATE1", _date1, ComConst.DB_IN);
            db.DbPsetInt("@I_DATE2", _date2, ComConst.DB_IN);
            db.DbPsetInt("@I_WKDAYS", _i_wkdays, ComConst.DB_IN);
            db.DbPsetInt("@I_LANG", _lang, ComConst.DB_IN);
            db.DbPsetInt("@I_REQUEST_ID", _request_id, ComConst.DB_IN);
            db.DbPsetInt("@O_DATE", _date, ComConst.DB_OUT);
            db.DbPsetInt("@O_WKDAYS", _o_wkdays, ComConst.DB_OUT);
            db.DbPsetInt("@O_HOLIDAY_FLAG", _holiday_flag, ComConst.DB_OUT);
            db.DbPsetInt("@O_PO_RLS_FLAG", _po_rls_flag, ComConst.DB_OUT);
            db.DbPsetDouble("@O_STD_WORKING_HOUR", _std_working_hour, ComConst.DB_OUT);
            db.DbPsetInt("@O_ERRCODE", _errcode, ComConst.DB_OUT);
            db.DbPsetString("@O_MSG", _errmsg, ComConst.DB_OUT);
            db.DbPsetInt("@O_SQLCODE", _sqlcode, ComConst.DB_OUT);
            db.DbPsetString("@O_SQLMSG", _dbmsg, ComConst.DB_OUT);
            db.DbPsetString("@O_PROC_NAME", _proc_name, ComConst.DB_OUT);

            db.DbBeginTrans(); // Hoshina
            rtn = db.DbStored("SP_CALENDAR_CHECK");
            rtn = db.DbPgetInt("RET");

            if (rtn == ComConst.SUCCEED)
            {
                _date             = db.DbPgetInt("@O_DATE");
                _o_wkdays         = db.DbPgetInt("@O_WKDAYS");
                _holiday_flag     = db.DbPgetInt("@O_HOLIDAY_FLAG");
                _po_rls_flag      = db.DbPgetInt("@O_PO_RLS_FLAG");
                _std_working_hour = db.DbPgetInt("@O_STD_WORKING_HOUR");
                db.DbCommit();  // Hoshina
            }
            else
            {
                _errcode   = db.DbPgetInt("@O_ERRCODE");
                _errmsg    = db.DbPgetString("@O_MSG");
                _sqlcode   = db.DbPgetInt("@O_SQLCODE");
                _dbmsg     = db.DbPgetString("@O_SQLMSG");
                _proc_name = db.DbPgetString("@O_PROC_NAME");
                _strErr    = _errcode + ":" + _errmsg + "[" + _sqlcode + ":" + _dbmsg + "(" + _proc_name + ")]";
                db.DbRollback();  // Hoshina

                rtn = ComConst.FAILED;
            }
            return(rtn);
        }
Пример #10
0
        /// <summary>
        /// 画面ラベルの変更
        /// </summary>
        public int UpdateScreenLabel()
        {
            ComDB         db     = new ComDB(_db_type);
            StringBuilder strSQL = new StringBuilder();
            int           rtn    = 0;

            //--- sql
            if (_db_type == "ORACLE")
            {
                strSQL.Append("UPDATE SCREEN_LABEL_MASTER ");
                strSQL.Append("SET ");
                strSQL.Append("STD_ITEM = :STD_ITEM,");
                strSQL.Append("CHG_DATE = :CHG_DATE,");
                strSQL.Append("CHG_USER_ID = :CHG_USER_ID,");
                strSQL.Append("UPDATE_CNTR = UPDATE_CNTR + 1");
                strSQL.Append(" WHERE SCREEN_ID = :SCREEN_ID");
                strSQL.Append("   AND CONTROL_ID = :CONTROL_ID");

                db.DbParametersClear();
                db.DbPsetString("STD_ITEM", _std_item);
                db.DbPsetDate("CHG_DATE", DateTime.Now);
                db.DbPsetString("CHG_USER_ID", _chg_user_id);
                db.DbPsetString("SCREEN_ID", _screen_id);
                db.DbPsetString("CONTROL_ID", _control_id);
            }
            else
            {
                strSQL.Append("UPDATE SCREEN_LABEL_MASTER ");
                strSQL.Append("SET ");
                strSQL.Append("STD_ITEM = @STD_ITEM,");
                strSQL.Append("CHG_DATE = @CHG_DATE,");
                strSQL.Append("CHG_USER_ID = @CHG_USER_ID,");
                strSQL.Append("UPDATE_CNTR = UPDATE_CNTR + 1");
                strSQL.Append(" WHERE SCREEN_ID = @SCREEN_ID");
                strSQL.Append("   AND CONTROL_ID = @CONTROL_ID");

                db.DbParametersClear();
                db.DbPsetString("STD_ITEM", _std_item);
                db.DbPsetDate("CHG_DATE", DateTime.Now);
                db.DbPsetString("CHG_USER_ID", _chg_user_id);
                db.DbPsetString("SCREEN_ID", _screen_id);
                db.DbPsetString("CONTROL_ID", _control_id);
            }

            db.DbBeginTrans();

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

            return(rtn);
        }
Пример #11
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);
        }
Пример #12
0
        public int DetailUpdate()
        {
            ComDB db  = new ComDB(_db_type);
            int   rtn = 0;

            db.DbParametersClear();

            db.DbPsetInt("RET", rtn, ComConst.DB_RTN);
            db.DbPsetString("@FE_CKD_NO", _fe_ckd_no, ComConst.DB_IN);
            db.DbPsetInt("@FE_CKD_LINE", _fe_ckd_line, ComConst.DB_IN);
            db.DbPsetDate("@FE_DEL_N_2", _fe_del_n_2, ComConst.DB_IN);
            db.DbPsetString("@VENDOR", _vendor, ComConst.DB_IN);
            db.DbPsetString("@DIST", _dist, ComConst.DB_IN);
            db.DbPsetString("@MODEL", _model, ComConst.DB_IN);
            db.DbPsetInt("@QTY", _qty, ComConst.DB_IN);
            db.DbPsetString("@PC_NO", _pc_no, ComConst.DB_IN);
            db.DbPsetInt("@BLOCK_QTY", _block_qty, ComConst.DB_IN);
            db.DbPsetInt("@HEAD_QTY", _head_qty, ComConst.DB_IN);
            db.DbPsetDate("@VAN_ORIGINAL", _van_original, ComConst.DB_IN);
            db.DbPsetString("@CY_CUT", _cy_cut, ComConst.DB_IN);
            db.DbPsetString("@TIME_LCD", _time_lcd, ComConst.DB_IN);
            db.DbPsetDate("@ETD", _etd, ComConst.DB_IN);
            db.DbPsetString("@VESSEL", _vessel, ComConst.DB_IN);
            db.DbPsetString("@REMARK", _remark, ComConst.DB_IN);
            db.DbPsetInt("@FLAG", _flag, ComConst.DB_IN);

            //db.DbPsetInt("@O_ERRCODE", _errcode, ComConst.DB_OUT);
            //db.DbPsetString("@O_MSG", _errmsg, ComConst.DB_OUT);
            //db.DbPsetInt("@O_SQLCODE", _sqlcode, ComConst.DB_OUT);
            //db.DbPsetString("@O_SQLMSG", _dbmsg, ComConst.DB_OUT);
            //db.DbPsetString("@O_PROC_NAME", _proc_name, ComConst.DB_OUT);

            db.DbBeginTrans();
            rtn = db.DbStored("SP_PLAN_PROD_FECKD_DETAIL_UPDATE");
            rtn = db.DbPgetInt("RET");
            if (rtn == ComConst.SUCCEED)
            {
                db.DbCommit();
            }
            else
            {
                //_errcode = db.DbPgetInt("@O_ERRCODE");
                //_errmsg = db.DbPgetString("@O_MSG");
                //_sqlcode = db.DbPgetInt("@O_SQLCODE");
                //_dbmsg = db.DbPgetString("@O_SQLMSG");
                //_proc_name = db.DbPgetString("@O_PROC_NAME");
                //_strErr = _errcode + ":" + _errmsg + "[" + _sqlcode + ":" + _dbmsg + "(" + _proc_name + ")]";
                db.DbRollback();
                rtn = ComConst.FAILED;
            }

            return(rtn);
        }
Пример #13
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);
        }
Пример #14
0
        public int HeadUpdate()
        {
            ComDB db  = new ComDB(_db_type);
            int   rtn = 0;

            db.DbParametersClear();

            db.DbPsetInt("RET", rtn, ComConst.DB_RTN);
            //db.DbPsetString("@MC_PROD_NO", _mc_prod_no, ComConst.DB_IN);
            db.DbPsetInt("@YEAR", _year, ComConst.DB_IN);
            db.DbPsetInt("@MONTH", _month, ComConst.DB_IN);
            //db.DbPsetInt("@VERSION", _version, ComConst.DB_IN);
            //db.DbPsetString("@PART_NO", _part_no, ComConst.DB_IN);
            //db.DbPsetString("@REMARK", _remark, ComConst.DB_IN);
            //db.DbPsetDate("@ENTRY_DATE", _entry_date, ComConst.DB_IN);
            //db.DbPsetDate("@UPDATE_DATE", _chg_date, ComConst.DB_IN);
            //db.DbPsetString("@USER_CREATE", _chg_user_id, ComConst.DB_IN);
            db.DbPsetString("@USER_UPDATE", _chg_user_id, ComConst.DB_IN);
            //db.DbPsetString("@rtnHEAD_NO", rtnmc_prod_no, ComConst.DB_OUT);

            db.DbPsetInt("@O_ERRCODE", _errcode, ComConst.DB_OUT);
            db.DbPsetString("@O_MSG", _errmsg, ComConst.DB_OUT);
            db.DbPsetInt("@O_SQLCODE", _sqlcode, ComConst.DB_OUT);
            db.DbPsetString("@O_SQLMSG", _dbmsg, ComConst.DB_OUT);
            db.DbPsetString("@O_PROC_NAME", _proc_name, ComConst.DB_OUT);

            db.DbBeginTrans();
            rtn = db.DbStored("SP_PLAN_PROD_MC_HEADER_UPDATE");
            rtn = db.DbPgetInt("RET");
            if (rtn == ComConst.SUCCEED)
            {
                db.DbCommit();
            }
            else
            {
                _errcode   = db.DbPgetInt("@O_ERRCODE");
                _errmsg    = db.DbPgetString("@O_MSG");
                _sqlcode   = db.DbPgetInt("@O_SQLCODE");
                _dbmsg     = db.DbPgetString("@O_SQLMSG");
                _proc_name = db.DbPgetString("@O_PROC_NAME");
                _strErr    = _errcode + ":" + _errmsg + "[" + _sqlcode + ":" + _dbmsg + "(" + _proc_name + ")]";
                db.DbRollback();
                rtn = ComConst.FAILED;
            }

            return(rtn);
        }
Пример #15
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);
        }
Пример #16
0
        /// <summary>
        ///  工程NG理由の取得

        ///
        /// 使用画面:MstProcessNGReasonMnt
        /// </summary>
        public DataSet GetList()
        {
            ComDB         db     = new ComDB(_db_type);
            StringBuilder strSQL = new StringBuilder();
            DataSet       ds     = new DataSet();

            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(" ORDER BY  D.NG_REASON_CD ");

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

            try
            {
                ds = db.DbDataSet(strSQL.ToString(), "TABLE");
                if (ds == null)
                {
                    _dbmsg  = db.expmsg;
                    _strErr = db.strErr;
                }
                if (db.State() == ConnectionState.Open)
                {
                    db.DbClose();
                }

                return(ds);
            }
            catch
            {
                _dbmsg  = db.expmsg;
                _strErr = db.strErr;
                if (db.State() == ConnectionState.Open)
                {
                    db.DbClose();
                }
                return(null);
            }
        }
Пример #17
0
        //-->ADD BY UBIQ-SUO 2010/09/19
        /// <summary>
        /// MRP倉庫一覧の取得

        ///
        /// 使用画面:SrchMrpWhs
        /// </summary>
        public DataSet GetMrpWarehouseList()
        {
            ComDB         db     = new ComDB(_db_type);
            StringBuilder strSQL = new StringBuilder();
            DataSet       ds     = new DataSet();

            //--- sql
            strSQL.Append("SELECT ");
            strSQL.Append("WHS_CD,				MRP_WHS,			WHS_DESC,			WHS_DESC2,			");
            strSQL.Append("RECV_LOC,			WHS_TYPE,			WHS_ITEM_TYPE,		LOCATION_CTRL_FLAG,	AUTO_HOUSING_TYPE,");
            strSQL.Append("DIRECT_SHIP_FLAG,	VENDOR_CD,			CONS_WHS_FLAG,		CONS_VENDOR_CD,		");
            strSQL.Append("PASS_THRU_WHS_CD,	BOND_FLAG,			DATA_CHAR1,			DATA_CHAR2,			");
            strSQL.Append("DATA_CHAR3,			DATA_CHAR4,			DATA_CHAR5,			DATA_CHAR6,			");
            strSQL.Append("DATA_CHAR7,			DATA_CHAR8,			DATA_CHAR9,			DATA_CHAR10,		");
            strSQL.Append("DATA_NUM1,			DATA_NUM2,			DATA_NUM3,			DATA_NUM4,			");
            strSQL.Append("DATA_NUM5,			DATA_NUM6,			DATA_NUM7,			DATA_NUM8,			");
            strSQL.Append("DATA_NUM9,			DATA_NUM10,			DATA_FLAG1,			DATA_FLAG2,			");
            strSQL.Append("DATA_FLAG3,			DATA_FLAG4,			DATA_FLAG5,			DATA_FLAG6,			");
            strSQL.Append("DATA_FLAG7,			DATA_FLAG8,			DATA_FLAG9,			DATA_FLAG10,		");
            strSQL.Append("ENTRY_DATE,			CHG_DATE,			CHG_PGM,			CHG_USERID,			");
            strSQL.Append("UPDATE_CNTR,         SUPPLY_TYPE                                                 ");
            strSQL.Append(" FROM WAREHOUSE_MASTER ");
            strSQL.Append(" WHERE WHS_CD = MRP_WHS ");
            if (_mrp_whs != "")
            {
                strSQL.Append(" AND MRP_WHS = @MRP_WHS ");
                db.DbParametersClear();
                db.DbPsetString("@MRP_WHS", _mrp_whs);
            }
            strSQL.Append(" ORDER BY  WHS_CD");

            //db.DbParametersClear();

            try
            {
                ds = db.DbDataSet(strSQL.ToString(), "TABLE");
                if (ds == null)
                {
                    _dbmsg  = db.expmsg;
                    _strErr = db.strErr;
                }
                if (db.State() == ConnectionState.Open)
                {
                    db.DbClose();
                }

                return(ds);
            }
            catch
            {
                _dbmsg  = db.expmsg;
                _strErr = db.strErr;
                if (db.State() == ConnectionState.Open)
                {
                    db.DbClose();
                }
                return(null);
            }
        }
Пример #18
0
        /// <summary>
        /// 工程一覧の取得
        ///
        /// 使用画面:MstProcessMnt
        /// </summary>
        public DataSet GetProcessSearch()
        {
            ComDB         db     = new ComDB(_db_type);
            StringBuilder strSQL = new StringBuilder();
            DataSet       ds     = new DataSet();

            //--- sql
            strSQL.Append("SELECT ");
            strSQL.Append("WS_CD,				PROCESS_CD,			PROCESS_DESC,		PROCESS_DESC2,		COST_CENTER,	");
            strSQL.Append("SC_FLAG,			    VENDOR_CD,		    CAPA_MH,            TIME_CONSTRAINT,    DATA_CHAR1,			DATA_CHAR2,     ");
            strSQL.Append("DATA_CHAR3,			DATA_CHAR4,			DATA_CHAR5,			DATA_CHAR6,			");
            strSQL.Append("DATA_CHAR7,			DATA_CHAR8,			DATA_CHAR9,			DATA_CHAR10,		");
            strSQL.Append("DATA_NUM1,			DATA_NUM2,			DATA_NUM3,			DATA_NUM4,			");
            strSQL.Append("DATA_NUM5,			DATA_NUM6,			DATA_NUM7,			DATA_NUM8,			");
            strSQL.Append("DATA_NUM9,			DATA_NUM10,			DATA_FLAG1,			DATA_FLAG2,			");
            strSQL.Append("DATA_FLAG3,			DATA_FLAG4,			DATA_FLAG5,			DATA_FLAG6,			");
            strSQL.Append("DATA_FLAG7,			DATA_FLAG8,			DATA_FLAG9,			DATA_FLAG10,		");
            strSQL.Append("ENTRY_DATE,			CHG_DATE,			CHG_PGM,			CHG_USERID,			");
            strSQL.Append("UPDATE_CNTR                                                                      ");
            strSQL.Append(" FROM PROCESS_MASTER                                                             ");
            if (_ws_cd != "")
            {
                strSQL.Append(" WHERE WS_CD = @WS_CD                                                        ");
            }
            strSQL.Append(" ORDER BY  PROCESS_CD                                                            ");

            db.DbParametersClear();
            if (_ws_cd != "")
            {
                db.DbPsetString("@WS_CD", _ws_cd, ComConst.DB_IN);
            }

            try
            {
                ds = db.DbDataSet(strSQL.ToString(), "TABLE");
                if (ds == null)
                {
                    _dbmsg  = db.expmsg;
                    _strErr = db.strErr;
                }
                if (db.State() == ConnectionState.Open)
                {
                    db.DbClose();
                }

                return(ds);
            }
            catch
            {
                _dbmsg  = db.expmsg;
                _strErr = db.strErr;
                if (db.State() == ConnectionState.Open)
                {
                    db.DbClose();
                }
                return(null);
            }
        }
Пример #19
0
        /// <summary>
        /// 在庫引当、引当解除処理

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

            db.DbParametersClear();

            db.DbPsetInt("RET", rtn, ComConst.DB_RTN);
            db.DbPsetString("@I_SCH_ID", _sch_id, ComConst.DB_IN);
            db.DbPsetString("@I_WS_CD", _ws_cd, ComConst.DB_IN);
            db.DbPsetString("@I_WHS_CD", _whs_cd, ComConst.DB_IN);
            db.DbPsetString("@I_ITEM_NO", _item_no, ComConst.DB_IN);
            db.DbPsetInt("@I_SCH_DISB_DATE", _sch_disb_date, ComConst.DB_IN);
            db.DbPsetString("@I_JOC_CD", _joc_cd, ComConst.DB_IN);
            db.DbPsetInt("@I_REQUEST_NO", _request_no, ComConst.DB_IN);
            db.DbPsetString("@I_CHG_PGM", _chg_pgm, ComConst.DB_IN);
            db.DbPsetString("@I_CHG_USER_ID", _chg_user_id, ComConst.DB_IN);
            db.DbPsetInt("@I_LANG", _lang, ComConst.DB_IN);
            db.DbPsetInt("@O_ERRCODE", _errcode, ComConst.DB_OUT);
            db.DbPsetString("@O_MSG", _errmsg, ComConst.DB_OUT);
            db.DbPsetInt("@O_SQLCODE", _sqlcode, ComConst.DB_OUT);
            db.DbPsetString("@O_SQLMSG", _dbmsg, ComConst.DB_OUT);
            db.DbPsetString("@O_PROC_NAME", _proc_name, ComConst.DB_OUT);

            //db.DbBeginTrans();  // IMV3
            rtn = db.DbStored("SP_ITEM_DISB_ALLOC");
            rtn = db.DbPgetInt("RET");
            if (rtn == ComConst.SUCCEED || rtn == 10)
            {
                //db.DbCommit();
            }
            else
            {
                _errcode   = db.DbPgetInt("@O_ERRCODE");
                _errmsg    = db.DbPgetString("@O_MSG");
                _sqlcode   = db.DbPgetInt("@O_SQLCODE");
                _dbmsg     = db.DbPgetString("@O_SQLMSG");
                _proc_name = db.DbPgetString("@O_PROC_NAME");
                _strErr    = _errcode + ":" + _errmsg + "[" + _sqlcode + ":" + _dbmsg + "(" + _proc_name + ")]";
                //db.DbRollback();
                rtn = ComConst.FAILED;
            }

            return(rtn);
        }
Пример #20
0
        public int DetailUpdate()
        {
            ComDB db  = new ComDB(_db_type);
            int   rtn = 0;

            db.DbParametersClear();

            db.DbPsetInt("RET", rtn, ComConst.DB_RTN);
            db.DbPsetString("@SERVICE_PART_NO", _server_part_no, ComConst.DB_IN);
            db.DbPsetInt("@SERVICE_PART_LINE", _server_part_line, ComConst.DB_IN);
            db.DbPsetString("@PART_NO", _part_no, ComConst.DB_IN);
            db.DbPsetString("@MODEL", _model, ComConst.DB_IN);
            db.DbPsetInt("@ORDER", _order, ComConst.DB_IN);
            db.DbPsetInt("@DIFF", _diff, ComConst.DB_IN);
            db.DbPsetDate("@DELIVERY_PLAN_DATE", _delivery_plan_date, ComConst.DB_IN);
            db.DbPsetInt("@PLAN_QTY", _plan_qty, ComConst.DB_IN);


            //db.DbPsetInt("@O_ERRCODE", _errcode, ComConst.DB_OUT);
            //db.DbPsetString("@O_MSG", _errmsg, ComConst.DB_OUT);
            //db.DbPsetInt("@O_SQLCODE", _sqlcode, ComConst.DB_OUT);
            //db.DbPsetString("@O_SQLMSG", _dbmsg, ComConst.DB_OUT);
            //db.DbPsetString("@O_PROC_NAME", _proc_name, ComConst.DB_OUT);

            db.DbBeginTrans();
            rtn = db.DbStored("SP_PLAN_PROD_SVC_DETAIL_UPDATE");
            rtn = db.DbPgetInt("RET");
            if (rtn == ComConst.SUCCEED)
            {
                db.DbCommit();
            }
            else
            {
                //_errcode = db.DbPgetInt("@O_ERRCODE");
                //_errmsg = db.DbPgetString("@O_MSG");
                //_sqlcode = db.DbPgetInt("@O_SQLCODE");
                //_dbmsg = db.DbPgetString("@O_SQLMSG");
                //_proc_name = db.DbPgetString("@O_PROC_NAME");
                //_strErr = _errcode + ":" + _errmsg + "[" + _sqlcode + ":" + _dbmsg + "(" + _proc_name + ")]";
                db.DbRollback();
                rtn = ComConst.FAILED;
            }

            return(rtn);
        }
Пример #21
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);
        }
Пример #22
0
        /// <summary>
        /// ロールの追加
        ///
        /// 使用画面:MstRoleMnt
        /// </summary>
        public int Insert()
        {
            ComDB         db     = new ComDB("", "COM");
            StringBuilder strSQL = new StringBuilder();
            int           rtn    = 0;

            //--- sql
            strSQL.Append("INSERT INTO USER_ROLE_MASTER ");
            strSQL.Append("(");
            strSQL.Append("USER_GROUP_CODE, USER_GROUP_NAME, GROUP_ACTIVE, MANAGEMENT_LEVEL,");
            strSQL.Append("DEPT_NO, PROCESS_NO");
            strSQL.Append("ENTRY_DATE, UPDATE_DATE, USER_CREATE");
            strSQL.Append(") VALUES (");
            strSQL.Append("@ROLE, @ROLE_DESC, @DEL_DISABLE_FLAG, @MGMT_LEVEL,");
            strSQL.Append("@DEPT_NO, @PROCESS_NO");
            strSQL.Append("@ENTRY_DATE, @CHG_DATE, @CHG_USER_ID)");

            db.DbParametersClear();

            db.DbPsetString("@ROLE", _role);
            db.DbPsetString("@ROLE_DESC", _role_desc);
            db.DbPsetInt("@DEL_DISABLE_FLAG", _del_disable_flag);
            db.DbPsetInt("@MGMT_LEVEL", int.Parse(_mgmt_level));
            db.DbPsetInt("@DEPT_NO", int.Parse(_dept_no));
            db.DbPsetInt("@PROCESS_NO", int.Parse(_process_no));
            db.DbPsetDate("@ENTRY_DATE", DateTime.Now);
            db.DbPsetDate("@CHG_DATE", DateTime.Now);
            db.DbPsetString("@CHG_USER_ID", _chg_user_id);

            db.DbBeginTrans();

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

            return(rtn);
        }
Пример #23
0
        /// <summary>
        /// メッセージの削除
        /// </summary>
        public int Delete()
        {
            ComDB         db     = new ComDB(_db_type);
            StringBuilder strSQL = new StringBuilder();
            int           rtn    = 0;

            //--- sql
            if (_db_type == "ORACLE")
            {
                strSQL.Append("DELETE FROM MESSAGE_MASTER ");
                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("DELETE FROM MESSAGE_MASTER ");
                strSQL.Append(" WHERE MSG_CD = @MSG_CD");
                strSQL.Append("   AND LANG = @LANG");

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

            db.DbBeginTrans();

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

            return(rtn);
        }
Пример #24
0
        /// <summary>
        /// 画面ラベルの削除
        /// </summary>
        public int DeleteScreenLabel()
        {
            ComDB         db     = new ComDB(_db_type);
            StringBuilder strSQL = new StringBuilder();
            int           rtn    = 0;

            //--- sql
            if (_db_type == "ORACLE")
            {
                strSQL.Append("DELETE FROM SCREEN_LABEL_MASTER ");
                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("DELETE FROM SCREEN_LABEL_MASTER ");
                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);
            }

            db.DbBeginTrans();

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

            return(rtn);
        }
Пример #25
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);
        }
Пример #26
0
        /// <summary>
        /// ロケーションの追加 HTS
        ///
        /// 使用画面:MstLocationMnt
        /// </summary>
        public int Update()
        {
            ComDB db  = new ComDB(_db_type);
            int   rtn = 0;

            db.DbParametersClear();

            db.DbPsetInt("RET", rtn, ComConst.DB_RTN);
            db.DbPsetString("@I_WHS_CD", _whs_cd, ComConst.DB_IN);
            db.DbPsetString("@I_LOCATION", _location, ComConst.DB_IN);
            db.DbPsetString("@I_LOCATION_DESC", _location_desc, ComConst.DB_IN);
            db.DbPsetString("@I_LOCATION_DESC2", _location_desc2, ComConst.DB_IN); // HTS
            db.DbPsetString("@I_DEPT_NO", _dept_no, ComConst.DB_IN);               // HTS
            db.DbPsetString("@I_CHG_PGM", _chg_pgm, ComConst.DB_IN);
            db.DbPsetString("@I_CHG_USER_ID", _chg_user_id, ComConst.DB_IN);
            db.DbPsetInt("@I_LANG", _lang, ComConst.DB_IN);
            db.DbPsetInt("@O_ERRCODE", _errcode, ComConst.DB_OUT);
            db.DbPsetString("@O_MSG", _errmsg, ComConst.DB_OUT);
            db.DbPsetInt("@O_SQLCODE", _sqlcode, ComConst.DB_OUT);
            db.DbPsetString("@O_SQLMSG", _dbmsg, ComConst.DB_OUT);
            db.DbPsetString("@O_PROC_NAME", _proc_name, ComConst.DB_OUT);

            db.DbBeginTrans();
            rtn = db.DbStored("SP_LOCATION_UPDATE");
            rtn = db.DbPgetInt("RET");
            if (rtn == ComConst.SUCCEED)
            {
                db.DbCommit();
            }
            else
            {
                _errcode   = db.DbPgetInt("@O_ERRCODE");
                _errmsg    = db.DbPgetString("@O_MSG");
                _sqlcode   = db.DbPgetInt("@O_SQLCODE");
                _dbmsg     = db.DbPgetString("@O_SQLMSG");
                _proc_name = db.DbPgetString("@O_PROC_NAME");
                _strErr    = _errcode + ":" + _errmsg + "[" + _sqlcode + ":" + _dbmsg + "(" + _proc_name + ")]";
                db.DbRollback();
                rtn = ComConst.FAILED;
            }

            return(rtn);
        }
Пример #27
0
        public int HeadInsert()
        {
            ComDB db  = new ComDB(_db_type);
            int   rtn = 0;

            //rtnfe_ckd_no = "";
            db.DbParametersClear();

            db.DbPsetInt("RET", rtn, ComConst.DB_RTN);
            db.DbPsetString("@FE_CKD_NO", _fe_ckd_no, ComConst.DB_IN);
            db.DbPsetInt("@YEAR", _year, ComConst.DB_IN);
            db.DbPsetInt("@MONTH", _month, ComConst.DB_IN);
            db.DbPsetInt("@VERSION", _version, ComConst.DB_IN);
            db.DbPsetString("@USER_CREATE", _chg_user_id, ComConst.DB_IN);
            //db.DbPsetString("@rtnHEAD_NO", rtnfe_ckd_no, ComConst.DB_OUT);

            db.DbPsetInt("@O_ERRCODE", _errcode, ComConst.DB_OUT);
            db.DbPsetString("@O_MSG", _errmsg, ComConst.DB_OUT);
            db.DbPsetInt("@O_SQLCODE", _sqlcode, ComConst.DB_OUT);
            db.DbPsetString("@O_SQLMSG", _dbmsg, ComConst.DB_OUT);
            db.DbPsetString("@O_PROC_NAME", _proc_name, ComConst.DB_OUT);

            db.DbBeginTrans();
            rtn = db.DbStored("SP_PLAN_PROD_FECKD_HEADER_INSERT");
            rtn = db.DbPgetInt("RET");
            if (rtn == ComConst.SUCCEED)
            {
                db.DbCommit();
            }
            else
            {
                _errcode   = db.DbPgetInt("@O_ERRCODE");
                _errmsg    = db.DbPgetString("@O_MSG");
                _sqlcode   = db.DbPgetInt("@O_SQLCODE");
                _dbmsg     = db.DbPgetString("@O_SQLMSG");
                _proc_name = db.DbPgetString("@O_PROC_NAME");
                _strErr    = _errcode + ":" + _errmsg + "[" + _sqlcode + ":" + _dbmsg + "(" + _proc_name + ")]";
                db.DbRollback();
                rtn = ComConst.FAILED;
            }
            //rtnfe_ckd_no=db.DbPgetString("@rtnHEAD_NO");
            return(rtn);
        }
Пример #28
0
        public int DetailUpdate()
        {
            ComDB db  = new ComDB(_db_type);
            int   rtn = 0;

            db.DbParametersClear();

            db.DbPsetInt("RET", rtn, ComConst.DB_RTN);
            db.DbPsetString("@MC_PROD_NO", _mc_prod_no, ComConst.DB_IN);
            db.DbPsetInt("@MC_LINE_NO", _mc_line_no, ComConst.DB_IN);
            db.DbPsetString("@PART_NO", _part_no, ComConst.DB_IN);
            //db.DbPsetString("@TYPE_PART", _type_part, ComConst.DB_IN);
            db.DbPsetDate("@PRODUCTION_PLAN_DATE", _production_plan_date, ComConst.DB_IN);
            db.DbPsetInt("@PLAN_QTY", _plan_qty, ComConst.DB_IN);


            //db.DbPsetInt("@O_ERRCODE", _errcode, ComConst.DB_OUT);
            //db.DbPsetString("@O_MSG", _errmsg, ComConst.DB_OUT);
            //db.DbPsetInt("@O_SQLCODE", _sqlcode, ComConst.DB_OUT);
            //db.DbPsetString("@O_SQLMSG", _dbmsg, ComConst.DB_OUT);
            //db.DbPsetString("@O_PROC_NAME", _proc_name, ComConst.DB_OUT);

            db.DbBeginTrans();
            rtn = db.DbStored("SP_PLAN_PROD_MC_DETAIL_UPDATE");
            rtn = db.DbPgetInt("RET");
            if (rtn == ComConst.SUCCEED)
            {
                db.DbCommit();
            }
            else
            {
                //_errcode = db.DbPgetInt("@O_ERRCODE");
                //_errmsg = db.DbPgetString("@O_MSG");
                //_sqlcode = db.DbPgetInt("@O_SQLCODE");
                //_dbmsg = db.DbPgetString("@O_SQLMSG");
                //_proc_name = db.DbPgetString("@O_PROC_NAME");
                //_strErr = _errcode + ":" + _errmsg + "[" + _sqlcode + ":" + _dbmsg + "(" + _proc_name + ")]";
                db.DbRollback();
                rtn = ComConst.FAILED;
            }

            return(rtn);
        }
Пример #29
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);
        }
Пример #30
0
        public int Delete()
        {
            ComDB         db     = new ComDB(_db_type);
            StringBuilder strSQL = new StringBuilder();
            int           rtn    = 0;

            //--- sql
            if (_db_type == "ORACLE")
            {
                strSQL.Append("DELETE FROM PLAN_PROD_FE_CKD_DETAIL ");
                strSQL.Append(" WHERE FE_CKD_NO = :FE_CKD_NO");

                db.DbParametersClear();
                db.DbPsetString("FE_CKD_NO", _fe_ckd_no);
            }
            else
            {
                strSQL.Append("DELETE FROM PLAN_PROD_FE_CKD_DETAIL ");
                strSQL.Append(" WHERE FE_CKD_NO = @FE_CKD_NO");

                db.DbParametersClear();
                db.DbPsetString("@FE_CKD_NO", _fe_ckd_no);
            }


            db.DbBeginTrans();

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

            return(rtn);
        }