public PersonModel(IPersonInfo info) { _personId = info.PersonId; _phoneNumber = info.PhoneNumber; _skypeNumber = info.SkypeNumber; _currentLocation = info.CurrentLocation; }
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)); }
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); }
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(); } }
public PersonInfo(IPersonInfo personInfo) { this.Populate(personInfo); }
protected abstract ProfileLogic CreateProfileLogic(IPersonInfo personInfo);
private bool ComparePersonsInfo(PersonLogic logic, IPersonInfo slo) { return(logic.PersonModel.PersonId == slo.PersonId); }
public PersonInfoEventArgs(IPersonInfo pInfo) { PersonInfo = pInfo; }
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; }