Пример #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;
 }
Пример #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);
        }
Пример #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);
        }
Пример #4
0
 private bool CompareRequestsInfo(PedestrianProfileRequestLogic logic, IPedestrianRequest slo)
 {
     return(logic.Model.RequestId == slo.Id);
 }