public BladesOfSteelMainGameClass(IGamePackageResolver mainContainer, IEventAggregator aggregator, BasicData basicData, TestOptions test, BladesOfSteelVMData currentMod, IMultiplayerSaveState state, IAsyncDelayer delay, ICardInfo <RegularSimpleCard> cardInfo, CommandContainer command, BladesOfSteelGameContainer gameContainer, IFaceoffProcesses processes, ComputerAI ai, BladesOfSteelScreenDelegates delegates ) : base(mainContainer, aggregator, basicData, test, currentMod, state, delay, cardInfo, command, gameContainer) { _model = currentMod; _command = command; _gameContainer = gameContainer; _processes = processes; _ai = ai; _delegates = delegates; _gameContainer.GetAttackStage = GetAttackStage; _gameContainer.GetDefenseStage = GetDefenseStage; }
void RefreshGlobalCardUINow() { if (pokerGamePlayData.globalCards.Count == 0) { return; } ICardInfo _cardInfo = null; PanelCardDetailController _card = null; Vector3 _pos = Vector3.zero; for (int i = 0; i < pokerGamePlayData.globalCards.Count; i++) { _cardInfo = Poker_GamePlay_Manager.instance.GetCardInfo(pokerGamePlayData.globalCards[i]); if (_cardInfo == null) { #if TEST Debug.LogError("_cardInfo is NULL : " + pokerGamePlayData.globalCards[i]); #endif continue; } _pos = placeHolder_GlobalCards_Catched[globalCardsPoolManager.listObjects.Count].position; _card = LeanPool.Spawn(cardPrefab, Vector3.zero, Quaternion.identity, Poker_GamePlay_Manager.instance.panelCardContainer).GetComponent <PanelCardDetailController>(); _card.transform.position = _pos; _card.ResizeAgain(Poker_GamePlay_Manager.instance.sizeCard.x, Poker_GamePlay_Manager.instance.sizeCard.y); _card.ShowNow(_cardInfo); globalCardsPoolManager.AddObject(_card); } }
public RookMainGameClass(IGamePackageResolver mainContainer, IEventAggregator aggregator, BasicData basicData, TestOptions test, RookVMData currentMod, IMultiplayerSaveState state, IAsyncDelayer delay, ICardInfo <RookCardInformation> cardInfo, CommandContainer command, RookGameContainer gameContainer, ITrickData trickData, ITrickPlay trickPlay, IAdvancedTrickProcesses aTrick, IBidProcesses bidProcesses, ITrumpProcesses trumpProcesses, INestProcesses nestProcesses ) : base(mainContainer, aggregator, basicData, test, currentMod, state, delay, cardInfo, command, gameContainer, trickData, trickPlay) { _model = currentMod; _command = command; _gameContainer = gameContainer; _aTrick = aTrick; _bidProcesses = bidProcesses; _trumpProcesses = trumpProcesses; _nestProcesses = nestProcesses; _gameContainer.StartNewTrickAsync = StartNewTrickAsync; _gameContainer.StartingStatus = (() => this.StartingStatus()); }
public RageCardGameMainGameClass(IGamePackageResolver mainContainer, IEventAggregator aggregator, BasicData basicData, TestOptions test, RageCardGameVMData currentMod, IMultiplayerSaveState state, IAsyncDelayer delay, ICardInfo <RageCardGameCardInformation> cardInfo, CommandContainer command, RageCardGameGameContainer gameContainer, ITrickData trickData, ITrickPlay trickPlay, IAdvancedTrickProcesses aTrick, IColorProcesses colorProcesses, IBidProcesses bidProcesses, RageDelgates delgates ) : base(mainContainer, aggregator, basicData, test, currentMod, state, delay, cardInfo, command, gameContainer, trickData, trickPlay) { _model = currentMod; _command = command; _gameContainer = gameContainer; _aTrick = aTrick; _colorProcesses = colorProcesses; _bidProcesses = bidProcesses; _delgates = delgates; delgates.CardsToPassOut = (() => SaveRoot.CardsToPassOut); }
/// <summary> /// Find card type for specific card info from database. /// </summary> /// <param name="cardInfo">The card info (may be null)</param> /// <param name="allowCancel">if set to <c>true</c> [allow cancel].</param> /// <param name="exclusionList">The list of card types to exlcude from search.</param> public void GetCardType(ref ICardInfo cardInfo, bool allowCancel, IEnumerable <CardTypes> exclusionList) { if (cardInfo == null) { throw new ArgumentNullException("cardInfo"); } if (cardInfo.CardType == CardTypes.Unknown) { Nullable <CardTypes> types = null; GetAllCardTypes(types); ICardInfo correctCardType = FindCorrectCardType(cardInfo, allowCancel, exclusionList); if (correctCardType != null) { correctCardType.CardNumber = cardInfo.CardNumber; correctCardType.Track1 = cardInfo.Track1; correctCardType.Track2 = cardInfo.Track2; correctCardType.Track3 = cardInfo.Track3; correctCardType.Track4 = cardInfo.Track4; correctCardType.ExpDate = cardInfo.ExpDate; correctCardType.CardEntryType = cardInfo.CardEntryType; correctCardType.Address = cardInfo.Address; correctCardType.ZipCode = cardInfo.ZipCode; correctCardType.SecurityCode = cardInfo.SecurityCode; correctCardType.AuthCode = cardInfo.AuthCode; cardInfo = correctCardType; } } }
public async Task UpdateButtonInfo(ICardInfo cardInfo) { if (string.IsNullOrEmpty(cardInfo.Name)) { await Clear(); } else { if (_currentCardInfo != null) { if (_currentCardInfo.CardButtonType == cardInfo.CardButtonType && _currentCardInfo.Name == cardInfo.Name && _currentCardInfo.IsToggled == cardInfo.IsToggled) { return; } } _currentCardInfo = cardInfo; if (cardInfo.ImageAvailable && !ImageUtils.ImageCache.ContainsKey(cardInfo.Name)) { await GetButtonImage(); } await SetTitleAsync(TextUtils.WrapTitle(cardInfo.Name)); await SetImageAsync(cardInfo.AsImage()); } }
public void GenerateFilling(ICardInfo cardInfo) { // Random number from 1 to 90. If this number is correct (there is no other same number and // after replacement in the card the card is correct) repeat as many times, as max numbers can be in card int totalNumbersCount = 0; var rnd = new Random(); while (totalNumbersCount < cardInfo.MaxInCard) { var randomNumber = rnd.Next(1, 90); // Finding column var tmpColumn = randomNumber / 10; // Checking if there no other same number and checkin max number in column if (CheckInsertIntoColumn(cardInfo, tmpColumn, randomNumber)) { //Getting row, where filled not max number in row var tmpRow = GetNotFullFilledRow(cardInfo, tmpColumn); if (tmpRow != -1) { Numbers[tmpRow, tmpColumn] = randomNumber; totalNumbersCount++; } } } }
public SkuckCardGameMainGameClass(IGamePackageResolver mainContainer, IEventAggregator aggregator, BasicData basicData, TestOptions test, SkuckCardGameVMData currentMod, IMultiplayerSaveState state, IAsyncDelayer delay, ICardInfo <SkuckCardGameCardInformation> cardInfo, CommandContainer command, SkuckCardGameGameContainer gameContainer, ITrickData trickData, ITrickPlay trickPlay, IAdvancedTrickProcesses aTrick, IBidProcesses bidProcesses, IPlayChoiceProcesses choiceProcesses, ITrumpProcesses trumpProcesses ) : base(mainContainer, aggregator, basicData, test, currentMod, state, delay, cardInfo, command, gameContainer, trickData, trickPlay) { _model = currentMod; _command = command; _gameContainer = gameContainer; _aTrick = aTrick; _bidProcesses = bidProcesses; _choiceProcesses = choiceProcesses; _trumpProcesses = trumpProcesses; _gameContainer.ComputerTurnAsync = ComputerTurnAsync; _gameContainer.StartNewTrickAsync = StartNewTrickAsync; _gameContainer.ShowHumanCanPlayAsync = ShowHumanCanPlayAsync; }
public void UpdateDynamicActionInfo(IButtonContext buttonContex, ICardInfo cardInfo) { DynamicActionInfo dynamicActionInfo; lock (_cacheLock) { dynamicActionInfo = _dynamicActionInfoList.FirstOrDefaultWithContext(buttonContex); if (dynamicActionInfo != null) { if (!dynamicActionInfo.CardInfoHasChanged(cardInfo)) { return; } dynamicActionInfo.UpdateFromCardInfo(cardInfo); } } if (dynamicActionInfo == null) { AddDynamicActionInfo(buttonContex, cardInfo); } else { PublishChangeEventsForChangedActions(dynamicActionInfo); } }
public static Instruction BuyActionCard(IGame game, Player player) { if (!player.CanBuy()) { return(null); } var random = new Random(); int coinCount = player.CoinCountThisRound; IList <ICardInfo> availableCards = new List <ICardInfo>(); foreach (var cardInfo in game.GameInfo.ActionCards.Values) { if (coinCount >= cardInfo.Cost) { availableCards.Add(cardInfo); } } if (availableCards.Count > 0) { ICardInfo pickedActionInfo = availableCards[random.Next(0, availableCards.Count - 1)]; if (CanBuyCard(game, pickedActionInfo.CardName)) { return(GenerateBuyInstruction(pickedActionInfo.CardName)); } } return(null); }
/// <summary> /// Checking if we can insert number in choosed column /// </summary> /// <param name="cardInfo">Info about card</param> /// <param name="columnNumber">Column, where we want insert number</param> /// <param name="number">Inserting number</param> /// <returns>True, if we can insert</returns> private bool CheckInsertIntoColumn(ICardInfo cardInfo, int columnNumber, int number) { if (columnNumber > cardInfo.RowsNumber) { columnNumber = cardInfo.RowsNumber; } var countFilledNumbers = 0; for (int i = 0; i < cardInfo.RowsNumber; i++) { if (Numbers[i, columnNumber] == number) { return(false); } if (Numbers[i, columnNumber] != 0) { countFilledNumbers++; } } if (countFilledNumbers < cardInfo.MaxInColumn) { return(true); } return(false); }
public frmCard(ICardInfo cardinfo, bool getAmountOnly) : this() { this.localCardInfo = cardinfo; this.getAmountOnly = getAmountOnly; // When the form opens, CardInfo.Amount represents the current balance due on the transaction // The rounding will get rid of trailing 0.0000000's AmountDue.Text = EFT.InternalApplication.Services.Rounding.Round(localCardInfo.Amount, true); // true to show currency symbol AmountPaid.Text = EFT.InternalApplication.Services.Rounding.Round(localCardInfo.Amount, false); if (getAmountOnly) { //Card was swiped to open the window - disable certain fields and mask the credit card number cardNumber.Text = EFT.InternalApplication.BusinessLogic.Utility.MaskCardNumber(localCardInfo.CardNumber); expDate.Text = localCardInfo.ExpDate; expDate.Enabled = false; cardNumber.Enabled = false; } // Setup our local event handler for card swipe. Really only needed because we don't want the user to swipe when the window // is open. They should swipe the card from the main POS form which will open our window (with "getAmountOnly") EFT.InternalApplication.Services.Peripherals.MSR.MSRMessageEvent -= new MSRMessageEventHandler(this.MSR_MSRMessageEvent); EFT.InternalApplication.Services.Peripherals.MSR.MSRMessageEvent += new MSRMessageEventHandler(this.MSR_MSRMessageEvent); EFT.InternalApplication.Services.Peripherals.MSR.EnableForSwipe(); //Need to enable to handle the swipe on our window. }
public Card[] GetCards(ICardInfo cardInfo, int count) { if (cardInfo == null) { throw new ArgumentNullException("cardInfo"); } if (count <= 0) { throw new ArgumentOutOfRangeException("count", "Must be positive"); } CardPile cardPile; if (!cardPiles.TryGetValue(cardInfo.CardName, out cardPile)) { return(new Card[0]); } count = cardPile.RemoveCards(count); var cards = new Card[count]; for (int i = 0; i < count; i++) { cards[i] = new Card(cardInfo); } return(cards); }
public XactikaMainGameClass(IGamePackageResolver mainContainer, IEventAggregator aggregator, BasicData basicData, TestOptions test, XactikaVMData currentMod, IMultiplayerSaveState state, IAsyncDelayer delay, ICardInfo <XactikaCardInformation> cardInfo, CommandContainer command, XactikaGameContainer gameContainer, ITrickData trickData, ITrickPlay trickPlay, IAdvancedTrickProcesses aTrick, IBidProcesses bidProcesses, IShapeProcesses shapeProcesses, IModeProcesses modeProcesses ) : base(mainContainer, aggregator, basicData, test, currentMod, state, delay, cardInfo, command, gameContainer, trickData, trickPlay) { _model = currentMod; _command = command; _gameContainer = gameContainer; _aTrick = aTrick; _bidProcesses = bidProcesses; _shapeProcesses = shapeProcesses; _modeProcesses = modeProcesses; _gameContainer.StartNewTrickAsync = StartNewTrickAsync; _gameContainer.ShowHumanCanPlayAsync = ShowHumanCanPlayAsync; _gameContainer.ShowTurn = (() => this.ShowTurn()); }
IEnumerator DoActionDealGlobalCard(List <sbyte> _valueCards) { List <ICardInfo> _tmpListCardInfo = new List <ICardInfo>(); ICardInfo _cardInfo = null; List <PanelCardDetailController> _tmpListCard = new List <PanelCardDetailController>(); PanelCardDetailController _card = null; for (int i = 0; i < _valueCards.Count; i++) { _cardInfo = Poker_GamePlay_Manager.instance.GetCardInfo(_valueCards[i]); if (_cardInfo == null) { #if TEST Debug.LogError("_cardInfo is NULL : " + _valueCards[i]); #endif continue; } _tmpListCardInfo.Add(_cardInfo); _card = LeanPool.Spawn(cardPrefab, Vector3.zero, Quaternion.identity, Poker_GamePlay_Manager.instance.panelCardContainer).GetComponent <PanelCardDetailController>(); _card.transform.position = placeHolder_SpawnCard_Catched.position; _card.ResizeAgain(Poker_GamePlay_Manager.instance.sizeCard.x, Poker_GamePlay_Manager.instance.sizeCard.y); _tmpListCard.Add(_card); } yield return(Yielders.Get(0.1f)); for (int i = 0; i < _tmpListCard.Count; i++) { CoroutineChain.Start .Sequential(_tmpListCard[i].Move(placeHolder_GlobalCards_Catched[globalCardsPoolManager.listObjects.Count].position, 0.1f, LeanTweenType.easeOutSine, Poker_GamePlay_Manager.instance.CanPlayMusicAndSfx() ? Poker_GamePlay_Manager.instance.myAudioInfo.sfx_DealCard : null) , _tmpListCard[i].Show(_tmpListCardInfo[i])); globalCardsPoolManager.AddObject((MySimplePoolObjectController)_tmpListCard[i]); yield return(Yielders.Get(0.1f)); } }
IEnumerator DoActionDealPlayerCard(Poker_PlayerGroup _playerGroup) { List <PanelCardDetailController> _tmpListCard = new List <PanelCardDetailController>(); PanelCardDetailController _card = null; for (int i = 0; i < 2; i++) { _card = LeanPool.Spawn(cardPrefab, Vector3.zero, Quaternion.identity, Poker_GamePlay_Manager.instance.panelCardContainer).GetComponent <PanelCardDetailController>(); _card.transform.position = placeHolder_SpawnCard_Catched.position; _card.ResizeAgain(Poker_GamePlay_Manager.instance.sizeCard.x, Poker_GamePlay_Manager.instance.sizeCard.y); _tmpListCard.Add(_card); } yield return(Yielders.Get(0.1f)); for (int i = 0; i < _tmpListCard.Count; i++) { if (!_playerGroup.isMe) { if (Poker_GamePlay_Manager.instance.CanPlayMusicAndSfx()) { MyAudioManager.instance.PlaySfx(Poker_GamePlay_Manager.instance.myAudioInfo.sfx_DealCard); } CoroutineChain.Start .Parallel(_tmpListCard[i].Move(_playerGroup.cardCoverHoldersCatched[i].position, 0.1f, LeanTweenType.easeOutSine) , _tmpListCard[i].Rotate(_playerGroup.cardCoverHoldersCatched[i].rotation.eulerAngles, 0.1f) , _tmpListCard[i].ScaleTo(_playerGroup.cardCoverHoldersCatched[i].localScale, 0.1f, LeanTweenType.notUsed)); } else { ICardInfo _cardInfo = null; for (int j = 0; j < pokerGamePlayData.listPlayerPlayingData.Count; j++) { if (pokerGamePlayData.listPlayerPlayingData[j].isMe && pokerGamePlayData.listPlayerPlayingData[j].userData.IsEqual(_playerGroup.userData)) { _cardInfo = Poker_GamePlay_Manager.instance.GetCardInfo(pokerGamePlayData.listPlayerPlayingData[j].ownCards[i]); if (_cardInfo == null) { #if TEST Debug.LogError("_cardInfo is NULL : " + pokerGamePlayData.listPlayerPlayingData[j].ownCards[i]); #endif continue; } break; } } CoroutineChain.Start .Parallel(_tmpListCard[i].Move(_playerGroup.ownCardHoldersCatched[i].position, 0.1f, LeanTweenType.easeOutSine , Poker_GamePlay_Manager.instance.CanPlayMusicAndSfx() ? Poker_GamePlay_Manager.instance.myAudioInfo.sfx_DealCard : null) , _tmpListCard[i].Rotate(_playerGroup.ownCardHoldersCatched[i].rotation.eulerAngles, 0.1f) , _tmpListCard[i].ScaleTo(_playerGroup.ownCardHoldersCatched[i].localScale, 0.1f, LeanTweenType.notUsed)) .Sequential(_tmpListCard[i].Show(_cardInfo)); } _playerGroup.ownCardPoolManager.AddObject(_tmpListCard[i]); yield return(Yielders.Get(0.1f)); } }
/// <summary> /// Gets the card information and amount for the specific card. /// </summary> /// <param name="cardInfo">Card information</param> /// <returns>True if the system should continue with the authorization process and false otherwise.</returns> public bool GetCardInfoAndAmount(ref ICardInfo cardInfo) { // Show UI. Input Card number, Amount, etc. //cardInfo.CardType = CardTypes.InternationalCreditCard; //cardInfo.CardNumber = "1234-5678-9012-3456"; //cardInfo.ExpDate = "05/10"; //cardInfo.CardReady = true; //return cardInfo.CardReady; // We have access to all information from the EFT section of the current Hardware Profile // For instance, set "IsTestMode" based on the TestMode checkbox. Can also get things // like the provider Server Name, UserID, Password, etc. cardInfo.IsTestMode = LSRetailPosis.Settings.HardwareProfiles.EFT.TestMode == 1 ? true : false; //Other useful settings are in LSRetailPosis.Settings.ApplicationSettings.Terminal. Examples: // LSRetailPosis.Settings.ApplicationSettings.Terminal.StoreCurrency // LSRetailPosis.Settings.ApplicationSettings.Terminal.TerminalOperator.OperatorId // If the card info is already known from a magnetic swipe, we only need to get the Amount from the window bool getAmountOnly = (cardInfo.CardEntryType == CardEntryTypes.MAGNETIC_STRIPE_READ); // Need to gather information needed to process the payment. This can be done interactively with a window // or by interacting with another device (pinpad, signature capture, etc.). Note that if a card is swiped // from the main window, and OPOS event will be fired which will call this method. if (cardInfo.CardType == CardTypes.InternationalDebitCard) { // We know that the card was swiped and matched a Debit Card // TODO: Use the frmCard as a basis for a Debit Card window } else { // We either know the card was swiped and matched a Credit Card or the Card Payment // button was pressed and we need to manually type in a card number. using (frmCard cardDialog = new frmCard(cardInfo, getAmountOnly)) { POSFormsManager.ShowPOSForm(cardDialog); // Display the window if (getAmountOnly) { //We only want to grab the amount from the window since all other card information was read from the swipe cardInfo.Amount = cardDialog.amountPaid; } else { //Otherwise, we we want to set the cardInfo object to the local version from the window cardInfo = cardDialog.CardInfo; } cardInfo.CardReady = cardDialog.everythingValid; // Pull the valid flag from the window sEFTApprovalCode = cardDialog.sApprovalCode; sCExpMonth = cardDialog.sCardExpMonth; sCExpYear = cardDialog.sCardExpYear; } } // Need to return a true or false for whether everything validated and we can proceed. CardReady // property has this information so return that. return(cardInfo.CardReady); }
/// <summary> /// Identifies the card if a match with pre-configured card types in not found by the application. /// </summary> /// <param name="cardInfo">Reference to an EftInfo object.</param> /// <param name="eftInfo">Reference to an eftInfo object.</param> public void IdentifyCard(ref ICardInfo cardInfo, ref IEFTInfo eftInfo) { //if (cardInfo != null) //{ // cardInfo.CardType = CardTypes.Unknown; //} if (cardInfo != null) { // This API is exposed for ISVs to identify card types not known internally. // // Normally, the card type should be determined by matching a number mask set up // in AX for Retail Headquarters. However, if there are other means to // identify a card, create the logic here and set the TenderTypeID property. // The TenderTypeID should match a CARDID in the RETAILSTORETENDERTYPECARDTABLE table. cardInfo.CardType = CardTypes.Unknown; // InternationalCreditCard = 0, InternationalDebitCard = 1, etc. cardInfo.TenderTypeId = String.Empty; // At least one of the following two fields needs to be set. If cardInfo.CardTypeId has a value, it will be saved to // the CARDTYPEID column of the RetailTransactionPaymentTrans table. Otherwise, the eftInfo.IssuerNumber // will be saved there. If a NULL is saved to that table, there will be problems down the road. //cardInfo.CardTypeId = String.Empty; //eftInfo.IssuerNumber = string.Empty; } }
public void ProcessCardPayment(ICardInfo cardInfo, decimal amount, object posTransaction) { LogMessage("Processing payment", LSRetailPosis.LogTraceLevel.Trace, "CorporateCard.ProcessCardPayment"); this.iCardInfo = cardInfo; this.amountValue = this.Application.Services.Rounding.RoundAmount(amount, ApplicationSettings.Terminal.StoreId, cardInfo.TenderTypeId); retailTransaction = (RetailTransaction)posTransaction; decimal payableAmt = SetTenderRestrictions(retailTransaction, Convert.ToInt32(cardInfo.TenderTypeId), cardInfo.CardNumber, 24); payableAmt = this.Application.Services.Rounding.RoundAmount(payableAmt, ApplicationSettings.Terminal.StoreId, cardInfo.TenderTypeId); if (payableAmt > 0) { if (payableAmt < this.amountValue) { this.amountValue = payableAmt; } // Process the payment. ProcessCorporateCardPayment(); } }
public void AddDynamicActionInfo(IButtonContext buttonContex, ICardInfo cardInfo) { DynamicActionInfo changedAction; lock (_cacheLock) { var itemExistsAtLocation = _dynamicActionInfoList.FirstOrDefaultWithContext(buttonContex) != null; if (itemExistsAtLocation) { //make room for the item we are inserting by shifting the index of everything else up foreach (var dynamicActioninfo in _dynamicActionInfoList) { if (dynamicActioninfo.IsAtSameIndexOrAfter(buttonContex)) { dynamicActioninfo.Index++; } } } changedAction = new DynamicActionInfo(buttonContex); changedAction.UpdateFromCardInfo(cardInfo); _dynamicActionInfoList.Add(changedAction); } //we only have to change the one action that changed, as the handler is smart enough to refresh everything else around PublishChangeEventsForChangedActions(changedAction); }
public IEnumerator Show(ICardInfo _cardInfo, AudioClip _sfx = null) { if (currentState == State.Show) { yield break; } currentState = State.Show; float _saveX = transform.localScale.x; bool _isFinished = false; if (_sfx != null) { MyAudioManager.instance.PlaySfx(_sfx); } LeanTween.scaleX(gameObject, 0f, 0.1f).setOnComplete(() => { _isFinished = true; }); yield return(new WaitUntil(() => _isFinished)); ShowNow(_cardInfo); _isFinished = false; LeanTween.scaleX(gameObject, _saveX, 0.1f).setOnComplete(() => { _isFinished = true; }); yield return(new WaitUntil(() => _isFinished)); }
/// <summary> /// Returns true if add/update loyalty item to transaction is successfull. /// </summary> /// <param name="retailTransaction"></param> /// <param name="cardNumber"></param> /// <returns></returns> public bool AddLoyaltyRequest(IRetailTransaction retailTransaction, string cardNumber) { ICardInfo cardInfo = Utility.CreateCardInfo(); cardInfo.CardNumber = cardNumber; return(AddLoyaltyRequest(retailTransaction, cardInfo)); }
/// <summary> /// In the current implementation, this method includes another method that first retrieves the data of all cards available. /// Then it is for each retrieved card type it is tested whether the given cardnumber (with the length as stored in the database) /// is within the range: /// <code>foreach (ICardInfo cardInfo in cardTypes)(...)</code> /// If a valid number range has been found, the card number, the track2 data and the entering method are assigned to a CardInfo object /// i.e. 'correctCardType'. /// \POSProcesses\Operations\PayCard.Execute() will evaluate, whether it is an international credit cart, a debit card, /// a loyality card or a corporate card. An instance of PayCorporateCard is created and it's method RunOperation() called. /// (Further background: PayCard.cs is derived from TenderOperation.cs which is derived from Operation.cs.) /// \POSProcesses\Operations\PayCorporateCard.Execute() calls then the interface method of /// \ServiceInterfaces\CorporateCardInterface\ICorporateCard.cs. /// </summary> /// <param name="cardInfo">If not null, it contains all data, i.e. card number, card name, checkings data etc.</param> public void GetCardType(ref ICardInfo cardInfo) { if (cardInfo == null) { throw new ArgumentNullException("cardInfo"); } GetCardType(ref cardInfo, true, null); }
public Card(ICardInfo info) { if (info == null) { throw new ArgumentNullException("info"); } this.info = info; }
private void OnForm_KeyPress(object sender, KeyPressEventArgs e) { switch (e.KeyChar) { case (char)Keys.Enter: string keyboardScan = keyboardScanBuffer.ToString(); keyboardScanBuffer.Clear(); // IF scan is a MSR if ((keyboardScan.StartsWith(MSR.StartTrack, StringComparison.OrdinalIgnoreCase) || keyboardScan.StartsWith(MSR.StartTrack2, StringComparison.OrdinalIgnoreCase)) && (keyboardScan.EndsWith(MSR.EndTrack, StringComparison.OrdinalIgnoreCase))) { string[] tracks = MSR.SplitTrackData(keyboardScan); if (!string.IsNullOrWhiteSpace(tracks[1])) { ICardInfo cardInfo = PosApplication.Instance.BusinessLogic.Utility.CreateCardInfo(); // We just need card number from track 2 cardInfo.Track2 = tracks[1]; if (cardInfo.CardNumber.Length > 0) { IExtendedLogOnInfo extendedLogOnInfo = new DE.ExtendedLogOnInfo() { LogOnKey = cardInfo.CardNumber, LogOnType = ExtendedLogOnType.MagneticStripeReader, Message = ApplicationLocalizer.Language.Translate(99409) /*Card swipe accepted*/ }; HandleExtendedLogOnInfo(extendedLogOnInfo); } } } else // If not, treat it as barcode scan. { IExtendedLogOnInfo extendedLogOnInfo = new DE.ExtendedLogOnInfo() { LogOnKey = keyboardScan, LogOnType = ExtendedLogOnType.Barcode, Message = ApplicationLocalizer.Language.Translate(99408) /*Bar code accepted*/ }; HandleExtendedLogOnInfo(extendedLogOnInfo); } break; default: keyboardScanBuffer.Append(e.KeyChar); break; } e.Handled = true; }
void OnCardTypeClick(object sender, EventArgs e) { SimpleButtonEx b = sender as SimpleButtonEx; if (b != null) { this.SelectedCard = b.Tag as ICardInfo; this.DialogResult = DialogResult.OK; } }
public void CheckBai() { PokerGamePlayData.CheckResultCard(ownCards, globalCards, (_typeCard, _cardHightLight) => { string _tmp = ""; for (int i = 0; i < _cardHightLight.Count; i++) { ICardInfo _info = GetCardInfo(_cardHightLight[i]); _tmp += _info.cardType + "|"; } Debug.Log(">>> Type Card: " + _typeCard.ToString() + " : " + _tmp); }); }
private void OnMSR_DataReceived(ICardInfo cardInfo) { ExtendedLogOnInfo extendedLogOnInfo = new ExtendedLogOnInfo() { LogOnType = ExtendedLogOnType.MagneticStripeReader, LogOnKey = cardInfo.CardNumber, Message = ApplicationLocalizer.Language.Translate(99409), // Card swipe accepted. PasswordRequired = Functions.StaffCardLogOnRequiresPassword }; FireDataReceived(extendedLogOnInfo); }
/// <summary> /// Updates card payment details in the database as per given card information. /// </summary> /// <param name="cardInfo"></param> /// <param name="posTransaction"></param> public void VoidCardPayment(ICardInfo cardInfo, object posTransaction) { try { LogMessage("Voiding payment", LSRetailPosis.LogTraceLevel.Trace, "CorporateCard.VoidCardPayment"); } catch (Exception x) { LSRetailPosis.ApplicationExceptionHandler.HandleException(this.ToString(), x); throw; } }
private static IComparable GetColor(ICardInfo card) { if (MagicRules.IsLand(card.Type)) { return(DisplayColor.Land); } if (MagicRules.IsSpecial(card.Type)) { return(DisplayColor.Special); } return(MagicRules.GetDisplayColor(card.AllPartCastingCost)); }