コード例 #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);
        }
コード例 #2
0
ファイル: RoomData.cs プロジェクト: radtek/Pos
        internal void Import(Dictionary <string, List <string> > cache, PhoenixPacketChargeToRoom status)
        {
            RoomNumber     = status.RoomNumber;
            RegisterNumber = status.RegisterNo;
            StaffID        = status.ServerNo;
            Covers         = status.Covers;
            Catagories     = status.Catagories;

            if (IntaMate.Properties.Settings.Default.PMSPassThough)
            {
                PMSRef = status.PMSReference;
            }

            if (cache.ContainsKey(status.RoomNumber))
            {
                List <String> Foilos = cache[status.RoomNumber];
                if (status.FoiloIndex <= Foilos.Count)
                {
                    switch (status.FoiloIndex)
                    {
                    case 1:
                        PostingFoilo       = Foilos[0];
                        PostingFoiloNumber = '1';
                        break;

                    case 2:
                        PostingFoilo       = Foilos[1];
                        PostingFoiloNumber = '2';
                        break;

                    case 3:
                        PostingFoilo       = Foilos[2];
                        PostingFoiloNumber = '3';
                        break;

                    case 4:
                        PostingFoilo       = Foilos[3];
                        PostingFoiloNumber = '4';
                        break;

                    default:
                        PostingFoilo       = "".PadLeft(16, ' ');
                        PostingFoiloNumber = '0';
                        break;
                    }
                }
                else
                {
                    PostingFoilo       = "".PadLeft(16, ' ');
                    PostingFoiloNumber = '0';
                }
            }
            else
            {
                PostingFoilo       = "".PadLeft(16, ' ');
                PostingFoiloNumber = '0';
            }
            PostingTotal = status.Total;
        }
コード例 #3
0
        public PhoenixPacketBase EvaluateCommand(String Data)
        {
            /* MenuMate basicly sends two commands.
             *
             * 1) Type 3, Room charge command to post money charges to rooms and check codes.
             *      Return ACK for any room charge commands on the default transaction account.
             *      This are used to test the phoenix codes and pass thoses amounts though to phoenix.
             *      You could enhance this by created a list of codes to ignore and thus filter what
             *      is sent though to Roommaster.
             *      This could further be filtered out by Total, ie when MenuMate is checking codes
             *      Its posts to those codes with a total of $0.00 if the total is $0.00 just _protocolUtility.ACK it.
             *
             * 2) Type 7,Rooms Status commands. This is used to collect a list of the room folios.
             */

            switch (Data[1])
            {
            case '3':
                PhoenixPacketChargeToRoom ChargeToRoom = new PhoenixPacketChargeToRoom();
                ChargeToRoom.Parse(Data);
                return(PMSInterface.Charge(ChargeToRoom));

                break;

            case '7':
                PMSRoomStatus ExRoomStatus = new PMSRoomStatus();
                ExRoomStatus.Parse(Data);
                PMSRoomStatusResponse ExRoomStatusResponse = PMSInterface.Inquiry(ExRoomStatus);
                return(ExRoomStatusResponse);

                break;

            default:
                throw new Exception("Invalid Message");
                break;
            }
        }
コード例 #4
0
 internal void CopyFrom(PhoenixPacketChargeToRoom ChargeToRoom)
 {
     registerNo = ChargeToRoom.RegisterNo;
     roomNumber = ChargeToRoom.RoomNumber;
     foiloIndex = ChargeToRoom.FoiloIndex;
 }
コード例 #5
0
ファイル: IPMSServer.cs プロジェクト: radtek/Pos
 abstract public PMSRoomChargeResponse RoomCharge(PhoenixPacketChargeToRoom ChargeToRoom);