public List <C_SAP_STATION_MAP> GetSAPStationMapBySkuOrderBySAPCodeASC(string SkuNo, OleExec DB) { List <C_SAP_STATION_MAP> mapList = new List <C_SAP_STATION_MAP>(); string sql = string.Empty; DataTable dt = new DataTable(); Row_C_SAP_STATION_MAP row = null; C_SAP_STATION_MAP map = null; if (DBType.Equals(DB_TYPE_ENUM.Oracle)) { sql = $@"SELECT * FROM C_SAP_STATION_MAP WHERE SKUNO='{SkuNo}' ORDER BY SAP_STATION_CODE ASC"; dt = DB.ExecSelect(sql).Tables[0]; foreach (DataRow dr in dt.Rows) { row = (Row_C_SAP_STATION_MAP)NewRow(); row.loadData(dr); map = row.GetDataObject(); mapList.Add(map); } } else { string errMsg = MESReturnMessage.GetMESReturnMessage("MES00000019", new string[] { DBType.ToString() }); throw new MESReturnMessage(errMsg); } return(mapList); }
public string DeleteSAPStationMap(string ID, OleExec sfcdb) { string result = string.Empty; string DeleteString = string.Empty; Row_C_SAP_STATION_MAP row = (Row_C_SAP_STATION_MAP)NewRow(); string sql = string.Empty; DataTable dt = new DataTable(); if (DBType.Equals(DB_TYPE_ENUM.Oracle)) { sql = $@"SELECT * FROM C_SAP_STATION_MAP WHERE ID='{ID}'"; dt = sfcdb.ExecSelect(sql).Tables[0]; if (dt.Rows.Count > 0) { row.loadData(dt.Rows[0]); DeleteString = row.GetDeleteString(DBType); result = sfcdb.ExecSQL(DeleteString); } else { result = "0"; } } else { string errMsg = MESReturnMessage.GetMESReturnMessage("MES00000019", new string[] { DBType.ToString() }); throw new MESReturnMessage(errMsg); } return(result); }