Example #1
0
        public async Task Should_Load_AVehicleAndHelpersCorrectly()
        {
            using (var dbConnection = _sqlExecutor.OpenNewDbConnection())
            {
                if (dbConnection != null)
                {
                    var vehicleList = await dbConnection.GetPagedAsync <VEHICULO1>(1, 2).ConfigureAwait(false);

                    var vehicleValue = vehicleList.FirstOrDefault();
                    Assert.NotNull(vehicleValue);
                    var codeInt = vehicleValue.CODIINT;
                    if (!string.IsNullOrEmpty(codeInt))
                    {
                        var vehicle = await _vehicleDataServices.GetDoAsync(codeInt).ConfigureAwait(false);

                        Assert.IsTrue(vehicle.Valid);
                        Assert.NotNull(vehicle.BrandDtos);
                        Assert.Greater(vehicle.BrandDtos.Count(), 0);
                        Assert.Greater(vehicle.ModelDtos.Count(), 0);
                        Assert.Greater(vehicle.ColorDtos.Count(), 0);
                    }
                }
            }
        }
Example #2
0
        private async void OpenCurrentItem(object selectedItem)
        {
            if (selectedItem is VehicleSummaryViewObject summaryItem)
            {
                var idNameTuple = new Tuple <string, string>(summaryItem.Code, summaryItem.Brand);
                var tabName     = idNameTuple.Item1 + "." + idNameTuple.Item2;
                var agent       = await _vehicleDataServices.GetDoAsync(idNameTuple.Item1).ConfigureAwait(false);

                var navigationParameters = new NavigationParameters();
                navigationParameters.Add("id", idNameTuple.Item1);
                navigationParameters.Add(ScopedRegionNavigationContentLoader.DefaultViewName, tabName);
                var uri = new Uri(typeof(VehicleInfoView).FullName + navigationParameters, UriKind.Relative);
                //  _navigationService.NavigateAsync<MainPageviewModel>();
                _regionManager.RequestNavigate("TabRegion", uri);
                var currentPayload = BuildShowPayLoadDo(tabName, agent);
                currentPayload.PrimaryKeyValue = idNameTuple.Item1;
                currentPayload.Subsystem       = DataSubSystem.VehicleSubsystem;
                EventManager.NotifyObserverSubsystem(MasterModuleConstants.VehiclesSystemName, currentPayload);
                RegisterToolBar();
            }
        }