Exemple #1
0
 public DriverResponseLogic(DriverResponseModel model, AdaptersExtender adaptersExtender, PedestrianProfileRequestLogic request, DriverLogic responseAuthor)
 {
     _model            = model;
     _adaptersExtender = adaptersExtender;
     _request          = request;
     _responseAuthor   = responseAuthor;
     adaptersExtender.ServicesFactory.GetCurrentDataService().DriverResponseChanged += DriverResponseLogic_DriverResponseChanged;
 }
Exemple #2
0
        public PedestrianProfileRequestLogic InitRequest(DriverModel driver)
        {
            DriverLogic driverLogic = _drivers.Items.SingleOrDefault(d => d.Model == driver);

            if (driverLogic == null)
            {
                return(null);
            }
            PedestrianProfileRequestModel requestModel = new PedestrianProfileRequestModel(_model, driverLogic.Model);

            _model.ModifyRequestsCollection(col => col.Add(requestModel));
            PedestrianProfileRequestLogic outResult = new PedestrianProfileRequestLogic(requestModel, _adaptersExtender, this);

            outResult.Response = new DriverResponseLogic(requestModel.Response, _adaptersExtender, outResult, driverLogic);
            return(outResult);
        }
Exemple #3
0
        private PedestrianProfileRequestLogic CreateRequestLogic(IPedestrianRequest requestSLO)
        {
            DriverLogic driver = _city.Persons.OfType <DriverLogic>().SingleOrDefault(d => d.Model.PersonId == requestSLO.DriverId);

            if (driver == null)
            {
                return(null);
            }
            PedestrianProfileRequestLogic outResult = new PedestrianProfileRequestLogic(new PedestrianProfileRequestModel(_model, driver.Model)
            {
                RequestId = requestSLO.Id,
                Comment   = requestSLO.Comment
            }, _adaptersExtender, this);

            outResult.Response = new DriverResponseLogic(new DriverResponseModel(outResult.Model, driver.Model), _adaptersExtender, outResult, driver);
            return(outResult);
        }
Exemple #4
0
 private bool CompareDriversInfo(DriverLogic logic, IDriverInfo slo)
 {
     return(logic.Model.PersonId == slo.PersonId);
 }