public byte[] GetLimitReachedFreeFormMessage(string strResponse)
        {
            try
            {
                FreeFormMsg objFreeFormMsg = new FreeFormMsg();
                PCLimitReachedNotification objPCLimitReachedNotification = new PCLimitReachedNotification();

                objPCLimitReachedNotification.MessageType = GetMessageType(strResponse);
                objPCLimitReachedNotification.TransactionCode = GetTransactionCode(strResponse);
                objPCLimitReachedNotification.CardLength = ResponseDataAccess.IsExtendedPlayer ? Convert.ToInt32(strResponse.Substring(4, 2)) : 0;
                objPCLimitReachedNotification.CardNo = GetCardNumber(strResponse);
                objPCLimitReachedNotification.SlotNo = GetSlotNumber(strResponse);
                objPCLimitReachedNotification.Stand = GetStand(strResponse);

                if (ResponseDataAccess.IsExtendedPlayer)
                {
                    objPCLimitReachedNotification.LockType = strResponse.Substring(50, 1);
                    objPCLimitReachedNotification.DisplayTime = (Convert.ToInt32(strResponse.Substring(51, 2)) * 60 + Convert.ToInt32(strResponse.Substring(53, 2))).ToString();
                    objPCLimitReachedNotification.DisplayInterval = (Convert.ToInt32(strResponse.Substring(55, 2)) * 60 + Convert.ToInt32(strResponse.Substring(55, 2))).ToString();

                    objPCLimitReachedNotification.IsDayTimeBasis = Convert.ToBoolean(strResponse.Substring(59, 1) == "Y" ? 1 : 0);
                    objPCLimitReachedNotification.DayTargetTime = strResponse.Substring(60, 4);
                    objPCLimitReachedNotification.CurrentDayTimeValue = strResponse.Substring(64, 4);

                    objPCLimitReachedNotification.IsWeekTimeBasis = Convert.ToBoolean(strResponse.Substring(68, 1) == "Y" ? 1 : 0);
                    objPCLimitReachedNotification.WeekTargetTime = strResponse.Substring(69, 2);
                    objPCLimitReachedNotification.CurrentWeekTimeValue = strResponse.Substring(71, 2);

                    objPCLimitReachedNotification.IsMonthTimeBasis = Convert.ToBoolean(strResponse.Substring(73, 1) == "Y" ? 1 : 0);
                    objPCLimitReachedNotification.MonthTargetTime = strResponse.Substring(74, 2);
                    objPCLimitReachedNotification.CurrentMonthTimeValue = strResponse.Substring(76, 2);

                    objPCLimitReachedNotification.IsDayLossBasis = Convert.ToBoolean(strResponse.Substring(78, 1) == "Y" ? 1 : 0);
                    objPCLimitReachedNotification.DayTargetLoss = Convert.ToInt32(strResponse.Substring(79, 9));
                    objPCLimitReachedNotification.CurrentDayLossValue = Convert.ToInt32(strResponse.Substring(88, 9));

                    objPCLimitReachedNotification.IsWeekLossBasis = Convert.ToBoolean(strResponse.Substring(97, 1) == "Y" ? 1 : 0);
                    objPCLimitReachedNotification.WeekTargetLoss = Convert.ToInt32(strResponse.Substring(98, 9));
                    objPCLimitReachedNotification.CurrentWeekLossValue = Convert.ToInt32(strResponse.Substring(107, 9));

                    objPCLimitReachedNotification.IsMonthLossBasis = Convert.ToBoolean(strResponse.Substring(116, 1) == "Y" ? 1 : 0);
                    objPCLimitReachedNotification.MonthTargetLoss = Convert.ToInt32(strResponse.Substring(117, 9));
                    objPCLimitReachedNotification.CurrentMonthLossValue = Convert.ToInt32(strResponse.Substring(126, 9));

                    objPCLimitReachedNotification.IsDayWagerBasis = Convert.ToBoolean(strResponse.Substring(135, 1) == "Y" ? 1 : 0);
                    objPCLimitReachedNotification.DayTargetWagers = Convert.ToInt32(strResponse.Substring(136, 9));
                    objPCLimitReachedNotification.CurrentDayWagerValue = Convert.ToInt32(strResponse.Substring(145, 9));

                    objPCLimitReachedNotification.IsWeekWagerBasis = Convert.ToBoolean(strResponse.Substring(154, 1) == "Y" ? 1 : 0);
                    objPCLimitReachedNotification.WeekTargetWagers = Convert.ToInt32(strResponse.Substring(155, 9));
                    objPCLimitReachedNotification.CurrentWeekWagerValue = Convert.ToInt32(strResponse.Substring(164, 9));

                    objPCLimitReachedNotification.IsMonthWagerBasis = Convert.ToBoolean(strResponse.Substring(173, 1) == "Y" ? 1 : 0);
                    objPCLimitReachedNotification.MonthTargetWagers = Convert.ToInt32(strResponse.Substring(175, 9));
                    objPCLimitReachedNotification.CurrentMonthWagerValue = Convert.ToInt32(strResponse.Substring(183, 9));

                    objPCLimitReachedNotification.IsConsecutiveDaysBasis = Convert.ToBoolean(strResponse.Substring(192, 1) == "Y" ? 1 : 0);
                    objPCLimitReachedNotification.TargetConsecutiveDays = Convert.ToInt32(strResponse.Substring(193, 2));
                    objPCLimitReachedNotification.CurrentConsecutiveDays = Convert.ToInt32(strResponse.Substring(195, 2));
                    objPCLimitReachedNotification.DisplayMessage = strResponse.Substring(197).Trim();
                }
                else
                {
                    objPCLimitReachedNotification.LockType = strResponse.Substring(48, 1);
                    objPCLimitReachedNotification.DisplayTime = strResponse.Substring(49, 4);
                    objPCLimitReachedNotification.DisplayInterval = strResponse.Substring(53, 4);

                    objPCLimitReachedNotification.IsDayTimeBasis = Convert.ToBoolean(strResponse.Substring(57, 1) == "Y" ? 1 : 0); ;
                    objPCLimitReachedNotification.DayTargetTime = strResponse.Substring(58, 4);
                    objPCLimitReachedNotification.CurrentDayTimeValue = strResponse.Substring(62, 4);

                    objPCLimitReachedNotification.IsWeekTimeBasis = Convert.ToBoolean(strResponse.Substring(66, 1) == "Y" ? 1 : 0);
                    objPCLimitReachedNotification.WeekTargetTime = strResponse.Substring(67, 2);
                    objPCLimitReachedNotification.CurrentWeekTimeValue = strResponse.Substring(69, 2);

                    objPCLimitReachedNotification.IsMonthTimeBasis = Convert.ToBoolean(strResponse.Substring(71, 1) == "Y" ? 1 : 0);
                    objPCLimitReachedNotification.MonthTargetTime = strResponse.Substring(72, 2);
                    objPCLimitReachedNotification.CurrentMonthTimeValue = strResponse.Substring(74, 2);

                    objPCLimitReachedNotification.IsDayLossBasis = Convert.ToBoolean(strResponse.Substring(76, 1) == "Y" ? 1 : 0);
                    objPCLimitReachedNotification.DayTargetLoss = Convert.ToInt32(strResponse.Substring(77, 9));
                    objPCLimitReachedNotification.CurrentDayLossValue = Convert.ToInt32(strResponse.Substring(86, 9) == "Y" ? 1 : 0);

                    objPCLimitReachedNotification.IsWeekLossBasis = Convert.ToBoolean(strResponse.Substring(95, 1) == "Y" ? 1 : 0);
                    objPCLimitReachedNotification.WeekTargetLoss = Convert.ToInt32(strResponse.Substring(96, 9));
                    objPCLimitReachedNotification.CurrentWeekLossValue = Convert.ToInt32(strResponse.Substring(105, 9));

                    objPCLimitReachedNotification.IsMonthLossBasis = Convert.ToBoolean(strResponse.Substring(114, 1) == "Y" ? 1 : 0);
                    objPCLimitReachedNotification.MonthTargetLoss = Convert.ToInt32(strResponse.Substring(115, 9));
                    objPCLimitReachedNotification.CurrentMonthLossValue = Convert.ToInt32(strResponse.Substring(124, 9));

                    objPCLimitReachedNotification.IsDayWagerBasis = Convert.ToBoolean(strResponse.Substring(133, 1) == "Y" ? 1 : 0);
                    objPCLimitReachedNotification.DayTargetWagers = Convert.ToInt32(strResponse.Substring(134, 9) == "Y" ? 1 : 0);
                    objPCLimitReachedNotification.CurrentDayWagerValue = Convert.ToInt32(strResponse.Substring(143, 9) == "Y" ? 1 : 0);

                    objPCLimitReachedNotification.IsWeekWagerBasis = Convert.ToBoolean(strResponse.Substring(152, 1) == "Y" ? 1 : 0);
                    objPCLimitReachedNotification.WeekTargetWagers = Convert.ToInt32(strResponse.Substring(153, 9));
                    objPCLimitReachedNotification.CurrentWeekWagerValue = Convert.ToInt32(strResponse.Substring(162, 9));

                    objPCLimitReachedNotification.IsMonthWagerBasis = Convert.ToBoolean(strResponse.Substring(171, 1) == "Y" ? 1 : 0);
                    objPCLimitReachedNotification.MonthTargetWagers = Convert.ToInt32(strResponse.Substring(173, 9));
                    objPCLimitReachedNotification.CurrentMonthWagerValue = Convert.ToInt32(strResponse.Substring(181, 9));

                    objPCLimitReachedNotification.IsConsecutiveDaysBasis = Convert.ToBoolean(strResponse.Substring(190, 1) == "Y" ? 1 : 0);
                    objPCLimitReachedNotification.TargetConsecutiveDays = Convert.ToInt32(strResponse.Substring(191, 2));
                    objPCLimitReachedNotification.CurrentConsecutiveDays = Convert.ToInt32(strResponse.Substring(193, 2));
                    objPCLimitReachedNotification.DisplayMessage = strResponse.Substring(195).Trim();
                }

                return objFreeFormMsg.GetLimitReachedResponse(objPCLimitReachedNotification);
            }
            catch (Exception ex)
            {
                ExceptionManager.Publish(ex);
                return new byte[] { };
            }
        }
