示例#1
0
        public List <Card> RetrieveUserCardsByTerminal(Card card)
        {
            List <Card> ListCards    = CrudFactory.RetrieveUserCardsByTerminal <Card>(card);
            var         User         = new User();
            var         cardType     = new CardType();
            var         Terminal     = new Terminal();
            var         location     = new Location();
            var         LocationCrud = new LocationCrud();

            foreach (Card c in ListCards)
            {
                CrudFactory.UpdateStatus(c);
                User.IdUser         = c.User.IdUser;
                cardType.IdCardType = c.CrType.IdCardType;
                Terminal.IdTerminal = c.Terminal.IdTerminal;
                c.User              = UCrud.Retrieve <User>(User);
                c.CrType            = CtCrud.RetrieveById <CardType>(cardType);
                c.Terminal          = TerminalCrud.Retrieve <Terminal>(Terminal);
                location.IdLocation = c.Terminal.Location.IdLocation;
                c.Terminal.Location = LocationCrud.Retrieve <Location>(location);
                StatusToStatusString(c);
            }
            checkSentEmail(ListCards);
            return(ListCards);
        }
        public Location RetrieveById(Location location)
        {
            Location be = null;

            try
            {
                be = CrudFactory.Retrieve <Location>(location);
                if (be == null)
                {
                    // Location Not Found.
                    throw new BusinessException(23);
                }
            }
            catch (Exception ex)
            {
                ExceptionManager.GetInstance().Process(ex);
            }

            return(be);
        }
        private Terminal BuildLocation(Terminal pTerminal)
        {
            Location loc = null;

            loc = LocCRUD.Retrieve <Location>(pTerminal.Location);

            if (loc != null)
            {
                pTerminal.Location = loc;
            }
            else
            {
                // Location Not Found.
                throw new BusinessException(23);
            }

            return(pTerminal);
        }
示例#4
0
        public List <Card> RetrieveStudiant(Card card)
        {
            List <Card> ListCards    = CrudFactory.RetrieveStudiant <Card>(card);
            var         User         = new User();
            var         cardType     = new CardType();
            var         Terminal     = new Terminal();
            var         location     = new Location();
            var         LocationCrud = new LocationCrud();

            foreach (Card c in ListCards)
            {
                User.IdUser         = c.User.IdUser;
                cardType.IdCardType = c.CrType.IdCardType;
                Terminal.IdTerminal = c.Terminal.IdTerminal;
                c.User              = UCrud.Retrieve <User>(User);
                c.CrType            = CtCrud.RetrieveById <CardType>(cardType);
                c.Terminal          = TerminalCrud.Retrieve <Terminal>(Terminal);
                location.IdLocation = c.Terminal.Location.IdLocation;
                c.Terminal.Location = LocationCrud.Retrieve <Location>(location);
            }
            return(ListCards);
        }