示例#1
0
 public PersonModel(IPersonInfo info)
 {
     _personId        = info.PersonId;
     _phoneNumber     = info.PhoneNumber;
     _skypeNumber     = info.SkypeNumber;
     _currentLocation = info.CurrentLocation;
 }
示例#2
0
        public ActionResult Authenticate(IPersonInfo info)
        {
            DriverInfo driverInfo = info as DriverInfo;

            if (driverInfo != null)
            {
                ActionResult addResult = _extender.Storage.AddDriver(driverInfo);
                if (!addResult.IsValid)
                {
                    return(addResult);
                }
                _drivers.ModifyCollection(col => col.Add(driverInfo));
                return(ActionResult.ValidResult);
            }
            PedestrianInfo pedestrianInfo = info as PedestrianInfo;

            if (pedestrianInfo != null)
            {
                ActionResult addResult = _extender.Storage.AddPedestrian(pedestrianInfo);
                if (!addResult.IsValid)
                {
                    return(addResult);
                }
                _pedestrians.ModifyCollection(col => col.Add(pedestrianInfo));
                return(ActionResult.ValidResult);
            }
            return(ActionResult.GetErrorResult(new NotSupportedException()));
        }
 protected override ProfileLogic CreateProfileLogic(IPersonInfo personInfo)
 {
     return(new PedestrianProfileLogic(new PedestrianProfileModel(_city.Model.Map)
     {
         SkypeNumber = personInfo.SkypeNumber,
         PhoneNumber = personInfo.PhoneNumber
     }, _adaptersExtender, _city));
 }
示例#4
0
 public void Populate(IPersonInfo personInfo)
 {
     if (personInfo != null)
     {
         this.FName = personInfo.FName;
         this.MName = personInfo.MName;
         this.LName = personInfo.LName;
         this.Dob = personInfo.Dob;
         this.Gender = personInfo.Gender;
         this.DateOfBirthString = personInfo.DateOfBirthString;
     }
 }
示例#5
0
 public void Populate(IPersonInfo personInfo)
 {
     if (personInfo != null)
     {
         this.FName             = personInfo.FName;
         this.MName             = personInfo.MName;
         this.LName             = personInfo.LName;
         this.Dob               = personInfo.Dob;
         this.Gender            = personInfo.Gender;
         this.DateOfBirthString = personInfo.DateOfBirthString;
     }
 }
        protected override ProfileLogic CreateProfileLogic(IPersonInfo personInfo)
        {
            IDriverInfo driverInfo = (IDriverInfo)personInfo;

            return(new DriverProfileLogic(new DriverProfileModel(_city.Model.Map)
            {
                SkypeNumber = personInfo.SkypeNumber,
                PhoneNumber = personInfo.PhoneNumber,
                PersonName = driverInfo.PersonName,
                CarColor = driverInfo.CarColor,
                CarBrand = driverInfo.CarBrand,
                CarNumber = driverInfo.CarNumber
            }, _adaptersExtender, _city));
        }
        private PersonAccountDA GetPersonAccount(IPersonInfo personInfo)
        {
            PersonAccountDA account = _dataProxy.Session.CreateCriteria <PersonAccountDA>().List <PersonAccountDA>().FirstOrDefault(p => p.Id == personInfo.Id);

            if (account == null)
            {
                account = new PersonAccountDA
                {
                    Id          = personInfo.Id,
                    PhoneNumber = personInfo.PhoneNumber,
                    SkypeNumber = personInfo.SkypeNumber
                };
                _dataProxy.Session.Save(account);
            }
            return(account);
        }
示例#8
0
 private PersonLogic CreatePersonsLogic(IPersonInfo personSLO)
 {
     if (personSLO is IPedestrianInfo)
     {
         return(new PedestrianLogic(new PedestrianModel((IPedestrianInfo)personSLO)
         {
             PersonId = personSLO.PersonId
         }, _adaptersExtender, this));
     }
     if (personSLO is IDriverInfo)
     {
         return(new DriverLogic(new DriverModel((IDriverInfo)personSLO)
         {
             PersonId = personSLO.PersonId
         }, _adaptersExtender, this));
     }
     else
     {
         throw new NotImplementedException();
     }
 }
示例#9
0
 public PersonInfo(IPersonInfo personInfo)
 {
     this.Populate(personInfo);
 }
示例#10
0
 public PersonInfo(IPersonInfo personInfo)
 {
     this.Populate(personInfo);
 }
示例#11
0
 protected abstract ProfileLogic CreateProfileLogic(IPersonInfo personInfo);
示例#12
0
 private bool ComparePersonsInfo(PersonLogic logic, IPersonInfo slo)
 {
     return(logic.PersonModel.PersonId == slo.PersonId);
 }
 public PersonInfoEventArgs(IPersonInfo pInfo)
 {
     PersonInfo = pInfo;
 }
示例#14
0
 public CachedPersonInfo(IPersonInfo next)
 {
     cacheDir = MethodInfo.GetCurrentMethod().DeclaringType.GetProgramDataDirectory()
                .EnsureDirectoryExists();
     Next = next;
 }
 public int CompareTo(IPersonInfo other)
 {
     return string.Compare(this.Name.ToLowerInvariant(), other.Name.ToLowerInvariant(), StringComparison.Ordinal);
 }
 public static QArgs GetQArgsForPersonEmails(IPersonInfo person, string roles)
 {
     QAccountCond accountCond = new QAccountCond(from id in person.GetEmailIds() select new QAccountCond.QAccount(id, roles));
     QArgs args = new QArgs(accountCond);
     return args;
 }