Пример #2
0
        public byte[] GetLimitReachedFreeFormMessage(string strResponse)
        {
            try
            {
                FreeFormMsg objFreeFormMsg = new FreeFormMsg();
                PCLimitReachedNotification objPCLimitReachedNotification = new PCLimitReachedNotification();

                objPCLimitReachedNotification.MessageType     = GetMessageType(strResponse);
                objPCLimitReachedNotification.TransactionCode = GetTransactionCode(strResponse);
                objPCLimitReachedNotification.CardLength      = ResponseDataAccess.IsExtendedPlayer ? Convert.ToInt32(strResponse.Substring(4, 2)) : 0;
                objPCLimitReachedNotification.CardNo          = GetCardNumber(strResponse);
                objPCLimitReachedNotification.SlotNo          = GetSlotNumber(strResponse);
                objPCLimitReachedNotification.Stand           = GetStand(strResponse);

                if (ResponseDataAccess.IsExtendedPlayer)
                {
                    objPCLimitReachedNotification.LockType        = strResponse.Substring(50, 1);
                    objPCLimitReachedNotification.DisplayTime     = (Convert.ToInt32(strResponse.Substring(51, 2)) * 60 + Convert.ToInt32(strResponse.Substring(53, 2))).ToString();
                    objPCLimitReachedNotification.DisplayInterval = (Convert.ToInt32(strResponse.Substring(55, 2)) * 60 + Convert.ToInt32(strResponse.Substring(55, 2))).ToString();

                    objPCLimitReachedNotification.IsDayTimeBasis      = Convert.ToBoolean(strResponse.Substring(59, 1) == "Y" ? 1 : 0);
                    objPCLimitReachedNotification.DayTargetTime       = strResponse.Substring(60, 4);
                    objPCLimitReachedNotification.CurrentDayTimeValue = strResponse.Substring(64, 4);

                    objPCLimitReachedNotification.IsWeekTimeBasis      = Convert.ToBoolean(strResponse.Substring(68, 1) == "Y" ? 1 : 0);
                    objPCLimitReachedNotification.WeekTargetTime       = strResponse.Substring(69, 2);
                    objPCLimitReachedNotification.CurrentWeekTimeValue = strResponse.Substring(71, 2);

                    objPCLimitReachedNotification.IsMonthTimeBasis      = Convert.ToBoolean(strResponse.Substring(73, 1) == "Y" ? 1 : 0);
                    objPCLimitReachedNotification.MonthTargetTime       = strResponse.Substring(74, 2);
                    objPCLimitReachedNotification.CurrentMonthTimeValue = strResponse.Substring(76, 2);

                    objPCLimitReachedNotification.IsDayLossBasis      = Convert.ToBoolean(strResponse.Substring(78, 1) == "Y" ? 1 : 0);
                    objPCLimitReachedNotification.DayTargetLoss       = Convert.ToInt32(strResponse.Substring(79, 9));
                    objPCLimitReachedNotification.CurrentDayLossValue = Convert.ToInt32(strResponse.Substring(88, 9));

                    objPCLimitReachedNotification.IsWeekLossBasis      = Convert.ToBoolean(strResponse.Substring(97, 1) == "Y" ? 1 : 0);
                    objPCLimitReachedNotification.WeekTargetLoss       = Convert.ToInt32(strResponse.Substring(98, 9));
                    objPCLimitReachedNotification.CurrentWeekLossValue = Convert.ToInt32(strResponse.Substring(107, 9));

                    objPCLimitReachedNotification.IsMonthLossBasis      = Convert.ToBoolean(strResponse.Substring(116, 1) == "Y" ? 1 : 0);
                    objPCLimitReachedNotification.MonthTargetLoss       = Convert.ToInt32(strResponse.Substring(117, 9));
                    objPCLimitReachedNotification.CurrentMonthLossValue = Convert.ToInt32(strResponse.Substring(126, 9));

                    objPCLimitReachedNotification.IsDayWagerBasis      = Convert.ToBoolean(strResponse.Substring(135, 1) == "Y" ? 1 : 0);
                    objPCLimitReachedNotification.DayTargetWagers      = Convert.ToInt32(strResponse.Substring(136, 9));
                    objPCLimitReachedNotification.CurrentDayWagerValue = Convert.ToInt32(strResponse.Substring(145, 9));

                    objPCLimitReachedNotification.IsWeekWagerBasis      = Convert.ToBoolean(strResponse.Substring(154, 1) == "Y" ? 1 : 0);
                    objPCLimitReachedNotification.WeekTargetWagers      = Convert.ToInt32(strResponse.Substring(155, 9));
                    objPCLimitReachedNotification.CurrentWeekWagerValue = Convert.ToInt32(strResponse.Substring(164, 9));

                    objPCLimitReachedNotification.IsMonthWagerBasis      = Convert.ToBoolean(strResponse.Substring(173, 1) == "Y" ? 1 : 0);
                    objPCLimitReachedNotification.MonthTargetWagers      = Convert.ToInt32(strResponse.Substring(175, 9));
                    objPCLimitReachedNotification.CurrentMonthWagerValue = Convert.ToInt32(strResponse.Substring(183, 9));

                    objPCLimitReachedNotification.IsConsecutiveDaysBasis = Convert.ToBoolean(strResponse.Substring(192, 1) == "Y" ? 1 : 0);
                    objPCLimitReachedNotification.TargetConsecutiveDays  = Convert.ToInt32(strResponse.Substring(193, 2));
                    objPCLimitReachedNotification.CurrentConsecutiveDays = Convert.ToInt32(strResponse.Substring(195, 2));
                    objPCLimitReachedNotification.DisplayMessage         = strResponse.Substring(197).Trim();
                }
                else
                {
                    objPCLimitReachedNotification.LockType        = strResponse.Substring(48, 1);
                    objPCLimitReachedNotification.DisplayTime     = strResponse.Substring(49, 4);
                    objPCLimitReachedNotification.DisplayInterval = strResponse.Substring(53, 4);

                    objPCLimitReachedNotification.IsDayTimeBasis      = Convert.ToBoolean(strResponse.Substring(57, 1) == "Y" ? 1 : 0);;
                    objPCLimitReachedNotification.DayTargetTime       = strResponse.Substring(58, 4);
                    objPCLimitReachedNotification.CurrentDayTimeValue = strResponse.Substring(62, 4);

                    objPCLimitReachedNotification.IsWeekTimeBasis      = Convert.ToBoolean(strResponse.Substring(66, 1) == "Y" ? 1 : 0);
                    objPCLimitReachedNotification.WeekTargetTime       = strResponse.Substring(67, 2);
                    objPCLimitReachedNotification.CurrentWeekTimeValue = strResponse.Substring(69, 2);

                    objPCLimitReachedNotification.IsMonthTimeBasis      = Convert.ToBoolean(strResponse.Substring(71, 1) == "Y" ? 1 : 0);
                    objPCLimitReachedNotification.MonthTargetTime       = strResponse.Substring(72, 2);
                    objPCLimitReachedNotification.CurrentMonthTimeValue = strResponse.Substring(74, 2);

                    objPCLimitReachedNotification.IsDayLossBasis      = Convert.ToBoolean(strResponse.Substring(76, 1) == "Y" ? 1 : 0);
                    objPCLimitReachedNotification.DayTargetLoss       = Convert.ToInt32(strResponse.Substring(77, 9));
                    objPCLimitReachedNotification.CurrentDayLossValue = Convert.ToInt32(strResponse.Substring(86, 9) == "Y" ? 1 : 0);

                    objPCLimitReachedNotification.IsWeekLossBasis      = Convert.ToBoolean(strResponse.Substring(95, 1) == "Y" ? 1 : 0);
                    objPCLimitReachedNotification.WeekTargetLoss       = Convert.ToInt32(strResponse.Substring(96, 9));
                    objPCLimitReachedNotification.CurrentWeekLossValue = Convert.ToInt32(strResponse.Substring(105, 9));

                    objPCLimitReachedNotification.IsMonthLossBasis      = Convert.ToBoolean(strResponse.Substring(114, 1) == "Y" ? 1 : 0);
                    objPCLimitReachedNotification.MonthTargetLoss       = Convert.ToInt32(strResponse.Substring(115, 9));
                    objPCLimitReachedNotification.CurrentMonthLossValue = Convert.ToInt32(strResponse.Substring(124, 9));

                    objPCLimitReachedNotification.IsDayWagerBasis      = Convert.ToBoolean(strResponse.Substring(133, 1) == "Y" ? 1 : 0);
                    objPCLimitReachedNotification.DayTargetWagers      = Convert.ToInt32(strResponse.Substring(134, 9) == "Y" ? 1 : 0);
                    objPCLimitReachedNotification.CurrentDayWagerValue = Convert.ToInt32(strResponse.Substring(143, 9) == "Y" ? 1 : 0);

                    objPCLimitReachedNotification.IsWeekWagerBasis      = Convert.ToBoolean(strResponse.Substring(152, 1) == "Y" ? 1 : 0);
                    objPCLimitReachedNotification.WeekTargetWagers      = Convert.ToInt32(strResponse.Substring(153, 9));
                    objPCLimitReachedNotification.CurrentWeekWagerValue = Convert.ToInt32(strResponse.Substring(162, 9));

                    objPCLimitReachedNotification.IsMonthWagerBasis      = Convert.ToBoolean(strResponse.Substring(171, 1) == "Y" ? 1 : 0);
                    objPCLimitReachedNotification.MonthTargetWagers      = Convert.ToInt32(strResponse.Substring(173, 9));
                    objPCLimitReachedNotification.CurrentMonthWagerValue = Convert.ToInt32(strResponse.Substring(181, 9));

                    objPCLimitReachedNotification.IsConsecutiveDaysBasis = Convert.ToBoolean(strResponse.Substring(190, 1) == "Y" ? 1 : 0);
                    objPCLimitReachedNotification.TargetConsecutiveDays  = Convert.ToInt32(strResponse.Substring(191, 2));
                    objPCLimitReachedNotification.CurrentConsecutiveDays = Convert.ToInt32(strResponse.Substring(193, 2));
                    objPCLimitReachedNotification.DisplayMessage         = strResponse.Substring(195).Trim();
                }

                return(objFreeFormMsg.GetLimitReachedResponse(objPCLimitReachedNotification));
            }
            catch (Exception ex)
            {
                ExceptionManager.Publish(ex);
                return(new byte[] { });
            }
        }