public byte[] GetApproachLimitFreeFormMessage(string strResponse) { try { FreeFormMsg objFreeFormMsg = new FreeFormMsg(); PCApproachNotification objPCApproachNotification = new PCApproachNotification(); objPCApproachNotification.MessageType = GetMessageType(strResponse); objPCApproachNotification.TransactionCode = GetTransactionCode(strResponse); objPCApproachNotification.CardLength = ResponseDataAccess.IsExtendedPlayer ? Convert.ToInt32(strResponse.Substring(4, 2)) : 0; objPCApproachNotification.CardNo = GetCardNumber(strResponse); objPCApproachNotification.SlotNo = GetSlotNumber(strResponse); objPCApproachNotification.Stand = GetStand(strResponse); if (ResponseDataAccess.IsExtendedPlayer) { objPCApproachNotification.EventDate = DateTime.ParseExact(strResponse.Substring(36, 8), "yyyyMMdd", null); string Time = strResponse.Substring(44, 6); objPCApproachNotification.EventTime = new TimeSpan(Convert.ToInt32(Time.Substring(0, 2)), Convert.ToInt32(Time.Substring(2, 2)), 0); objPCApproachNotification.DisplayTime = strResponse.Substring(50, 4); objPCApproachNotification.DisplayInterval = (Convert.ToInt32(strResponse.Substring(54, 2)) * 60 + Convert.ToInt32(strResponse.Substring(56, 2))).ToString(); objPCApproachNotification.IsDayTimeBasis = Convert.ToBoolean(strResponse.Substring(58, 1) == "Y" ? 1 : 0); objPCApproachNotification.DayTargetTime = strResponse.Substring(59, 4); objPCApproachNotification.CurrentDayTimeValue = strResponse.Substring(63, 4); objPCApproachNotification.IsWeekTimeBasis = Convert.ToBoolean(strResponse.Substring(67, 1) == "Y" ? 1 : 0); objPCApproachNotification.WeekTargetTime = strResponse.Substring(68, 2); objPCApproachNotification.CurrentWeekTimeValue = strResponse.Substring(70, 2); objPCApproachNotification.IsMonthTimeBasis = Convert.ToBoolean(strResponse.Substring(72, 1) == "Y" ? 1 : 0); objPCApproachNotification.MonthTargetTime = strResponse.Substring(73, 2); objPCApproachNotification.CurrentMonthTimeValue = strResponse.Substring(75, 2); objPCApproachNotification.IsDayLossBasis = Convert.ToBoolean(strResponse.Substring(77, 1) == "Y" ? 1 : 0); objPCApproachNotification.DayTargetLoss = Convert.ToInt32(strResponse.Substring(78, 9)); objPCApproachNotification.CurrentDayLossValue = Convert.ToInt32(strResponse.Substring(87, 9)); objPCApproachNotification.IsWeekLossBasis = Convert.ToBoolean(strResponse.Substring(96, 1) == "Y" ? 1 : 0); objPCApproachNotification.WeekTargetLoss = Convert.ToInt32(strResponse.Substring(97, 9)); objPCApproachNotification.CurrentWeekLossValue = Convert.ToInt32(strResponse.Substring(106, 9)); objPCApproachNotification.IsMonthLossBasis = Convert.ToBoolean(strResponse.Substring(115, 1) == "Y" ? 1 : 0); objPCApproachNotification.MonthTargetLoss = Convert.ToInt32(strResponse.Substring(116, 9)); objPCApproachNotification.CurrentMonthLossValue = Convert.ToInt32(strResponse.Substring(125, 9)); objPCApproachNotification.IsDayWagerBasis = Convert.ToBoolean(strResponse.Substring(134, 1) == "Y" ? 1 : 0); objPCApproachNotification.DayTargetWagers = Convert.ToInt32(strResponse.Substring(135, 9)); objPCApproachNotification.CurrentDayWagerValue = Convert.ToInt32(strResponse.Substring(144, 9)); objPCApproachNotification.IsWeekWagerBasis = Convert.ToBoolean(strResponse.Substring(153, 1) == "Y" ? 1 : 0); objPCApproachNotification.WeekTargetWagers = Convert.ToInt32(strResponse.Substring(154, 9)); objPCApproachNotification.CurrentWeekWagerValue = Convert.ToInt32(strResponse.Substring(163, 9)); objPCApproachNotification.IsMonthWagerBasis = Convert.ToBoolean(strResponse.Substring(172, 1) == "Y" ? 1 : 0); objPCApproachNotification.MonthTargetWagers = Convert.ToInt32(strResponse.Substring(173, 9)); objPCApproachNotification.CurrentMonthWagerValue = Convert.ToInt32(strResponse.Substring(182, 9)); objPCApproachNotification.IsConsecutiveDaysBasis = Convert.ToBoolean(strResponse.Substring(191, 1) == "Y" ? 1 : 0); objPCApproachNotification.TargetConsecutiveDays = Convert.ToInt32(strResponse.Substring(192, 2)); objPCApproachNotification.CurrentConsecutiveDays = Convert.ToInt32(strResponse.Substring(194, 2)); objPCApproachNotification.HandlePulls = strResponse.Substring(196, 4); objPCApproachNotification.RatingInterval = (Convert.ToInt32(strResponse.Substring(200, 2)) * 60 + Convert.ToInt32(strResponse.Substring(202, 2))).ToString(); objPCApproachNotification.DisplayMessage = strResponse.Substring(204).Trim(); } else { objPCApproachNotification.EventDate = DateTime.ParseExact(strResponse.Substring(34, 8), "yyyyMMdd", null); string Time = strResponse.Substring(42, 6); objPCApproachNotification.EventTime = new TimeSpan(Convert.ToInt32(Time.Substring(0, 2)), Convert.ToInt32(Time.Substring(2, 2)), 0); objPCApproachNotification.DisplayTime = (Convert.ToInt32(strResponse.Substring(48, 2)) * 60 + Convert.ToInt32(strResponse.Substring(50, 2))).ToString(); objPCApproachNotification.DisplayInterval = (Convert.ToInt32(strResponse.Substring(52, 2)) * 60 + Convert.ToInt32(strResponse.Substring(54, 2))).ToString(); objPCApproachNotification.IsDayTimeBasis = Convert.ToBoolean(strResponse.Substring(56, 1) == "Y" ? 1 : 0); objPCApproachNotification.DayTargetTime = strResponse.Substring(57, 4); objPCApproachNotification.CurrentDayTimeValue = strResponse.Substring(61, 4); objPCApproachNotification.IsWeekTimeBasis = Convert.ToBoolean(strResponse.Substring(65, 1) == "Y" ? 1 : 0); objPCApproachNotification.WeekTargetTime = strResponse.Substring(66, 2); objPCApproachNotification.CurrentWeekTimeValue = strResponse.Substring(68, 2); objPCApproachNotification.IsMonthTimeBasis = Convert.ToBoolean(strResponse.Substring(70, 1) == "Y" ? 1 : 0); objPCApproachNotification.MonthTargetTime = strResponse.Substring(71, 2); objPCApproachNotification.CurrentMonthTimeValue = strResponse.Substring(73, 2); objPCApproachNotification.IsDayLossBasis = Convert.ToBoolean(strResponse.Substring(75, 1) == "Y" ? 1 : 0); objPCApproachNotification.DayTargetLoss = Convert.ToInt32(strResponse.Substring(76, 9)); objPCApproachNotification.CurrentDayLossValue = Convert.ToInt32(strResponse.Substring(85, 9)); objPCApproachNotification.IsWeekLossBasis = Convert.ToBoolean(strResponse.Substring(94, 1) == "Y" ? 1 : 0); objPCApproachNotification.WeekTargetLoss = Convert.ToInt32(strResponse.Substring(95, 9)); objPCApproachNotification.CurrentWeekLossValue = Convert.ToInt32(strResponse.Substring(104, 9)); objPCApproachNotification.IsMonthLossBasis = Convert.ToBoolean(strResponse.Substring(113, 1) == "Y" ? 1 : 0); objPCApproachNotification.MonthTargetLoss = Convert.ToInt32(strResponse.Substring(114, 9)); objPCApproachNotification.CurrentMonthLossValue = Convert.ToInt32(strResponse.Substring(123, 9)); objPCApproachNotification.IsDayWagerBasis = Convert.ToBoolean(strResponse.Substring(132, 1) == "Y" ? 1 : 0); objPCApproachNotification.DayTargetWagers = Convert.ToInt32(strResponse.Substring(134, 9)); objPCApproachNotification.CurrentDayWagerValue = Convert.ToInt32(strResponse.Substring(142, 9)); objPCApproachNotification.IsWeekWagerBasis = Convert.ToBoolean(strResponse.Substring(151, 1) == "Y" ? 1 : 0); objPCApproachNotification.WeekTargetWagers = Convert.ToInt32(strResponse.Substring(152, 9)); objPCApproachNotification.CurrentWeekWagerValue = Convert.ToInt32(strResponse.Substring(161, 9)); objPCApproachNotification.IsMonthWagerBasis = Convert.ToBoolean(strResponse.Substring(170, 1) == "Y" ? 1 : 0); objPCApproachNotification.MonthTargetWagers = Convert.ToInt32(strResponse.Substring(171, 9)); objPCApproachNotification.CurrentMonthWagerValue = Convert.ToInt32(strResponse.Substring(180, 9)); objPCApproachNotification.IsConsecutiveDaysBasis = Convert.ToBoolean(strResponse.Substring(189, 1) == "Y" ? 1 : 0); objPCApproachNotification.TargetConsecutiveDays = Convert.ToInt32(strResponse.Substring(190, 2)); objPCApproachNotification.CurrentConsecutiveDays = Convert.ToInt32(strResponse.Substring(192, 2)); objPCApproachNotification.HandlePulls = strResponse.Substring(194, 4); objPCApproachNotification.RatingInterval = (Convert.ToInt32(strResponse.Substring(198, 2)) * 60 + Convert.ToInt32(strResponse.Substring(200, 2))).ToString(); objPCApproachNotification.DisplayMessage = strResponse.Substring(202).Trim(); } return objFreeFormMsg.GetApproachingLimitResponse(objPCApproachNotification); } catch (Exception ex) { ExceptionManager.Publish(ex); return new byte[] { }; } }
public byte[] GetApproachLimitFreeFormMessage(string strResponse) { try { FreeFormMsg objFreeFormMsg = new FreeFormMsg(); PCApproachNotification objPCApproachNotification = new PCApproachNotification(); objPCApproachNotification.MessageType = GetMessageType(strResponse); objPCApproachNotification.TransactionCode = GetTransactionCode(strResponse); objPCApproachNotification.CardLength = ResponseDataAccess.IsExtendedPlayer ? Convert.ToInt32(strResponse.Substring(4, 2)) : 0; objPCApproachNotification.CardNo = GetCardNumber(strResponse); objPCApproachNotification.SlotNo = GetSlotNumber(strResponse); objPCApproachNotification.Stand = GetStand(strResponse); if (ResponseDataAccess.IsExtendedPlayer) { objPCApproachNotification.EventDate = DateTime.ParseExact(strResponse.Substring(36, 8), "yyyyMMdd", null); string Time = strResponse.Substring(44, 6); objPCApproachNotification.EventTime = new TimeSpan(Convert.ToInt32(Time.Substring(0, 2)), Convert.ToInt32(Time.Substring(2, 2)), 0); objPCApproachNotification.DisplayTime = strResponse.Substring(50, 4); objPCApproachNotification.DisplayInterval = (Convert.ToInt32(strResponse.Substring(54, 2)) * 60 + Convert.ToInt32(strResponse.Substring(56, 2))).ToString(); objPCApproachNotification.IsDayTimeBasis = Convert.ToBoolean(strResponse.Substring(58, 1) == "Y" ? 1 : 0); objPCApproachNotification.DayTargetTime = strResponse.Substring(59, 4); objPCApproachNotification.CurrentDayTimeValue = strResponse.Substring(63, 4); objPCApproachNotification.IsWeekTimeBasis = Convert.ToBoolean(strResponse.Substring(67, 1) == "Y" ? 1 : 0); objPCApproachNotification.WeekTargetTime = strResponse.Substring(68, 2); objPCApproachNotification.CurrentWeekTimeValue = strResponse.Substring(70, 2); objPCApproachNotification.IsMonthTimeBasis = Convert.ToBoolean(strResponse.Substring(72, 1) == "Y" ? 1 : 0); objPCApproachNotification.MonthTargetTime = strResponse.Substring(73, 2); objPCApproachNotification.CurrentMonthTimeValue = strResponse.Substring(75, 2); objPCApproachNotification.IsDayLossBasis = Convert.ToBoolean(strResponse.Substring(77, 1) == "Y" ? 1 : 0); objPCApproachNotification.DayTargetLoss = Convert.ToInt32(strResponse.Substring(78, 9)); objPCApproachNotification.CurrentDayLossValue = Convert.ToInt32(strResponse.Substring(87, 9)); objPCApproachNotification.IsWeekLossBasis = Convert.ToBoolean(strResponse.Substring(96, 1) == "Y" ? 1 : 0); objPCApproachNotification.WeekTargetLoss = Convert.ToInt32(strResponse.Substring(97, 9)); objPCApproachNotification.CurrentWeekLossValue = Convert.ToInt32(strResponse.Substring(106, 9)); objPCApproachNotification.IsMonthLossBasis = Convert.ToBoolean(strResponse.Substring(115, 1) == "Y" ? 1 : 0); objPCApproachNotification.MonthTargetLoss = Convert.ToInt32(strResponse.Substring(116, 9)); objPCApproachNotification.CurrentMonthLossValue = Convert.ToInt32(strResponse.Substring(125, 9)); objPCApproachNotification.IsDayWagerBasis = Convert.ToBoolean(strResponse.Substring(134, 1) == "Y" ? 1 : 0); objPCApproachNotification.DayTargetWagers = Convert.ToInt32(strResponse.Substring(135, 9)); objPCApproachNotification.CurrentDayWagerValue = Convert.ToInt32(strResponse.Substring(144, 9)); objPCApproachNotification.IsWeekWagerBasis = Convert.ToBoolean(strResponse.Substring(153, 1) == "Y" ? 1 : 0); objPCApproachNotification.WeekTargetWagers = Convert.ToInt32(strResponse.Substring(154, 9)); objPCApproachNotification.CurrentWeekWagerValue = Convert.ToInt32(strResponse.Substring(163, 9)); objPCApproachNotification.IsMonthWagerBasis = Convert.ToBoolean(strResponse.Substring(172, 1) == "Y" ? 1 : 0); objPCApproachNotification.MonthTargetWagers = Convert.ToInt32(strResponse.Substring(173, 9)); objPCApproachNotification.CurrentMonthWagerValue = Convert.ToInt32(strResponse.Substring(182, 9)); objPCApproachNotification.IsConsecutiveDaysBasis = Convert.ToBoolean(strResponse.Substring(191, 1) == "Y" ? 1 : 0); objPCApproachNotification.TargetConsecutiveDays = Convert.ToInt32(strResponse.Substring(192, 2)); objPCApproachNotification.CurrentConsecutiveDays = Convert.ToInt32(strResponse.Substring(194, 2)); objPCApproachNotification.HandlePulls = strResponse.Substring(196, 4); objPCApproachNotification.RatingInterval = (Convert.ToInt32(strResponse.Substring(200, 2)) * 60 + Convert.ToInt32(strResponse.Substring(202, 2))).ToString(); objPCApproachNotification.DisplayMessage = strResponse.Substring(204).Trim(); } else { objPCApproachNotification.EventDate = DateTime.ParseExact(strResponse.Substring(34, 8), "yyyyMMdd", null); string Time = strResponse.Substring(42, 6); objPCApproachNotification.EventTime = new TimeSpan(Convert.ToInt32(Time.Substring(0, 2)), Convert.ToInt32(Time.Substring(2, 2)), 0); objPCApproachNotification.DisplayTime = (Convert.ToInt32(strResponse.Substring(48, 2)) * 60 + Convert.ToInt32(strResponse.Substring(50, 2))).ToString(); objPCApproachNotification.DisplayInterval = (Convert.ToInt32(strResponse.Substring(52, 2)) * 60 + Convert.ToInt32(strResponse.Substring(54, 2))).ToString(); objPCApproachNotification.IsDayTimeBasis = Convert.ToBoolean(strResponse.Substring(56, 1) == "Y" ? 1 : 0); objPCApproachNotification.DayTargetTime = strResponse.Substring(57, 4); objPCApproachNotification.CurrentDayTimeValue = strResponse.Substring(61, 4); objPCApproachNotification.IsWeekTimeBasis = Convert.ToBoolean(strResponse.Substring(65, 1) == "Y" ? 1 : 0); objPCApproachNotification.WeekTargetTime = strResponse.Substring(66, 2); objPCApproachNotification.CurrentWeekTimeValue = strResponse.Substring(68, 2); objPCApproachNotification.IsMonthTimeBasis = Convert.ToBoolean(strResponse.Substring(70, 1) == "Y" ? 1 : 0); objPCApproachNotification.MonthTargetTime = strResponse.Substring(71, 2); objPCApproachNotification.CurrentMonthTimeValue = strResponse.Substring(73, 2); objPCApproachNotification.IsDayLossBasis = Convert.ToBoolean(strResponse.Substring(75, 1) == "Y" ? 1 : 0); objPCApproachNotification.DayTargetLoss = Convert.ToInt32(strResponse.Substring(76, 9)); objPCApproachNotification.CurrentDayLossValue = Convert.ToInt32(strResponse.Substring(85, 9)); objPCApproachNotification.IsWeekLossBasis = Convert.ToBoolean(strResponse.Substring(94, 1) == "Y" ? 1 : 0); objPCApproachNotification.WeekTargetLoss = Convert.ToInt32(strResponse.Substring(95, 9)); objPCApproachNotification.CurrentWeekLossValue = Convert.ToInt32(strResponse.Substring(104, 9)); objPCApproachNotification.IsMonthLossBasis = Convert.ToBoolean(strResponse.Substring(113, 1) == "Y" ? 1 : 0); objPCApproachNotification.MonthTargetLoss = Convert.ToInt32(strResponse.Substring(114, 9)); objPCApproachNotification.CurrentMonthLossValue = Convert.ToInt32(strResponse.Substring(123, 9)); objPCApproachNotification.IsDayWagerBasis = Convert.ToBoolean(strResponse.Substring(132, 1) == "Y" ? 1 : 0); objPCApproachNotification.DayTargetWagers = Convert.ToInt32(strResponse.Substring(134, 9)); objPCApproachNotification.CurrentDayWagerValue = Convert.ToInt32(strResponse.Substring(142, 9)); objPCApproachNotification.IsWeekWagerBasis = Convert.ToBoolean(strResponse.Substring(151, 1) == "Y" ? 1 : 0); objPCApproachNotification.WeekTargetWagers = Convert.ToInt32(strResponse.Substring(152, 9)); objPCApproachNotification.CurrentWeekWagerValue = Convert.ToInt32(strResponse.Substring(161, 9)); objPCApproachNotification.IsMonthWagerBasis = Convert.ToBoolean(strResponse.Substring(170, 1) == "Y" ? 1 : 0); objPCApproachNotification.MonthTargetWagers = Convert.ToInt32(strResponse.Substring(171, 9)); objPCApproachNotification.CurrentMonthWagerValue = Convert.ToInt32(strResponse.Substring(180, 9)); objPCApproachNotification.IsConsecutiveDaysBasis = Convert.ToBoolean(strResponse.Substring(189, 1) == "Y" ? 1 : 0); objPCApproachNotification.TargetConsecutiveDays = Convert.ToInt32(strResponse.Substring(190, 2)); objPCApproachNotification.CurrentConsecutiveDays = Convert.ToInt32(strResponse.Substring(192, 2)); objPCApproachNotification.HandlePulls = strResponse.Substring(194, 4); objPCApproachNotification.RatingInterval = (Convert.ToInt32(strResponse.Substring(198, 2)) * 60 + Convert.ToInt32(strResponse.Substring(200, 2))).ToString(); objPCApproachNotification.DisplayMessage = strResponse.Substring(202).Trim(); } return(objFreeFormMsg.GetApproachingLimitResponse(objPCApproachNotification)); } catch (Exception ex) { ExceptionManager.Publish(ex); return(new byte[] { }); } }