Example #1
0
        public PMSRoomChargeResponse Charge(PhoenixPacketChargeToRoom chargeToRoom)
        {
            PMSRoomChargeResponse Response = new PMSRoomChargeResponse();

            try
            {
                UpdateCache(chargeToRoom.RoomNumber, chargeToRoom.RegisterNo);
                _data.Import(_cache, chargeToRoom);

                List <PMSMessage>        messagesToTransmit = BuildTransmissionArray();
                IEnumerator <PMSMessage> emessage           = messagesToTransmit.GetEnumerator();
                if (emessage.MoveNext())
                {
                    do
                    {
                        Trasmit(emessage.Current);
                        ReceiveAccountChargeResponce();
                    }while(emessage.MoveNext() && CheckResponce());
                }
                Response = _data.ExportPMSRoomChargeResponse();
            }
            catch (System.TimeoutException ex)
            {
                logger.Error("MicrosServer : No Reply :" + ex.Message);
                Response.ErrorResponse = ex.Message;
            }
            catch (System.Exception ex)
            {
                logger.Error("\rMicrosServer : " + ex.Message);
                Response.ErrorResponse = ex.Message;
            }
            return(Response);
        }
Example #2
0
        internal PMSRoomChargeResponse ExportPMSRoomChargeResponse()
        {
            PMSRoomChargeResponse Response = new PMSRoomChargeResponse();

            Response.RoomNumber = RoomNumber;
            Response.RegisterNo = RegisterNumber;

            if (PostingResponse == "ACK")
            {
                Response.ACK();
            }
            else
            {
                Response.Response = PostingResponse;
            }
            return(Response);
        }