/// <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); }
/// <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); }
/// <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); }
/// <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); }
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); }
//-->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); } }
/// <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); } }
/// <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); } }
public int Insert() { ComDB db = new ComDB(_db_type); int rtn = 0; db.DbParametersClear(); db.DbPsetInt("RET", rtn, ComConst.DB_RTN); db.DbPsetString("@SLIP_NO", _slip_no, ComConst.DB_IN); db.DbPsetString("@DATE", _date, ComConst.DB_IN); db.DbPsetString("@TIME", _time, ComConst.DB_IN); db.DbPsetString("@PROC_LOC_FROM", _proc_loc_from, ComConst.DB_IN); db.DbPsetString("@MAKER_NAME", _maker_name, ComConst.DB_IN); db.DbPsetString("@SHIP_TO", _ship_to, ComConst.DB_IN); db.DbPsetString("@PART_NO", _part_no, ComConst.DB_IN); db.DbPsetString("@PART_NAME", _part_name, ComConst.DB_IN); db.DbPsetString("@COLOR", _color, ComConst.DB_IN); db.DbPsetString("@RECEIVE_CYCLE", _receive_cycle, ComConst.DB_IN); db.DbPsetString("@INV_CATEGORY", _inv_category, ComConst.DB_IN); db.DbPsetString("@KD_LOT_FROM", _kd_lot_from, ComConst.DB_IN); db.DbPsetString("@KD_LOT_TO", _kd_lot_to, ComConst.DB_IN); db.DbPsetString("@PROC_LOC_TO", _proc_loc_to, ComConst.DB_IN); db.DbPsetString("@DELV_ADDR", _delv_addr, ComConst.DB_IN); db.DbPsetInt("@DELV_SCDLL_QTY", _delv_scdll_qty, ComConst.DB_IN); db.DbPsetInt("@PART_UNLD_QTY", _part_unld_qty, ComConst.DB_IN); db.DbPsetInt("@PROGRESS", _progress, ComConst.DB_IN); db.DbPsetString("@INV_LOC_CD", _inv_category, 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_PUR_REC_LOCAL_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; } return(rtn); }
public int HeadInsert() { ComDB db = new ComDB(_db_type); int rtn = 0; //rtnkd_prod_no = ""; db.DbParametersClear(); db.DbPsetInt("RET", rtn, ComConst.DB_RTN); db.DbPsetString("@KD_SPECIAL_NO", _kd_special_no, ComConst.DB_IN); db.DbPsetString("@ORDER_NO", _order_no, ComConst.DB_IN); db.DbPsetDate("@ORDER_DATE", _order_date, ComConst.DB_IN); db.DbPsetString("@PC_NO", _pc_no, ComConst.DB_IN); db.DbPsetString("@PART_DELIVERY", _part_delivery, ComConst.DB_IN); db.DbPsetDate("@PACKING_DATE", _packing_date, ComConst.DB_IN); db.DbPsetDate("@PACKING_LIST_TO_LB", _packing_list_to_lb, ComConst.DB_IN); db.DbPsetDate("@ETD_DATE", _etd_date, ComConst.DB_IN); db.DbPsetDate("@ETA_DATE", _eta_date, ComConst.DB_IN); db.DbPsetString("@SHIP_BY", _ship_by, ComConst.DB_IN); db.DbPsetDate("@RTA", _rta, ComConst.DB_IN); db.DbPsetDate("@ISSUE_DATE", _issue_date, ComConst.DB_IN); db.DbPsetString("@MODEL_CODE", _model_code, ComConst.DB_IN); db.DbPsetString("@MODEL_TYPE", _model_type, ComConst.DB_IN); db.DbPsetString("@ISSUE_BY", _issue_by, ComConst.DB_IN); db.DbPsetString("@REMARK", _remark, ComConst.DB_IN); db.DbPsetString("@CREATE_BY", _chg_user_id, ComConst.DB_IN); //db.DbPsetString("@rtnHEAD_NO", rtnkd_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_KD_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; } //rtnkd_prod_no = db.DbPgetString("@rtnHEAD_NO"); return(rtn); }
/// <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); } }
/// <summary> /// 製造資源の変更 /// /// 使用画面:MstRoutineResourceMnt /// </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_ITEM_NO", _item_no, ComConst.DB_IN); db.DbPsetString("@I_WS_CD", _ws_cd, ComConst.DB_IN); db.DbPsetInt("@I_ROUTINE_SEQ", _routine_seq, ComConst.DB_IN); db.DbPsetString("@I_PROCESS_CD", _process_cd, ComConst.DB_IN); db.DbPsetInt("@I_PTY_NO", _pty_no, ComConst.DB_IN); db.DbPsetString("@I_RESOURCE_CD", _resource_cd, ComConst.DB_IN); db.DbPsetDouble("@I_SETUP_TIME", _setup_time, ComConst.DB_IN); db.DbPsetDouble("@I_UNIT_TIME", _unit_time, ComConst.DB_IN); db.DbPsetDouble("@I_UNIT_QTY", _unit_qty, ComConst.DB_IN); db.DbPsetDouble("@I_TRANSFER_TIME", _transfer_time, ComConst.DB_IN); db.DbPsetDouble("@I_MFG_LOT_QTY", _mfg_lot_qty, ComConst.DB_IN); db.DbPsetString("@I_SPEC_CD", _spec_cd, ComConst.DB_IN); db.DbPsetString("@I_JIGU", _jigu, ComConst.DB_IN); db.DbPsetString("@I_DIE", _die, 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(); rtn = db.DbStored("SP_ROUTINE_RESOURCE_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); }
/// <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); }
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); }
/// <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); } }
//add by ubiq-suo 2010/10/21 end #region SetddlData コンボボックスに表示値をセットする(SQL) /// <summary> /// コンボボックスに表示値をセットする /// </summary> /// <param name="ddl">コンボボックス</param> /// <param name="SQL">SQL文</param> /// <param name="blank">先頭に空白をセットする</param> /// <param name="Description">Descriptionをセットする</param> public void SetDdlData(object ddl, string SQL, bool blank) { ComDB db = new ComDB(); DataSet ds = db.DbDataSet(SQL, "ddlData"); db.DbClose(); //add by suo 2010/05/25 if (ds != null && ds.Tables["ddlData"] != null) { DataTable dt = ds.Tables["ddlData"]; dt.Columns[0].ColumnName = "VALUE"; dt.Columns[1].ColumnName = "DISP"; if (blank) { //ブランク行の追加 DataRow _dr = dt.NewRow(); dt.Rows.InsertAt(_dr, 0); } try { if (ddl is System.Web.UI.WebControls.DropDownList) { //コンボボックスにセット ((DropDownList)ddl).DataSource = dt; ((DropDownList)ddl).DataTextField = "DISP"; ((DropDownList)ddl).DataValueField = "VALUE"; ((DropDownList)ddl).DataBind(); } //Add by Ubiq-Zhu 2010/04/20 else if (ddl is System.Web.UI.WebControls.ListBox) { ((ListBox)ddl).DataSource = dt; ((ListBox)ddl).DataTextField = "DISP"; ((ListBox)ddl).DataValueField = "VALUE"; ((ListBox)ddl).DataBind(); } //else if (ddl is AjaxDataControls.GridViewDropDownListColumn) //{ // //datagridviewのコンボにセット // ((GridViewDropDownListColumn)ddl).DisplayMember = "DISP"; // ((GridViewDropDownListColumn)ddl).ValueMember = "VALUE"; // ((GridViewDropDownListColumn)ddl).DataSource = dt; // ((GridViewDropDownListColumn)ddl).DataBind(); //} } catch { //throw new ComException(e.Message, null, null, MethodInfo.GetCurrentMethod().Name); return; } } }
/// <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); }
/// <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); }
/// <summary> /// Calendarの追加&更新 /// 使用画面:MstCalendarMnt /// </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_CALENDAR_ID", _calendar_id, ComConst.DB_IN); db.DbPsetInt("@I_CALENDAR_DATE", _calendar_date, ComConst.DB_IN); //db.DbPsetInt("@I_CALENDAR_CYM", _calendar_cym, ComConst.DB_IN); //db.DbPsetInt("@I_WEEK_NO", _week_no, ComConst.DB_IN); //db.DbPsetInt("@I_DAY_OF_WEEK", _day_of_week, ComConst.DB_IN); db.DbPsetInt("@I_HOLIDAY_FLAG", _holiday_flag, ComConst.DB_IN); db.DbPsetInt("@I_PO_RLS_FLAG", _po_rls_flag, ComConst.DB_IN); //db.DbPsetInt("@I_TTL_WORK_DAYS", _ttl_work_days, ComConst.DB_IN); //db.DbPsetInt("@I_TTL_DAYS", _ttl_days, ComConst.DB_IN); //db.DbPsetInt("@I_TTL_WEEK", _ttl_week, ComConst.DB_IN); db.DbPsetDouble("@I_STD_WORKING_HOUR", _std_working_hour, ComConst.DB_IN); db.DbPsetString("@I_USER_GROUP", _user_group, ComConst.DB_IN); // HTS db.DbPsetString("@I_CHG_PGM", _chg_pgm, ComConst.DB_IN); db.DbPsetString("@I_CHG_USERID", _chg_user_id, ComConst.DB_IN); db.DbPsetInt("@I_LANG", _lang, ComConst.DB_IN); db.DbPsetInt("@I_UPDATE_CNTR", _update_cntr, 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.DbConnection (); db.DbBeginTrans(); rtn = db.DbStored("SP_CALENDAR_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; } db.DbClose(); return(rtn); }
/// <summary> /// 指定ロールを持つユーザーの一覧 /// /// 使用画面:MstRoleMnt /// </summary> public DataSet GetUserListByRole() { ComDB db = new ComDB("", "COM"); StringBuilder strSQL = new StringBuilder(); DataSet ds = new DataSet(); //--- sql strSQL.Append("SELECT U.USER_ID, "); strSQL.Append("U.USER_FAMILY_NAME + ' ' + U.USER_FIRST_NAME AS USER_NAME "); strSQL.Append(" FROM USER_ROLE_MASTER UR, USER_MASTER U"); strSQL.Append(" WHERE UR.ROLE = @ROLE"); strSQL.Append(" AND U.USER_ID = UR.USER_ID"); strSQL.Append(" AND U.LOGICAL_DEL_FLAG = 0 "); strSQL.Append(" ORDER BY U.USER_ID"); db.DbParametersClear(); db.DbPsetString("@ROLE", _role); try { ds = db.DbDataSet(strSQL.ToString(), "user"); 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); } }
public int Insert() { ComDB db = new ComDB(_db_type); int rtn = 0; db.DbParametersClear(); db.DbPsetInt("RET", rtn, ComConst.DB_RTN); db.DbPsetString("@CONTENT_NO", _content_no, ComConst.DB_IN); db.DbPsetString("@PART_NO", _part_no, ComConst.DB_IN); db.DbPsetString("@PART_NAME", _part_name, ComConst.DB_IN); db.DbPsetString("@COLOR", _color, ComConst.DB_IN); db.DbPsetString("@PROC_LOC_FROM", _proc_loc_from, ComConst.DB_IN); db.DbPsetString("@PROC_LOC_TO", _proc_loc_to, ComConst.DB_IN); db.DbPsetString("@INV_LOC_CD", _inv_loc_cd, ComConst.DB_IN); db.DbPsetString("@DOCK_NO", _dock_no, ComConst.DB_IN); db.DbPsetString("@KD_LOT_NO", _kd_lot_no, ComConst.DB_IN); db.DbPsetString("@PC_NO", _pc_no, ComConst.DB_IN); db.DbPsetDate("@DELV_SCDL_TIME", _delv_scdl_time, ComConst.DB_IN); db.DbPsetInt("@DELV_SCDL_QTY", _delv_scdl_qty, ComConst.DB_IN); db.DbPsetString("@INV_CATEGORY", _inv_category, 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_PUR_REC_IMPORT_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; } return(rtn); }
public DataSet GetOrderImportList() { ComDB db = new ComDB(_db_type); StringBuilder strSQL = new StringBuilder(); DataSet ds = new DataSet(); //--- sql strSQL.Append("SELECT "); strSQL.Append("SLIP_NO, DATE, TIME, PROC_LOC_FROM, "); strSQL.Append("MAKER_NAME, SHIP_TO, PART_NO, PART_NAME, "); strSQL.Append("COLOR, RECEIVE_CYCLE, INV_CATEGORY, KD_LOT_FROM, "); strSQL.Append("KD_LOT_TO, PROC_LOC_TO, DELV_ADDR, DELV_SCDLL_QTY, "); strSQL.Append("PART_UNLD_QTY, PROGRESS, INV_LOC_CD, "); strSQL.Append("FLAG "); strSQL.Append(" FROM PUR_ORDER_LOCAL "); //if (_whs_type == 1) // strSQL.Append(" WHERE WHS_TYPE = 1 "); strSQL.Append(" ORDER BY SLIP_NO"); 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); } }
public int DetailInsert() { ComDB db = new ComDB(_db_type); int rtn = 0; db.DbParametersClear(); db.DbPsetInt("RET", rtn, ComConst.DB_RTN); db.DbPsetString("@MC_HUM_NO", _mc_hum_no, ComConst.DB_IN); db.DbPsetInt("@MC_CKD_LINE", _mc_ckd_line, ComConst.DB_IN); db.DbPsetDate("@MC_DEL_N_2", _mc_del_n_2, ComConst.DB_IN); db.DbPsetString("@VENDOR", _vendor, ComConst.DB_IN); db.DbPsetString("@DEST", _dest, 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.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_DEL_MC_DETAIL_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; } return(rtn); }
/// <summary> /// JOCの変更 /// /// 使用画面:MstJOCMnt /// </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_JOC_CD", _joc_cd, ComConst.DB_IN); db.DbPsetInt("@I_BEG_EFF_DATE", _beg_eff_date, ComConst.DB_IN); db.DbPsetInt("@I_END_EFF_DATE", _end_eff_date, ComConst.DB_IN); db.DbPsetInt("@I_JOC_STATUS", _joc_status, ComConst.DB_IN); db.DbPsetInt("@I_JOC_TYPE", _joc_type, ComConst.DB_IN); db.DbPsetString("@I_JOC_DESC", _joc_desc, ComConst.DB_IN); db.DbPsetString("@I_JOC_DESC2", _joc_desc2, ComConst.DB_IN); db.DbPsetString("@I_COST_CENTER", _cost_center, ComConst.DB_IN); db.DbPsetString("@I_WS_CD", _ws_cd, ComConst.DB_IN); db.DbPsetString("@I_PROCESS_CD", _process_cd, ComConst.DB_IN); db.DbPsetString("@I_CHG_PGM", _chg_pgm, ComConst.DB_IN); db.DbPsetString("@I_CHG_USERID", _chg_user_id, ComConst.DB_IN); db.DbPsetInt("@I_LANG", _lang, ComConst.DB_IN); db.DbPsetInt("@I_UPDATE_CNTR", _update_cntr, 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_JOC_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); }
/// <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); }
public int HeadInsert() { ComDB db = new ComDB(_db_type); int rtn = 0; //rtnsp_prod_no = ""; db.DbParametersClear(); db.DbPsetInt("RET", rtn, ComConst.DB_RTN); db.DbPsetString("@SERVICE_PART_NO", _server_part_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.DbPsetInt("@SEMI_FIXED_FIRST", _semi_fixed_first, ComConst.DB_IN); db.DbPsetInt("@SEMI_FIXED_SECOND", _semi_fixed_second, 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", rtnsp_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_SVC_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; } //rtnsp_prod_no = db.DbPgetString("@rtnHEAD_NO"); return(rtn); }
public DataSet GetOrderImportList() { ComDB db = new ComDB(_db_type); StringBuilder strSQL = new StringBuilder(); DataSet ds = new DataSet(); //--- sql strSQL.Append("SELECT "); strSQL.Append("CONTENT_NO, PART_NO, PART_NAME, COLOR, "); strSQL.Append("PROC_LOC_FROM, PROC_LOC_TO, INV_LOC_CD, DOCK_NO, ,"); strSQL.Append("KD_LOT_NO, PC_NO, DELV_SCDL_TIME, DELV_SCDL_QTY, "); strSQL.Append("INV_CATEGORY, FLAG "); strSQL.Append(" FROM PUR_ORDER_IMPORT "); //if (_whs_type == 1) // strSQL.Append(" WHERE WHS_TYPE = 1 "); strSQL.Append(" ORDER BY CONTENT_NO"); 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); } }
/// <summary> /// 資源の変更 /// /// 使用画面:MstResourceMnt /// </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_RESOURCE_CD", _resource_cd, ComConst.DB_IN); db.DbPsetString("@I_RESOURCE_DESC", _resource_desc, ComConst.DB_IN); db.DbPsetString("@I_RESOURCE_DESC2", _resource_desc2, ComConst.DB_IN); db.DbPsetInt("@I_RESOURCE_TYPE", _resource_type, ComConst.DB_IN); db.DbPsetString("@I_RESOURCE_GRP", _resource_grp, ComConst.DB_IN); db.DbPsetString("@I_WS_CD", _ws_cd, ComConst.DB_IN); db.DbPsetString("@I_PROCESS_CD", _process_cd, ComConst.DB_IN); db.DbPsetInt("@I_DISPLAY_SEQ", _display_seq, ComConst.DB_IN); db.DbPsetInt("@I_STD_WORKING_TIME", _std_working_time, ComConst.DB_IN); db.DbPsetString("@I_TIME_DESC", _time_desc, 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(); rtn = db.DbStored("SP_RESOURCE_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); }
/// <summary> /// 棚卸結果登録Calendar詳細の取得 /// /// 使用画面:InvStockTakingAct /// </summary> public DataSet GetCalendarYearMonth() { ComDB db = new ComDB(_db_type); StringBuilder strSQL = new StringBuilder(); DataSet ds = new DataSet(); //--- sql strSQL.Append(" SELECT "); strSQL.Append(" DISTINCT(SUBSTRING(CONVERT(VARCHAR(6),CALENDAR_CYM),1,4) ) AS CALENDAR_CYM "); if (_db_type == "ORACLE") { strSQL.Append(" FROM CALENDAR_MASTER "); strSQL.Append(" WHERE CALENDAR_ID = :00 "); strSQL.Append(" ORDER BY CALENDAR_CYM "); } else { strSQL.Append(" FROM CALENDAR_MASTER "); strSQL.Append(" WHERE CALENDAR_ID ='00' "); strSQL.Append(" ORDER BY CALENDAR_CYM "); } try { ds = db.DbDataSet(strSQL.ToString(), "Cal"); 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); } }
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); }