public static Card RetrieveCard(string pan, string expiryDate, string CardTableName)
        {
            Card cardCrit = new Card()
            {
                pan = pan, expiry_date = expiryDate
            };
            IList <Card> result = new PrimeUtility.BaseDAO.CustomCoreDAO(ProcessorType.PostCard_MSSQL).Retrieve <Card>(cardCrit, CardTableName);

            if (result != null && result.Count > 0)
            {
                Card theCard = result.OrderByDescending(x => Convert.ToInt32(x.expiry_date)).First();
                return(theCard);
            }
            return(null);
        }
        public static Card GetCardFromPostCard(string pan, string CardTableName)
        {
            Card cardCrit = new Card()
            {
                pan = pan
            };

            IList <Card> _cards = new PrimeUtility.BaseDAO.CustomCoreDAO(ProcessorType.PostCard_MSSQL).Retrieve <Card>(cardCrit, CardTableName);

            if (_cards == null)
            {
                throw new ApplicationException(string.Format("Invalid card PAN {0}", MaskPan(pan)));
            }
            Card theCard = _cards.OrderByDescending(x => Convert.ToInt32(x.expiry_date)).First();

            if (theCard == null)
            {
                throw new ApplicationException("Inactive Card");
            }
            return(theCard);
        }
        public static Card RetrieveCard(string pan, string expiryDate)
        {
            // Do a card check on PostCard to ensure that the card exists
            Card cardCrit = new Card()
            {
                pan = pan, expiry_date = expiryDate
            };
            string query = string.Format(PrimeUtility.Configuration.ConfigurationManager.GetCardQuery, pan, expiryDate);

            new PANE.ERRORLOG.Error().LogInfo("Conn String: " + PrimeUtility.Configuration.ConfigurationManager.GetConString);
            new PANE.ERRORLOG.Error().LogInfo("Card Query: " + query);
            IList <Card> _cards = new PrimeUtility.BaseDAO.CustomCoreDAO(ProcessorType.PostCard_MSSQL).RetrieveList <Card>(query);

            //IList<Card> _cards = new PostCardEntitySystem().RetrieveCard(pan, null); // HINT.UFO: PostCardEntities
            if (_cards == null)
            {
                throw new ApplicationException(string.Format("Invalid Card PAN {0}", MaskPan(pan)));
            }
            Card theCard = _cards.OrderByDescending(x => Convert.ToInt32(x.expiry_date)).First();

            //if (theCard == null) throw new POSMessageProcessingException("In-active card");
            return(theCard);
        }