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> /// 製造資源の変更 /// /// 使用画面: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); }
public int DetailInsert() { 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_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> /// 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); }
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); }
/// <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); }
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); }
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); }
/// <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); }
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); }
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); }
public int DetailUpdate() { ComDB db = new ComDB(_db_type); int rtn = 0; db.DbParametersClear(); db.DbPsetInt("RET", rtn, ComConst.DB_RTN); db.DbPsetString("@KD_SPECIAL_NO", _kd_special_no, ComConst.DB_IN); db.DbPsetInt("@KD_LINE_NO", _kd_line_no, ComConst.DB_IN); db.DbPsetString("@PART_NO", _part_no, ComConst.DB_IN); db.DbPsetString("@COLOR", _color, ComConst.DB_IN); db.DbPsetInt("@FG_QTY", _fg_qty, ComConst.DB_IN); db.DbPsetString("@DEL_FROM", _del_from, ComConst.DB_IN); db.DbPsetString("@DEL_TO", _del_to, ComConst.DB_IN); db.DbPsetString("@PLAN_CODE", _plan_code, ComConst.DB_IN); db.DbPsetInt("@REQ_NO", _req_no, 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_KD_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> /// 部門の変更 /// /// 使用画面:MstDeptMnt /// </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_DEPT_CD", _dept_cd, ComConst.DB_IN); db.DbPsetString("@I_DEPT_DESC1", _dept_desc1, ComConst.DB_IN); db.DbPsetString("@I_DEPT_DESC2", _dept_desc2, ComConst.DB_IN); db.DbPsetString("@I_DEPT_DESC3", _dept_desc3, ComConst.DB_IN); db.DbPsetString("@I_DEPT_DESC4", _dept_desc4, ComConst.DB_IN); db.DbPsetInt("@I_DEPT_TYPE", _dept_type, ComConst.DB_IN); db.DbPsetDouble("@I_NUMBER_DEPT", _number_dept, ComConst.DB_IN); db.DbPsetDouble("@I_AREA_DEPT", _area_dept, ComConst.DB_IN); //db.DbPsetDate("@I_ENTRY_DATE", DateTime.Now.ToLongDateString(), 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("@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_DEPT_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> /// 製造資源の削除 /// /// 使用画面:MstRoutineResourceMnt /// </summary> public int Delete() { 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.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_DELETE"); 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> /// 在庫引当、引当解除処理 /// /// 使用画面: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); }
public int DetailInsert() { 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_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> /// <para>自動採番の取得 /// </para> /// 使用画面:OrdSOEntry /// </summary> public int GET_AUTO_NUM() { ComDB db = new ComDB(_db_type); int rtn = 0; db.DbParametersClear(); db.DbPsetInt("RET", rtn, ComConst.DB_RTN); db.DbPsetString("@I_CTR_CD", _ctr_cd, ComConst.DB_IN); db.DbPsetString("@I_CTR_SUB_CD", _ctr_sub_cd, ComConst.DB_IN); db.DbPsetString("@I_CTR_PREFIX", _ctr_prefix, ComConst.DB_IN); db.DbPsetInt("@I_CTR_DIGIT", _ctr_digit, 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.DbPsetString("@O_NUMBER", _out_num, 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_NUMBERING"); rtn = db.DbPgetInt("RET"); if (rtn == ComConst.SUCCEED) { _out_num = db.DbPgetString("@O_NUMBER"); 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> /// 購入単価の削除 /// /// 使用画面:MstPurPriceMnt /// </summary> public int Delete() { 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.DbPsetString("@I_PROCESS_CD", _process_cd, ComConst.DB_IN); db.DbPsetString("@I_VENDOR_CD", _vendor_cd, ComConst.DB_IN); db.DbPsetInt("@I_BEG_EFF_DATE", _beg_eff_date, 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_PURCHASE_PRICE_DELETE"); 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> /// ロケーションの追加 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); }
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); }
public int DetailInsert() { 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_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> /// 工程NG理由の追加 /// /// 使用画面:MstProcessNGReasonMnt /// </summary> public int Insert() { ComDB db = new ComDB(_db_type); int rtn = 0; db.DbParametersClear(); db.DbPsetInt("RET", rtn, ComConst.DB_RTN); db.DbPsetString("@I_WS_CD", _ws_cd, ComConst.DB_IN); db.DbPsetString("@I_PROCESS_CD", _process_cd, ComConst.DB_IN); db.DbPsetString("@I_NG_REASON_CD", _ng_reason_cd, ComConst.DB_IN); db.DbPsetString("@I_NG_REASON_DESC", _ng_reason_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_PROCESS_NG_REASON_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> /// 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> /// 仕入先の削除 /// /// 使用画面:MstWhsMnt /// </summary> public int Delete() { ComDB db = new ComDB(_db_type); int rtn = 0; db.DbParametersClear(); db.DbPsetInt("RET", rtn, ComConst.DB_RTN); db.DbPsetString("@I_CUST_CD", _cust_cd, ComConst.DB_IN); db.DbPsetString("@I_CUST_SUB_CD", _cust_sub_cd, ComConst.DB_IN); db.DbPsetString("@I_CHG_PGM", _chg_pgm, ComConst.DB_IN); db.DbPsetString("@I_CHG_USERID", _chg_userid, 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_CUSTOMER_DELETE"); 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> /// 仕様別段取条件マスタ更新 /// /// 使用画面:MstSpecSetupMnt /// </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_SPEC_CD", _spec_no, ComConst.DB_IN); db.DbPsetString("@I_PREV_SPEC_CD", _prev_spec_no, ComConst.DB_IN); db.DbPsetDouble("@I_SETUP_TIME", _setup_time, 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_SPEC_SETUP_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の通算稼働日更新 /// 使用画面:MstCalendarMnt /// </summary> public int Work_Days_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.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_TTL_WORK_DAYS_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); }
public int Disb_UnAlloc() { ComDB db = new ComDB(_db_type); int rtn = 0; db.DbParametersClear(); db.DbPsetInt("RET", rtn, ComConst.DB_RTN); db.DbPsetString("@I_ORDER_NO", _order_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(); rtn = db.DbStored("SP_DISB_UNALLOC"); 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> /// 作業区の変更 /// /// 使用画面:MstWsMnt /// </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_WS_CD", _ws_cd, ComConst.DB_IN); db.DbPsetString("@I_WS_DESC", _ws_desc, ComConst.DB_IN); db.DbPsetString("@I_WS_DESC2", _ws_desc2, ComConst.DB_IN); db.DbPsetString("@I_REP_WS_CD", _rep_ws_cd, ComConst.DB_IN); db.DbPsetString("@I_COST_CENTER", _cost_center, ComConst.DB_IN); db.DbPsetInt("@I_SC_FLAG", _sc_flag, ComConst.DB_IN); db.DbPsetString("@I_VENDOR_CD", _vendor_cd, ComConst.DB_IN); db.DbPsetInt("@I_INPUT_FLAG", _input_flag, ComConst.DB_IN); db.DbPsetInt("@I_LOT_CTRL_FLAG", _lot_ctrl_flag, ComConst.DB_IN); db.DbPsetInt("@I_NEG_BAL_FLAG", _neg_bal_flag, ComConst.DB_IN); db.DbPsetInt("@I_FRONT_END_FLAG", _front_end_flag, ComConst.DB_IN); db.DbPsetInt("@I_COMPL_FLAG", _compl_flag, ComConst.DB_IN); db.DbPsetInt("@I_AUTO_DISB_FLAG", _auto_disb_flag, ComConst.DB_IN); db.DbPsetDouble("@I_WS_PRC", _ws_prc, ComConst.DB_IN); db.DbPsetString("@I_WORK_INST_TYPE", _work_inst_type, ComConst.DB_IN); db.DbPsetString("@I_COMPL_SLIP_PATTERN", _compl_slip_pattern, ComConst.DB_IN); db.DbPsetString("@I_REJ_WHS", _rej_whs, ComConst.DB_IN); //ADD BY UBIQ-LIU 2010/11/24 db.DbPsetString("@I_DATA_CHAR1", _data_char1, ComConst.DB_IN); db.DbPsetString("@I_DATA_CHAR2", _data_char2, ComConst.DB_IN); db.DbPsetString("@I_DATA_CHAR3", _data_char3, ComConst.DB_IN); db.DbPsetString("@I_DATA_CHAR4", _data_char4, ComConst.DB_IN); db.DbPsetString("@I_DATA_CHAR5", _data_char5, ComConst.DB_IN); db.DbPsetString("@I_DATA_CHAR6", _data_char6, ComConst.DB_IN); db.DbPsetString("@I_DATA_CHAR7", _data_char7, ComConst.DB_IN); db.DbPsetString("@I_DATA_CHAR8", _data_char8, ComConst.DB_IN); db.DbPsetString("@I_DATA_CHAR9", _data_char9, ComConst.DB_IN); db.DbPsetString("@I_DATA_CHAR10", _data_char10, ComConst.DB_IN); db.DbPsetDouble("@I_DATA_NUM1", _data_num1, ComConst.DB_IN); db.DbPsetDouble("@I_DATA_NUM2", _data_num2, ComConst.DB_IN); db.DbPsetDouble("@I_DATA_NUM3", _data_num3, ComConst.DB_IN); db.DbPsetDouble("@I_DATA_NUM4", _data_num4, ComConst.DB_IN); db.DbPsetDouble("@I_DATA_NUM5", _data_num5, ComConst.DB_IN); db.DbPsetDouble("@I_DATA_NUM6", _data_num6, ComConst.DB_IN); db.DbPsetDouble("@I_DATA_NUM7", _data_num7, ComConst.DB_IN); db.DbPsetDouble("@I_DATA_NUM8", _data_num8, ComConst.DB_IN); db.DbPsetDouble("@I_DATA_NUM9", _data_num9, ComConst.DB_IN); db.DbPsetDouble("@I_DATA_NUM10", _data_num10, ComConst.DB_IN); db.DbPsetInt("@I_DATA_FLAG1", _data_flag1, ComConst.DB_IN); db.DbPsetInt("@I_DATA_FLAG2", _data_flag2, ComConst.DB_IN); db.DbPsetInt("@I_DATA_FLAG3", _data_flag3, ComConst.DB_IN); db.DbPsetInt("@I_DATA_FLAG4", _data_flag4, ComConst.DB_IN); db.DbPsetInt("@I_DATA_FLAG5", _data_flag5, ComConst.DB_IN); db.DbPsetInt("@I_DATA_FLAG6", _data_flag6, ComConst.DB_IN); db.DbPsetInt("@I_DATA_FLAG7", _data_flag7, ComConst.DB_IN); db.DbPsetInt("@I_DATA_FLAG8", _data_flag8, ComConst.DB_IN); db.DbPsetInt("@I_DATA_FLAG9", _data_flag9, ComConst.DB_IN); db.DbPsetInt("@I_DATA_FLAG10", _data_flag10, 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_WORKSHOP_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> /// 指定目录下所有[CSV]类型文件导入DataTable /// XML方式一次性导入 /// </summary> /// <returns></returns> public int ImpFilesToDataTableBulk() { int rtn = 0; ComLibrary com = new ComLibrary(); try { string strFileNm = ""; string[] strWk = _file_path.Split('\\'); strFileNm = strWk[strWk.Length - 1]; string strFileNmA = ""; string[] strWkA = strFileNm.Split('.'); strFileNmA = strWkA[0]; bool isEmpty = true; int LineCnt = 0; string IfType = _if_type;//連携データ区分 StringBuilder strXML = new StringBuilder(); strXML.Append("<IFRows>"); Boolean err_flag = false; //if (_save_path != "") //{ // if (_save_path.EndsWith("\\")) // _save_file = _save_path + DateTime.Now.ToString("yyyyMMdd_HHmmss") + "_" + strFileNm; // else // _save_file = _save_path + "\\" + DateTime.Now.ToString("yyyyMMdd_HHmmss") + "_" + strFileNm; //} // LOG FILE 名 2014.09.22 //if (_log_path != "") //{ // if (_log_path.EndsWith("\\")) // _log_file = _log_path + DateTime.Now.ToString("yyyyMMdd_HHmmss") + "_" + strFileNm; // else // _log_file = _log_path + "\\" + DateTime.Now.ToString("yyyyMMdd_HHmmss") + "_" + strFileNm; //} // FILE COPY 2014.09.22 //if (_save_path != "") //{ // File.Copy(_file_path, _save_file, true); //} Encoding FileEncoding = GetFileEncoding(_file_path); // 最初にメモリに読むこむ int wLineCnt = 0; StreamReader sr = new StreamReader(_file_path, FileEncoding); while (sr.Peek() >= 0) { wLineCnt++; string strRecord = sr.ReadLine(); FileInfoClass fi = new FileInfoClass(); fi.LineCnt = wLineCnt; fi.Data = strRecord; lstFileInfo.Add(fi); } sr.Dispose(); sr.Close(); TextFieldParser parser = new TextFieldParser(_file_path, FileEncoding); using (parser) { parser.TextFieldType = FieldType.Delimited; parser.SetDelimiters(","); // 区切り文字はコンマ while (!parser.EndOfData) { err_flag = false; LineCnt++; isEmpty = false; string[] strRecord = parser.ReadFields(); // 1行読み込み 2014.09.22 string aRecord = ""; for (int p = 0; p < strRecord.Length; p++) { if (p > 0) { aRecord += "|"; } aRecord += strRecord[p]; } if (LineCnt <= lstFileInfo.Count) { ((FileInfoClass)lstFileInfo[LineCnt - 1]).CnvData = aRecord; } //各項目属性チェック //年月, 数量 //if (!com.IsNumeric(strRecord[2].Replace("/", "")) || !com.IsNumeric(strRecord[3])) //{ // err_flag = true; // // 2014.10.10 // if (LineCnt <= lstFileInfo.Count) // { // ((FileInfoClass)lstFileInfo[LineCnt - 1]).ErrFlag = 1; // ((FileInfoClass)lstFileInfo[LineCnt - 1]).ErrMsg = "数値エラー。"; // } //} //数据各项值取得 IF_PROD_PLAN ifpl = SetRecordValues(IfType, LineCnt, strRecord, FileEncoding); //if (ifpl.ITEM_NO.ToString().Length > 30 //|| ifpl.ITEM_DESC.ToString().Length > 50 //|| ifpl.PLAN_YM.ToString().Length > 6 //|| com.StringToDouble(ifpl.ORDER_QTY.ToString()) > 1000000000) //{ // err_flag = true; // if (LineCnt <= lstFileInfo.Count) // { // ((FileInfoClass)lstFileInfo[LineCnt - 1]).ErrFlag = 1; // ((FileInfoClass)lstFileInfo[LineCnt - 1]).ErrMsg += "桁数エラー。"; // } //} if (err_flag) // 2014.10.10 { //_len_err_cnt++; ////IF 取込データログに登録 //Poif poif = new Poif(_chg_user_id, _lang); //Message msg = new Message(_chg_user_id, _lang); //poif.if_date = ifpl.IF_DATE; //poif.if_hms = ifpl.IF_HMS; //poif.if_type = ifpl.IF_TYPE; //poif.if_type_name = _if_type_name; //poif.if_data_seq = ifpl.IF_DATA_SEQ; //poif.if_data = aRecord; //poif.if_data_err = msg.GetMessage("COLUMN_LENGTH_FORMAT_ERR"); //poif.if_data_flag = 2; //poif.chg_pgm = _chg_pgm; //poif.chg_user_id = _chg_user_id; //poif.lang = _lang; //poif.errcode = _errcode; //poif.errmsg = _errmsg; //poif.sqlcode = _sqlcode; //poif.dbmsg = _dbmsg; //rtn = poif.Ins_IF_IN_LOG(); //if (rtn == ComConst.FAILED) //{ // goto RESULT; //} } if (!err_flag) // 2014.09.22 { //XML格式作成 strXML.Append("<IFRow "); //strXML.Append(" IF_DATE=\"" + ifpl.IF_DATE.ToString() + "\""); //strXML.Append(" IF_HMS=\"" + ifpl.IF_HMS.ToString() + "\""); strXML.Append(" IF_TYPE=\"" + ifpl.IF_TYPE + "\""); strXML.Append(" IF_DATA_SEQ=\"" + ifpl.IF_DATA_SEQ.ToString() + "\""); strXML.Append(" IF_PLAN_NO=\"" + ifpl.IF_PLAN_NO + "\""); strXML.Append(" ITEM_NO=\"" + ifpl.ITEM_NO + "\""); //strXML.Append(" ITEM_DESC=\"" + com.XMLString(ifpl.ITEM_DESC) + "\""); //strXML.Append(" WS_CD=\"" + ifpl.WS_CD + "\""); //strXML.Append(" PLAN_YM=\"" + ifpl.PLAN_YM.ToString() + "\""); //strXML.Append(" ORDER_QTY=\"" + ifpl.ORDER_QTY.ToString() + "\""); //strXML.Append(" IF_DATA_FLAG=\"" + ifpl.IF_DATA_FLAG.ToString() + "\""); //strXML.Append(" CHG_PGM=\"" + _chg_pgm + "\""); strXML.Append(" CHG_USER_ID=\"" + _chg_user_id + "\""); strXML.Append(" />"); } } } strXML.Append("</IFRows>"); //_file_line_cnt = LineCnt; if (isEmpty) { Message msg = new Message(_chg_user_id, _lang); _strErr = msg.GetMessage("FILE_NOT_EXIST_ERR"); rtn = ComConst.CHECK_ERROR; goto RESULT; } else { // [IF初期取込生産計画]の一括登録 #region : [IF初期取込生産計画]の一括登録 ComDB db = new ComDB(_db_type); db.DbParametersClear(); db.DbPsetInt("rtn", rtn, ComConst.DB_RTN); db.DbPsetXml("@I_XML", strXML.ToString(), strXML.ToString().Length, 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_IF_PROD_PLAN_BULK_IMP");//一括登録 if (rtn == ComConst.SUCCEED) { db.DbCommit(); } else { db.DbRollback(); rtn = db.DbPgetInt("rtn"); if (rtn > 0) { _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 + ")]"; } else { _strErr = db.strErr; } rtn = ComConst.FAILED; } #endregion } //File.Delete(_file_path); } catch (Exception ex) { _strErr = ex.ToString(); rtn = ComConst.FAILED; } RESULT: return(rtn); }