?? accommodationmanager.java
字號:
package com.xc.hotelmanager.hotel.control.proxy;import java.util.*;import com.xc.hotelmanager.hotel.model.*;import com.xc.hotelmanager.hotel.control.session.*;import com.xc.hotelmanager.hotel.exception.HotelManagerException;public class AccommodationManager { static AccommodationManager instance = null; private SB_AccommodationManager manager=null; private AccommodationManager(){ try{ manager = com.xc.hotelmanager.hotel.control.EjbGetter.getSB_AccommodationManager().create(); } catch(Exception ex){ } } public static AccommodationManager getInstance(){ if (instance == null) { instance = new AccommodationManager(); } return instance; } public Collection getAccInfo(String cname, String roomid) throws HotelManagerException { try{ Collection result = manager.getAccInfo(cname,roomid); return result; } catch(Exception ex){ throw new HotelManagerException(ex.getMessage()); } } public String getleavedate() throws HotelManagerException{ try{ String result=manager.getleavedate(); return result; } catch(Exception ex){ throw new HotelManagerException(ex.getMessage()); } } public int getlivedays(String id) throws HotelManagerException { int result= 0; try{ result=manager.getlivedays(id); } catch(Exception ex){ throw new HotelManagerException(ex.getMessage()); } return result; } public float getTotelCost(String id) throws HotelManagerException{ float result=0; try{ result =manager.getTotelCost(id); } catch(Exception ex){ throw new HotelManagerException(ex.getMessage()); } return result; }public String saveToAcc(String id, String leavetime,float charge) throws HotelManagerException{ String result=null; try{ result=manager.saveToAcc(id,leavetime,charge); } catch(Exception ex){ return result; } return result;}public Accommodation addAccommodation(Accommodation arecord) throws HotelManagerException { try{ return manager.addAccommodation(arecord); } catch(java.rmi.RemoteException rex){ throw new HotelManagerException("AccommoManager.add Eorr:"+rex.getMessage()); }}public Accommodation saveAccommodation(Accommodation arecord) throws HotelManagerException { try{ return manager.saveAccommodation(arecord); } catch(java.rmi.RemoteException rex){ throw new HotelManagerException("AccommoManager.save Eorr:"+rex.getMessage()); }}public Collection getAllAccommodation() throws HotelManagerException { try{ Collection result = manager.getAllAccommodation(); System.out.print("AccommodationManger.getAllAccommodation ok!"); return result; } catch(Exception rex){ System.out.print("AccommodationManger.getAllAccommodation Error!"); throw new HotelManagerException(rex.getMessage()); }}public Collection getSearchAccommodation(String sql) throws HotelManagerException { try{ Collection result = manager.getSearchAccommodation(sql); System.out.print("AccommodationManger.getAllAccommodation ok!"); return result; } catch(Exception rex){ System.out.print("AccommodationManger.getSearchAccommodation Error!"); throw new HotelManagerException(rex.getMessage()); }} public Accommodation loadAccommodation(String id) throws HotelManagerException { Accommodation result = null; try{ result = manager.loadAccommodation(id); } catch(java.rmi.RemoteException rex){ throw new HotelManagerException("AccommoManager.load Eorr:"+rex.getMessage()); } return result; } public void removeAccommodation(String id) throws HotelManagerException { try{ manager.removeAccommodation(id); } catch(java.rmi.RemoteException rex){ throw new HotelManagerException(rex.getMessage()); } } public Collection getAllAccommodation(String id) throws HotelManagerException{ try{ Collection result = manager.getAllAccommodation(id); return result; } catch(Exception ex){ throw new HotelManagerException(ex.getMessage()); } }public float getCost(String id) throws HotelManagerException{ float result=0; try{ result =manager.getCost(id); } catch(Exception ex){ throw new HotelManagerException(ex.getMessage()); } return result; }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -