Ejemplo n.º 1
0
        async public override void OnNavigatedTo(object navigationParameter, Windows.UI.Xaml.Navigation.NavigationMode navigationMode, Dictionary <string, object> viewModelState)
        {
            base.OnNavigatedTo(navigationParameter, navigationMode, viewModelState);
            _task = JsonConvert.DeserializeObject <Eqstra.BusinessLogic.Task>(navigationParameter.ToString());
            await GetCustomerDetailsAsync();

            LoadAppointments();
            var dd = await SqliteHelper.Storage.GetSingleRecordAsync <DrivingDuration>(x => x.VehicleInsRecID == _task.VehicleInsRecId);

            if (dd != null)
            {
                this.IsArrived         = dd.StopDateTime == DateTime.MinValue;
                this.IsStartInspection = !this.IsArrived;
            }
            else
            {
                this.IsStartDriving    = true;
                this.IsArrived         = false;
                this.IsStartInspection = false;
            }
            _eventAggregator.GetEvent <CustFetchedEvent>().Subscribe(async b =>
            {
                await GetCustomerDetailsAsync();
            });
        }
Ejemplo n.º 2
0
        async public override void OnNavigatedTo(object navigationParameter, Windows.UI.Xaml.Navigation.NavigationMode navigationMode, Dictionary <string, object> viewModelState)
        {
            try
            {
                base.OnNavigatedTo(navigationParameter, navigationMode, viewModelState);
                this.InspectionHistList = new ObservableCollection <InspectionHistory> {
                    new InspectionHistory {
                        InspectionResult = new List <string> {
                            "Engine and brake oil replacement", "Wheel alignment"
                        }, CustomerId = "1", InspectedBy = "Jon Tabor", InspectedOn = DateTime.Now
                    },
                    new InspectionHistory {
                        InspectionResult = new List <string> {
                            "Vehicle coolant replacement", "Few dent repairs"
                        }, CustomerId = "1", InspectedBy = "Robert Green", InspectedOn = DateTime.Now
                    },
                    new InspectionHistory {
                        InspectionResult = new List <string> {
                            "Vehicle is in perfect condition"
                        }, CustomerId = "1", InspectedBy = "Christopher", InspectedOn = DateTime.Now
                    },
                };
                _task    = JsonConvert.DeserializeObject <Eqstra.BusinessLogic.Task>(navigationParameter.ToString());
                App.Task = _task;
                StampPersistData.Instance.Task = _task;
                //var vt = await SqliteHelper.Storage.LoadTableAsync<Vehicle>();
                ApplicationData.Current.LocalSettings.Values["CaseNumber"] = _task.CaseNumber;
                LoadAppointments();
                await GetCustomerDetailsAsync();

                if (_task.VehicleType == BusinessLogic.Enums.VehicleTypeEnum.Passenger)
                {
                    this.InspectionUserControls.Add(new PVehicleDetailsUserControl());
                    this.InspectionUserControls.Add(new TrimIntUserControl());
                    this.InspectionUserControls.Add(new BodyworkUserControl());
                    this.InspectionUserControls.Add(new GlassUserControl());
                    this.InspectionUserControls.Add(new AccessoriesUserControl());
                    this.InspectionUserControls.Add(new TyreConditionUserControl());
                    this.InspectionUserControls.Add(new MechanicalCondUserControl());
                    this.InspectionUserControls.Add(new InspectionProofUserControl());
                }
                else if (_task.VehicleType == BusinessLogic.Enums.VehicleTypeEnum.Commercial)
                {
                    this.InspectionUserControls.Add(new CVehicleDetailsUserControl());
                    this.InspectionUserControls.Add(new CabTrimInterUserControl());
                    this.InspectionUserControls.Add(new ChassisBodyUserControl());
                    this.InspectionUserControls.Add(new CGlassUserControl());
                    this.InspectionUserControls.Add(new CAccessoriesUserControl());
                    this.InspectionUserControls.Add(new CTyresUserControl());
                    this.InspectionUserControls.Add(new CMechanicalCondUserControl());
                    this.InspectionUserControls.Add(new CPOIUserControl());
                }
                else
                {
                    this.InspectionUserControls.Add(new TVehicleDetailsUserControl());
                    this.InspectionUserControls.Add(new TAccessoriesUserControl());
                    this.InspectionUserControls.Add(new TChassisBodyUserControl());
                    this.InspectionUserControls.Add(new TGlassUserControl());
                    this.InspectionUserControls.Add(new TTyreConditionUserControl());
                    this.InspectionUserControls.Add(new TMechanicalCondUserControl());
                    this.InspectionUserControls.Add(new TPOIUserControl());
                }

                NextViewStack     = new Stack <UserControl>(this.InspectionUserControls.Reverse());
                this.FrameContent = this.inpectionUserControls[0];
                _eventAggregator.GetEvent <CustFetchedEvent>().Subscribe(async b =>
                {
                    await GetCustomerDetailsAsync();
                });
            }
            catch (Exception)
            {
                throw;
            }
        }