Exemplo n.º 1
0
        public PedestrianDataContract AuthenticateAsPedestrian(PedestrianAuthenticationRequestDataContract request)
        {
            IPedestrianInfo pedestrianInfo = _server.CreatePedestrianInfo();

            ConvertHelper.FillPedestrianAuthenticationRequestInfo(pedestrianInfo, request);
            _server.AuthenticateAsPedestrian(pedestrianInfo, request.CityId);
            return(ConvertHelper.CreatePedestrianDataContract(pedestrianInfo));
        }
Exemplo n.º 2
0
        public IEnumerable <IPedestrianInfo> EnumeratePedestrians(Guid cityId)
        {
            IList <PedestrianAccountDA> accounts    = _dataProxy.Session.CreateCriteria <PedestrianAccountDA>().List <PedestrianAccountDA>();
            IList <PedestrianInfoDA>    pedestrians = _dataProxy.Session.CreateCriteria <PedestrianInfoDA>() /*.Add(Restrictions.Where<PedestrianInfoDA>(p => p.PersonInfo.City.Id == cityId))*/.List <PedestrianInfoDA>();

            foreach (var info in accounts.Join(pedestrians, account => account.Person.Id, pedestrian => pedestrian.PersonInfo.Person.Id,
                                               (account, pedestrian) => new { AccountInfo = account, PedestrianInfo = pedestrian }).Where(i => i.PedestrianInfo.PersonInfo.City.Id == cityId).ToArray())
            {
                IPedestrianInfo pedesrtianInfo = _server.CreatePedestrianInfo(info.AccountInfo.Person.Id);
                pedesrtianInfo.PhoneNumber              = info.AccountInfo.Person.PhoneNumber;
                pedesrtianInfo.SkypeNumber              = info.AccountInfo.Person.SkypeNumber;
                pedesrtianInfo.CurrentLocationLatidude  = info.PedestrianInfo.PersonInfo.Latitude;
                pedesrtianInfo.CurrentLocationLongidude = info.PedestrianInfo.PersonInfo.Longitude;
                yield return(pedesrtianInfo);
            }
        }