//-->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); } }
/// <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> /// 指定画面の画面ラベル一覧 /// </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); } }
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); } }
/// <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 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> /// 棚卸結果登録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); } }
/// <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); }
/// <summary> /// 工程NG理由の取得 /// /// 使用画面:MstProcessNGReasonMnt /// </summary> public DataSet GetList() { ComDB db = new ComDB(_db_type); StringBuilder strSQL = new StringBuilder(); DataSet ds = new DataSet(); strSQL.Append("SELECT "); strSQL.Append("D.WS_CD, R.WS_DESC, D.PROCESS_CD, P.PROCESS_DESC, D.NG_REASON_CD, "); strSQL.Append("D.NG_REASON_DESC "); strSQL.Append(" FROM PROCESS_NG_REASON_MASTER D "); strSQL.Append(" LEFT JOIN WORKSHOP_MASTER R ON D.WS_CD = R.WS_CD "); strSQL.Append(" LEFT JOIN PROCESS_MASTER P ON D.WS_CD = P.WS_CD AND D.PROCESS_CD = P.PROCESS_CD "); strSQL.Append(" WHERE D.WS_CD = @WS_CD "); strSQL.Append(" AND D.PROCESS_CD = @PROCESS_CD "); strSQL.Append(" ORDER BY D.NG_REASON_CD "); db.DbParametersClear(); db.DbPsetString("@WS_CD", _ws_cd); db.DbPsetString("@PROCESS_CD", _process_cd); try { ds = db.DbDataSet(strSQL.ToString(), "TABLE"); if (ds == null) { _dbmsg = db.expmsg; _strErr = db.strErr; } if (db.State() == ConnectionState.Open) { db.DbClose(); } return(ds); } catch { _dbmsg = db.expmsg; _strErr = db.strErr; if (db.State() == ConnectionState.Open) { db.DbClose(); } return(null); } }
/// <summary> /// ロケーション一覧の取得 /// /// 使用画面:MstLocationMnt /// </summary> public DataSet GetLocationList() { ComDB db = new ComDB(_db_type); StringBuilder strSQL = new StringBuilder(); DataSet ds = new DataSet(); //--- sql //strSQL.Append("SELECT "); //strSQL.Append("LOCATION, LOCATION_DESC "); //strSQL.Append(" FROM LOCATION_MASTER "); //strSQL.Append(" WHERE WHS_CD = @WHS_CD "); //strSQL.Append(" ORDER BY LOCATION"); strSQL.Append("SELECT "); strSQL.Append("LOCATION_NO, LOCATION_NAME, LOCATION_DESCRIPTION, DEPT_NO, "); strSQL.Append("ENTRY_DATE, UPDATE_DATE, USER_CREATE, USER_UPDATE "); strSQL.Append(" FROM LOCATION_MASTER "); //db.DbParametersClear(); //db.DbPsetString("@WHS_CD", _whs_cd); try { ds = db.DbDataSet(strSQL.ToString(), "TABLE"); if (ds == null) { _dbmsg = db.expmsg; _strErr = db.strErr; } if (db.State() == ConnectionState.Open) { db.DbClose(); } return(ds); } catch { _dbmsg = db.expmsg; _strErr = db.strErr; if (db.State() == ConnectionState.Open) { db.DbClose(); } return(null); } }
/// <summary> /// 部門詳細の取得 /// /// 使用画面:MstMgmtLevelMnt /// </summary> public DataSet GetMGMTList() { ComDB db = new ComDB(_db_type); StringBuilder strSQL = new StringBuilder(); DataSet ds = new DataSet(); strSQL.Append(" SELECT "); strSQL.Append(" MANAGEMENT_LEVEL, MANAGEMENT_DESCRIPTION, "); strSQL.Append(" ENTRY_DATE, UPDATE_DATE, USER_CREATE, USER_UPDATE "); strSQL.Append(" FROM MANAGEMENT_MASTER "); db.DbParametersClear(); if (_mgmt_cd != "") { strSQL.Append(" WHERE MANAGEMENT_LEVEL = @MGMT_CD "); db.DbPsetString("@MGMT_CD", _mgmt_cd); } try { ds = db.DbDataSet(strSQL.ToString(), "TABLE"); if (ds == null) { _dbmsg = db.expmsg; _strErr = db.strErr; } if (db.State() == ConnectionState.Open) { db.DbClose(); } return(ds); } catch { _dbmsg = db.expmsg; _strErr = db.strErr; if (db.State() == ConnectionState.Open) { db.DbClose(); } return(null); } }
/// <summary> /// 資源ダウン理由の取得 /// /// 使用画面:MstDownReasonMnt /// </summary> public DataSet GetResourceList() { ComDB db = new ComDB(_db_type); StringBuilder strSQL = new StringBuilder(); DataSet ds = new DataSet(); strSQL.Append("SELECT "); strSQL.Append("D.RESOURCE_CD, R.RESOURCE_DESC, D.DOWN_REASON_CD, "); strSQL.Append("D.DOWN_REASON_DESC "); strSQL.Append(" FROM DOWN_REASON_MASTER D "); strSQL.Append(" LEFT JOIN RESOURCE_MASTER R ON D.RESOURCE_CD = R.RESOURCE_CD "); strSQL.Append(" WHERE D.RESOURCE_CD = @RESOURCE_CD "); strSQL.Append(" ORDER BY D.DOWN_REASON_CD "); db.DbParametersClear(); db.DbPsetString("@RESOURCE_CD", _resource_cd); try { ds = db.DbDataSet(strSQL.ToString(), "TABLE"); if (ds == null) { _dbmsg = db.expmsg; _strErr = db.strErr; } if (db.State() == ConnectionState.Open) { db.DbClose(); } return(ds); } catch { _dbmsg = db.expmsg; _strErr = db.strErr; if (db.State() == ConnectionState.Open) { db.DbClose(); } return(null); } }
//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> /// 画面ラベル詳細の取得 /// </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); }
/// <summary> /// 資源詳細の取得 /// /// 使用画面:SrchResource /// </summary> public DataSet GetResourceList() { ComDB db = new ComDB(_db_type); StringBuilder strSQL = new StringBuilder(); DataSet ds = new DataSet(); strSQL.Append("SELECT "); strSQL.Append("R.RESOURCE_CD, R.RESOURCE_DESC, R.RESOURCE_DESC2, "); strSQL.Append("R.RESOURCE_TYPE, R.RESOURCE_GRP, R.WS_CD, "); strSQL.Append("R.PROCESS_CD, R.DISPLAY_SEQ, R.STD_WORKING_TIME, "); strSQL.Append("R.TIME_DESC "); strSQL.Append(" FROM RESOURCE_MASTER R "); strSQL.Append(" ORDER BY RESOURCE_CD "); try { ds = db.DbDataSet(strSQL.ToString(), "TABLE"); if (ds == null) { _dbmsg = db.expmsg; _strErr = db.strErr; } if (db.State() == ConnectionState.Open) { db.DbClose(); } return(ds); } catch { _dbmsg = db.expmsg; _strErr = db.strErr; if (db.State() == ConnectionState.Open) { db.DbClose(); } return(null); } }
public DataSet GetPickingList() { ComDB db = new ComDB(_db_type); StringBuilder strSQL = new StringBuilder(); DataSet ds = new DataSet(); //--- sql strSQL.Append(" SELECT DELH.MC_HUM_NO AS MC_HUM_NO, DELH.CREATE_DATE AS CREATE_DATE, DELH.CREATE_BY AS CREATE_BY, "); strSQL.Append(" DELD.VENDOR AS VENDOR, DELD.DEST AS DEST, DELD.MODEL AS MODEL, DELD.MC_DEL_N_2 AS MC_DEL_N_2, "); strSQL.Append(" DELD.PC_NO AS PC_NO, DELD.BLOCK_QTY AS BLOCK_QTY, DELD.HEAD_QTY AS HEAD_QTY "); strSQL.Append(" FROM [dbo].[PLAN_DEL_MC_HEADER] AS DELH LEFT JOIN [dbo].[PLAN_DEL_MC_DETAIL] AS DELD "); strSQL.Append(" ON DELH.MC_HUM_NO = DELD.MC_HUM_NO "); //strSQL.Append(" ORDER BY HEAD_NO "); 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); } }
/// <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> /// メッセージ一覧の取得 /// </summary> public DataSet GetMessageList() { ComDB db = new ComDB(_db_type); StringBuilder strSQL = new StringBuilder(); DataSet ds = new DataSet(); //--- sql strSQL.Append("SELECT MSG_CD, LANG, MSG_DESC, RANK, "); strSQL.Append(" ENTRY_DATE, CHG_DATE, CHG_USER_ID,"); strSQL.Append(" UPDATE_CNTR"); strSQL.Append(" FROM MESSAGE_MASTER "); strSQL.Append(" ORDER BY MSG_CD"); try { ds = db.DbDataSet(strSQL.ToString(), "msg"); 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 DataSet GetOrder(int syear, int smonth) { ComDB db = new ComDB(_db_type); StringBuilder strSQL = new StringBuilder(); DataSet ds = new DataSet(); //--- sql strSQL.Append(" SELECT "); strSQL.Append(" MC_PROD_NO AS HEAD_NO "); strSQL.Append(" FROM PLAN_PROD_MC_HEADER "); strSQL.Append(" WHERE [YEAR] = " + syear + " AND [MONTH] = " + smonth); strSQL.Append(" ORDER BY HEAD_NO "); 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); } }
/// <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 DataSet GetPickingOrder() { ComDB db = new ComDB(_db_type); StringBuilder strSQL = new StringBuilder(); DataSet ds = new DataSet(); //--- sql strSQL.Append(" SELECT "); strSQL.Append(" DISTINCT(MC_HUM_NO) AS HEAD_NO "); strSQL.Append(" FROM PLAN_DEL_MC_HEADER "); strSQL.Append(" ORDER BY HEAD_NO "); 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); } }
/// <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); }
/// <summary> /// 指定ユーザーに指定ロールの権限の有無 /// /// 使用画面@ MstRoleMnt, AppUserMenu /// </summary> public bool HasAuthority() { ComDB db = new ComDB("", "COM"); StringBuilder strSQL = new StringBuilder(); int rtn = 0; //--- sql strSQL.Append("SELECT ROLE"); strSQL.Append(" 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); rtn = db.DbExecuteReader(strSQL.ToString()); if (rtn == ComConst.FAILED) { if (db.State() == ConnectionState.Open) { db.DbClose(); } return(false); } else { if (db.State() == ConnectionState.Open) { db.DbClose(); } return(true); } }
/// <summary> /// 営業倉庫一覧の取得 /// <para>使用画面:[SrchSDMWhs]</para> /// </summary> public DataSet GetSDMWarehosueList() { ComDB db = new ComDB(_db_type); StringBuilder strSQL = new StringBuilder(); DataSet ds = new DataSet(); //--- sql strSQL.Append(" SELECT * "); strSQL.Append(" FROM WHS_MST "); strSQL.Append(" ORDER BY WHS_CD "); try { ds = db.DbDataSet(strSQL.ToString(), "WHS_CD"); 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> /// メッセージの取得 /// </summary> public string GetMessage(string msgcd) { ComDB db = new ComDB(_db_type); StringBuilder strSQL = new StringBuilder(); int rtn = 0; //--- sql strSQL.Append("SELECT MSG_DESC, RANK "); strSQL.Append(" FROM MESSAGE_MASTER "); if (_db_type == "ORACLE") { strSQL.Append(" WHERE MSG_CD = :MSG_CD"); strSQL.Append(" AND LANG = :LANG"); db.DbParametersClear(); db.DbPsetString("MSG_CD", msgcd); db.DbPsetInt("LANG", _lang); } else { strSQL.Append(" WHERE MSG_CD = @MSG_CD"); strSQL.Append(" AND LANG = @LANG"); db.DbParametersClear(); db.DbPsetString("@MSG_CD", msgcd); db.DbPsetInt("@LANG", _lang); } rtn = db.DbExecuteReader(strSQL.ToString()); if (rtn == ComConst.FAILED) { _dbmsg = db.expmsg; _strErr = db.strErr; _msg_desc = "No Corresponding Message."; } else { _msg_desc = db.Row("MSG_DESC"); _rank = db.Row("RANK"); } if (db.State() == ConnectionState.Open) { db.DbClose(); } return(_msg_desc); }
/// <summary> /// 営業倉庫詳細の取得 /// <para>使用画面:[SrchSDMWhs]</para> /// </summary> public int GetSDMWarehouseDetail() { ComDB db = new ComDB(_db_type); StringBuilder strSQL = new StringBuilder(); int rtn = 0; //--- sql strSQL.Append(" SELECT * "); strSQL.Append(" FROM WHS_MST W "); if (_db_type == "ORACLE") { strSQL.Append(" WHERE W.WHS_CD = :WHS_CD "); db.DbParametersClear(); db.DbPsetString("WHS_CD", _whs_cd); } else { strSQL.Append(" WHERE W.WHS_CD = @WHS_CD "); db.DbParametersClear(); db.DbPsetString("@WHS_CD", _whs_cd); } rtn = db.DbExecuteReader(strSQL.ToString()); if (rtn == ComConst.FAILED) { _dbmsg = db.expmsg; _strErr = db.strErr; } else { _whs_cd = db.Row("WHS_CD"); _whs_desc = db.Row("WHS_NAME"); _recv_loc = db.Row("RECV_LOC"); _whs_type = int.Parse(db.Row("WHS_TYPE")); _whs_item_type = int.Parse(db.Row("WHS_ITEM_TYPE")); } if (db.State() == ConnectionState.Open) { db.DbClose(); } return(rtn); }
/// <summary> /// ロケーション詳細の取得 /// /// 使用画面:InvStockInq /// </summary> public int GetLocationDetail() { ComDB db = new ComDB(_db_type); StringBuilder strSQL = new StringBuilder(); int rtn = 0; //--- sql //strSQL.Append(" SELECT "); //strSQL.Append(" L.WHS_CD, L.LOCATION, L.LOCATION_DESC "); //strSQL.Append(" FROM LOCATION_MASTER L "); //strSQL.Append(" WHERE L.WHS_CD = @WHS_CD "); //strSQL.Append(" AND L.LOCATION = @LOCATION "); strSQL.Append("SELECT "); strSQL.Append("LOCATION_NO, LOCATION_NAME, LOCATION_DESCRIPTION, DEPT_NO, "); strSQL.Append("ENTRY_DATE, UPDATE_DATE, USER_CREATE, USER_UPDATE "); strSQL.Append(" FROM LOCATION_MASTER L "); strSQL.Append(" WHERE L.LOCATION_NO = @LOCATION "); db.DbParametersClear(); //db.DbPsetString("@WHS_CD", _whs_cd); db.DbPsetString("@LOCATION", _location); rtn = db.DbExecuteReader(strSQL.ToString()); if (rtn == ComConst.FAILED) { _dbmsg = db.expmsg; _strErr = db.strErr; } else { //_whs_cd = db.Row("WHS_CD"); //_location = db.Row("LOCATION"); //_location_desc = db.Row("LOCATION_DESC"); _location = db.Row("LOCATION_NO"); _location_desc = db.Row("LOCATION_NAME"); _location_desc2 = db.Row("LOCATION_DESCRIPTION"); _dept_no = db.Row("DEPT_NO"); } if (db.State() == ConnectionState.Open) { db.DbClose(); } return(rtn); }
/// <summary> /// 工程NG理由明細の取得 /// /// 使用画面: /// </summary> public int GetDetail() { ComDB db = new ComDB(_db_type); StringBuilder strSQL = new StringBuilder(); int rtn = 0; //--- sql strSQL.Append("SELECT "); strSQL.Append("D.WS_CD, R.WS_DESC, D.PROCESS_CD, P.PROCESS_DESC, D.NG_REASON_CD, "); strSQL.Append("D.NG_REASON_DESC "); strSQL.Append(" FROM PROCESS_NG_REASON_MASTER D "); strSQL.Append(" LEFT JOIN WORKSHOP_MASTER R ON D.WS_CD = R.WS_CD "); strSQL.Append(" LEFT JOIN PROCESS_MASTER P ON D.WS_CD = P.WS_CD AND D.PROCESS_CD = P.PROCESS_CD "); strSQL.Append(" WHERE D.WS_CD = @WS_CD "); strSQL.Append(" AND D.PROCESS_CD = @PROCESS_CD "); strSQL.Append(" AND D.NG_REASON_CD = @NG_REASON_CD "); db.DbParametersClear(); db.DbPsetString("@WS_CD", _ws_cd); db.DbPsetString("@PROCESS_CD", _process_cd); db.DbPsetString("@NG_REASON_CD", _ng_reason_cd); rtn = db.DbExecuteReader(strSQL.ToString()); if (rtn == ComConst.FAILED) { _dbmsg = db.expmsg; _strErr = db.strErr; } else { _ws_cd = db.Row("WS_CD"); _ws_desc = db.Row("WS_DESC"); _process_cd = db.Row("PROCESS_CD"); _process_desc = db.Row("PROCESS_DESC"); _ng_reason_cd = db.Row("NG_REASON_CD"); _ng_reason_desc = db.Row("NG_REASON_DESC"); } if (db.State() == ConnectionState.Open) { db.DbClose(); } return(rtn); }