/// <summary> /// Gets the TITO ticket information. /// </summary> /// <returns></returns> public bool GetTITOTicketInformation(RTOnlineReceiptDetail RTOReceiptDetail) { bool IsSuccess = false; try { if (RTOReceiptDetail.TicketString.Length == 18) { if (GetTicketInfo(ref RTOReceiptDetail)) IsSuccess = true; } if (IsSuccess) { if (GetMachineDetailsFromAsset(ref RTOReceiptDetail)) RTOReceiptDetail.PrintDevice = RTOReceiptDetail.DeviceName; } return IsSuccess; } catch (Exception exGetTITOTicketInformation) { ExceptionManager.Publish(exGetTITOTicketInformation); IsSuccess = false; return IsSuccess; } }
public bool TicketRedemptionReceiptCreate(double CurrentTicketValue, string User, string TicketNumber, double PayoutID, ref RTOnlineReceiptDetail ReceiptDetail) { bool isSuccess = false; //RTOnlineReceiptDetail ReceiptDetail = new RTOnlineReceiptDetail(); ReceiptDetail.TicketString = TicketNumber.Trim(); ReceiptDetail.TickerAmount = CurrentTicketValue; if (ReceiptDetail.TicketString.Length == 18) { if (redeemTicketDB.GetTITOTicketInformation(ReceiptDetail)) isSuccess = true; } else { ReceiptDetail.Payout = PayoutID; if (redeemTicketDB.GetMachineDetailsViaTBRPayout(ref ReceiptDetail)) isSuccess = true; } return isSuccess; }
//Add method for offline receipt print public void GetCommonValues(RTOnlineTicketDetail RTOnlineTicketDetail, RTOnlineReceiptDetail RTOnlineReceiptDetail,string OfflineHeaderText) { oRTOnlineTicketDetail = RTOnlineTicketDetail; oRTOnlineReceiptDetail = RTOnlineReceiptDetail; if (Settings.EnableVoucher) PrintType = "OFFLINE VOUCHER REDEMPTION"; BMC.Common.LogManagement.LogManager.WriteLog("Inside CommonUtilites Settings.EnableVoucher=: " + Settings.EnableVoucher.ToString() + "object ticketdetail=:" + oRTOnlineTicketDetail.ToString() + "object ReceiptDetail=:" + RTOnlineReceiptDetail.ToString(), BMC.Common.LogManagement.LogManager.enumLogLevel.Debug); PrintFunction(); }
/// <summary> /// Gets the machine details from TBR Payout. /// </summary> /// <returns></returns> public bool GetMachineDetailsViaTBRPayout(ref RTOnlineReceiptDetail RTOReceiptDetail) { bool IsSuccess = false; try { DataSet MachineDetails = new DataSet(); DateTime date = new DateTime(); string[] strArray = new string[1]; strArray[0] = "MachineDetails"; date = DateTime.Now; string strcon = ""; SqlParameter[] objParams = new SqlParameter[2]; objParams[0] = new SqlParameter(DBConstants.CONST_PARAM_PAYOUT, RTOReceiptDetail.Payout); SqlHelper.FillDataset(GetTicketingConnectionString(strcon), DBConstants.CONST_RSP_GETMACHINEDETAILSVIATBRPAYOUT, MachineDetails, strArray, objParams); if (MachineDetails.Tables.Count > 0) { if (MachineDetails.Tables["MachineDetails"].Rows.Count > 0) { RTOReceiptDetail.DatePrinted = Convert.ToDateTime(MachineDetails.Tables["MachineDetails"].Rows[0]["TBR_Payout_Print_Time"].ToString()); RTOReceiptDetail.PrintDevice = ""; RTOReceiptDetail.MachineClassName = MachineDetails.Tables["MachineDetails"].Rows[0]["Name"].ToString(); RTOReceiptDetail.DeviceBarPosition = MachineDetails.Tables["MachineDetails"].Rows[0]["Bar_Pos_Name"].ToString(); } else IsSuccess = false; } else IsSuccess = false; return IsSuccess; } catch (Exception exGetMachineDetailsFromAsset) { ExceptionManager.Publish(exGetMachineDetailsFromAsset); IsSuccess = false; return IsSuccess; } }
/// <summary> /// Gets the ticket information. /// </summary> /// <returns></returns> public static bool GetTicketInfo(ref RTOnlineReceiptDetail RTOReceiptDetail) { bool IsSuccess = false; try { DataSet TicketInfo = new DataSet(); DateTime date = new DateTime(); string[] strArray = new string[1]; strArray[0] = "TicketInfo"; date = DateTime.Now; string strcon = ""; TimeSpan tNegSpan = new TimeSpan(-5); TimeSpan tPosSpan = new TimeSpan(5); SqlParameter[] objParams = new SqlParameter[4]; objParams[0] = new SqlParameter(DBConstants.CONST_PARAM_STARTDATE, date.Add(tNegSpan));//Need it in this format --> "dd mmm yyyy hh:nn:ss" Renjish objParams[1] = new SqlParameter(DBConstants.CONST_PARAM_ENDDATE, date.Add(tPosSpan));//Need it in this format --> "dd mmm yyyy hh:nn:ss" Renjish objParams[2] = new SqlParameter(DBConstants.CONST_PARAM_TYPE, "A"); objParams[3] = new SqlParameter(DBConstants.CONST_PARAM_BARCODE, RTOReceiptDetail.TicketString); SqlHelper.FillDataset(GetTicketingConnectionString(strcon), DBConstants.CONST_RSP_BGS_VOUCHERINFORMATION, TicketInfo, strArray, objParams); if (TicketInfo.Tables.Count > 0) { if (TicketInfo.Tables["TicketInfo"].Rows.Count > 0) { RTOReceiptDetail.PrintDevice = TicketInfo.Tables["TicketInfo"].Rows[0]["PrintDevice"].ToString(); RTOReceiptDetail.DatePrinted = Convert.ToDateTime(TicketInfo.Tables["TicketInfo"].Rows[0]["dtPrinted"]); IsSuccess = true; } else IsSuccess = false; } else IsSuccess = false; return IsSuccess; } catch (Exception exGetTITOTicketInformation) { ExceptionManager.Publish(exGetTITOTicketInformation); IsSuccess = false; return IsSuccess; } }
/// <summary> /// Gets the machine details from Asset. /// </summary> /// <returns></returns> public static bool GetMachineDetailsFromAsset(ref RTOnlineReceiptDetail RTOReceiptDetail) { bool IsSuccess = false; try { DataSet MachineDetails = new DataSet(); DateTime date = new DateTime(); string[] strArray = new string[1]; strArray[0] = "MachineDetails"; date = DateTime.Now; //string strcon = ""; SqlParameter[] objParams = new SqlParameter[1]; objParams[0] = new SqlParameter(DBConstants.CONST_PARAM_MACHINE, RTOReceiptDetail.PrintDevice); SqlHelper.FillDataset(CommonDataAccess.ExchangeConnectionString, DBConstants.CONST_RSP_GETMACHINEDETAILSFROMASSET, MachineDetails, strArray, objParams); if (MachineDetails.Tables.Count > 0) { if (MachineDetails.Tables["MachineDetails"].Rows.Count > 0) { RTOReceiptDetail.MachineClassName = MachineDetails.Tables["MachineDetails"].Rows[0]["Name"].ToString(); RTOReceiptDetail.DeviceBarPosition = MachineDetails.Tables["MachineDetails"].Rows[0]["Bar_Pos_Name"].ToString(); RTOReceiptDetail.DeviceName = MachineDetails.Tables["MachineDetails"].Rows[0]["Stock_No"].ToString(); IsSuccess = true; } else IsSuccess = false; } else IsSuccess = false; return IsSuccess; } catch (Exception exGetMachineDetailsFromAsset) { ExceptionManager.Publish(exGetMachineDetailsFromAsset); IsSuccess = false; return IsSuccess; } }
/// <summary> /// For offline Ticket Check-Durga /// </summary> /// <param name="TicketDetail"></param> /// <returns></returns> public RTOnlineTicketDetail CheckTicket(RTOnlineTicketDetail TicketDetail) { string LocalTicketorSiteCode; string sURL; int Installation_No = 0; int ValidationLength = 0; bool OfflineTicketRedemption = false; bool isTISPrintedTicket = VoucherHelper.IsTISPrintedTicket(TicketDetail.TicketString); if (!isTISPrintedTicket) { LinqDataAccessDataContext linqDBExchange = new LinqDataAccessDataContext(CommonDataAccess.ExchangeConnectionString); IEnumerable<InstallationFromTicket> InstallationTicket = linqDBExchange.GetInstallationNumber(TicketDetail.TicketString); foreach (var item in InstallationTicket) { Installation_No = item.installation_no.Value; } DataTable InstallationDetails = (new CommonDataAccess()).GetInstallationDetails(0, Installation_No, false, false); if (InstallationDetails.Rows.Count > 0) { try { int.TryParse(InstallationDetails.Rows[0]["Validation_length"].ToString(), out ValidationLength); if (ValidationLength == 0) ValidationLength = CONST_DEFAULT_TICKET_LENGTH; } catch { ValidationLength = CONST_DEFAULT_TICKET_LENGTH; } } if (ValidationLength == CONST_DEFAULT_TICKET_LENGTH) { ValidateSiteCode(TicketDetail.TicketString, out LocalTicketorSiteCode, out sURL); if (sURL.IsNullOrEmpty() || sURL == "INVALID") //Invalid Site Code or No rights to access other Site { TicketDetail.TicketStatus = "MessageID312"; TicketDetail.TicketStatusCode = -99; TicketDetail.ValidTicket = false; return TicketDetail; } else if (sURL.StartsWith("http")) // WebService Call in case of Different Site Code { EndpointAddress objEndpoint = new EndpointAddress(sURL); TicketingServiceClient objClient = new TicketingServiceClient(objEndpoint, LocalTicketorSiteCode); //EndpointAddress objEndpoint = new EndpointAddress("http://10.2.108.29/TicketingWCFService/TicketingService.svc"); //sURL //TicketingServiceClient objClient = new TicketingServiceClient(objEndpoint, "1001"); //LocalTicketorSiteCode); return objClient.RedeemOnlineTicket(TicketDetail); } } } else { if (!VoucherHelper.IsEffectiveDateActivated(TicketDetail.TicketString)) { TicketDetail.TicketStatus = "MessageID876"; TicketDetail.ValidTicket = false; return TicketDetail; } //else if (VoucherHelper.IsCardRequired(TicketDetail.TicketString)) //{ // TicketDetail.TicketStatus = "MessageID878"; // TicketDetail.ValidTicket = false; // return TicketDetail; //} } // Local Site Code (Default) int Return = 0; bool isValidTicket = false; string TicketStatus = ""; string TicketString = TicketDetail.TicketString; //HFXVH.Ticket HFXVHTicket = new HFXVH.Ticket(); RTOnlineWageredDropDetail WageredDropDetail = new RTOnlineWageredDropDetail(); TicketDetail.ShowOfflineTicketScreen = false; try { //Return = HFXVHTicket.TicketIsValid(ref TicketString, ref ReturnValue); Return = TicketIsValid(TicketString, isTISPrintedTicket, ref TicketDetail); //TicketDetail.TicketValue = ReturnValue; if (Return > -1) { TicketStatus = "MessageID210"; // "VALID VOUCHER"+ //Application.Current.FindResource("MessageID210") as string // "(" + CommonUtilities.GetCurrency(Convert.ToDouble(TicketDetail.TicketValue / 100)) + ")"; isValidTicket = true; } else { switch (Return) { case -1: TicketStatus = "MessageID211";// Application.Current.FindResource("MessageID211") as string; break; case -2: TicketStatus = "MessageID212";// Application.Current.FindResource("MessageID212") as string; break; case -3: TicketStatus = "MessageID213";// Application.Current.FindResource("MessageID213") as string; if (CheckOfflineRedeemEnabled()) { if (OfflineTicket(ref TicketDetail)) { TicketStatus = "MessageID214";// Application.Current.FindResource("MessageID214") as string; TicketDetail.EnableTickerPrintDetails = true; } else { TicketDetail.ShowOfflineTicketScreen = true; } } break; case -4: TicketStatus = "MessageID215";// Application.Current.FindResource("MessageID215") as string; TicketDetail.EnableTickerPrintDetails = true; GetTicketDetails(ref TicketDetail); //if (HFXVHTicket.GetTicketDetails(ref TicketString)) //{ // TicketDetail.RedeemedMachine = HFXVHTicket.PrintedMachine; // TicketDetail.RedeemedDevice = HFXVHTicket.RedeemedMachine; // TicketDetail.RedeemedDate = HFXVHTicket.RedeemedDate; // TicketDetail.RedeemedAmount = CommonUtilities.GetCurrency((Convert.ToDouble(HFXVHTicket.Value) / 100)); //} //else //{ // TicketDetail.RedeemedMachine = ""; // TicketDetail.RedeemedDevice = ""; // TicketDetail.RedeemedDate = ""; // TicketDetail.RedeemedAmount = ""; //} break; case -5: TicketStatus = "MessageID216";// Application.Current.FindResource("MessageID216") as string; break; case -6: TicketStatus = "MessageID217";// Application.Current.FindResource("MessageID217") as string; break; case -7: TicketStatus = "MessageID218";// Application.Current.FindResource("MessageID218") as string; break; case -8: TicketStatus = "MessageID219";// Application.Current.FindResource("MessageID219") as string; break; case -9: TicketStatus = "MessageID220";// Application.Current.FindResource("MessageID220") as string; break; case -10: TicketStatus = "MessageID221";// Application.Current.FindResource("MessageID221") as string; break; case -11: TicketStatus = "MessageID222";// Application.Current.FindResource("MessageID222") as string; break; case -12: TicketStatus = "MessageID223"; //Application.Current.FindResource("MessageID223") as string; break; case -13: TicketStatus = "MessageID306";// Application.Current.FindResource("MessageID306") as string; break; case -14: TicketStatus = "MessageID312";// Application.Current.FindResource("MessageID312") as string; break; case -98: CheckTicket(TicketDetail); TicketStatus = "MessageID214";// Application.Current.FindResource("MessageID214") as string; break; default: TicketStatus = "MessageID224";// Application.Current.FindResource("MessageID224") as string; break; } } TicketDetail.TicketStatus = TicketStatus; if (isValidTicket || Return == -4) { TicketDetail.ValidTicket = true; GetTicketDetails(ref TicketDetail); //if (HFXVHTicket.GetTicketDetails(ref TicketString)) //{ // TicketDetail.RedeemedMachine = HFXVHTicket.PrintedMachine; // TicketDetail.RedeemedAmount = CommonUtilities.GetCurrency((Convert.ToDouble(HFXVHTicket.Value) / 100)); //} //else //{ // TicketDetail.RedeemedMachine = ""; // TicketDetail.RedeemedAmount = ""; //} // Check laundering limits, if amount wagered is not enough of credits in, show warning if (Settings.EnableLaundering) { double Wagered = 0; double Drop = 0; WageredDropDetail.WageredAmount = 0; WageredDropDetail.DropAmount = 0; WageredDropDetail.TicketString = TicketString; bool isSuccess = GetWageredAndDrop(ref WageredDropDetail); if (isSuccess) { Wagered = WageredDropDetail.WageredAmount; Drop = WageredDropDetail.DropAmount; } if (Drop > 0) { if ((100 - (((Drop - Wagered) * 100) / Drop)) <= GetAmberCreditsWageredtoCashIn()) TicketDetail.TicketWarning = "Suspect Voucher.."; } } if (CheckTicketValidateVoucherEnabled() && isValidTicket) { //Check for Offline if (OfflineTicket(ref TicketDetail)) OfflineTicketRedemption = true; BMC.Common.LogManagement.LogManager.WriteLog("Started RTOnlineReceiptDetail", BMC.Common.LogManagement.LogManager.enumLogLevel.Debug); RTOnlineReceiptDetail ReceiptDetail = new RTOnlineReceiptDetail(); TicketRedemptionReceiptCreate((TicketDetail.TicketValue / 100), "", TicketString, 0, ref ReceiptDetail);//HFXVHTicket.CurrentPayoutID); CommonUtilities oCommonUtilities = new CommonUtilities(); if (OfflineTicketRedemption) oCommonUtilities.GetCommonValues(TicketDetail, ReceiptDetail, "OFFLINE VOUCHER REDEMPTION"); else oCommonUtilities.GetCommonValues(TicketDetail, ReceiptDetail); BMC.Common.LogManagement.LogManager.WriteLog("Done RTOnlineReceiptDetail", BMC.Common.LogManagement.LogManager.enumLogLevel.Debug); } } return TicketDetail; } catch (Exception ex) { ExceptionManager.Publish(ex); return TicketDetail; } }