Exemplo n.º 1
0
        public void SetScreenAsDefault()
        {
            // cmboxCountry.SelectedValue = AppProperties.defaultCountry;
            //  cmboxEmirates.SelectedValue = AppProperties.defaultEmirate;

            txtBoxPlateNumber.Text = "";
            this.txtPlateCode.Text = "";
            this.cntControlVehcileSerachRecord.IsEnabled = false;
            ucRecordViolationNonUAEVehicle ucNonUAEVeh = new ucRecordViolationNonUAEVehicle(this.m_mainWindow, this);
            ucNonUAEVeh.PopulateVehicleSearchRecords();
            this.cntControlVehcileSerachRecord.Content = ucNonUAEVeh;

        }
Exemplo n.º 2
0
        public void SearchVehicleArHandler()
        {


            try
            {


                // this.cntControlVehcileSerachRecord.Content = new ucVehicleProfileInspection();
                // this.UpdateLayout();
                //  busyIndicator.IsBusy = true;
                // MessageBox.Show("Searching Vehicle");
                _iValidate = (IValidation)new RecordViolationInputArValidation();
                _validationResult = _iValidate.Validate(this);
                if (_validationResult != "Valid")
                {
                    WPFMessageBox.Show(new CommonUtils().GetStringValue("DataValidation"), _validationResult);
                    return;
                }
                else
                {

                    // string vehicleCatAr = ((IVehicleProfile)VehicleProfileManager.GetInstance()).GetAlternateCategory(cmboxVehicleCategoty.SelectedValue.ToString(), _resources.GetLocale()).Trim();   
                    //  IVehicleProfile iVehicleProfile = ((IVehicleProfile)VehicleProfileManager.GetInstance());


                    //  string vehicleCatAr = iVehicleProfile.GetAlternateCategory(cmboxVehicleCategoty.SelectedValue.ToString(), "en-US");


                    //    ProgressDialogResult result = ProgressDialog.ProgressDialog.Execute(this.m_mainWindow, "Searching Vehicle...", (bw, we) =>
                    //{
                    string vehicleCatAr = ((IVehicleProfile)VehicleProfileManager.GetInstance()).GetAlternateCategory((string)this.vehicleCatTable[cmboxVehicleCategoty.Text], "ar-AE");
                    //    vehicleCatAr = vehicleCatAr;
                    //});


                    if (cmboxCountry.SelectedValue.ToString().Trim() != AppProperties.defaultCountryAr)
                    {
                        //No UAE Vehicle
                        if (AppProperties.vehicle == null)
                        {
                            AppProperties.vehicle = new Vehicle();
                        }




                        AppProperties.vehicle.Country = (string)this.countryTable[cmboxCountry.Text];

                        if (null == (string)this.emirateTable[cmboxEmirates.Text])
                        {
                            AppProperties.vehicle.Emirate = "";
                        }
                        else
                        {
                            AppProperties.vehicle.Emirate = (string)this.emirateTable[cmboxEmirates.Text];
                        }
                        if (cmboxPlateCode.Visibility == System.Windows.Visibility.Collapsed)
                        {
                            AppProperties.vehicle.PlateCode = txtPlateCode.Text;
                        }
                        else
                        {
                            AppProperties.vehicle.PlateCode = (string)this.plateCodeTable[cmboxPlateCode.Text];
                        }
                        if (null == (string)this.plateCatTable[cmboxPlateCategory.Text])
                        {
                            AppProperties.vehicle.PlateCategory = "";
                        }
                        else
                        {
                            AppProperties.vehicle.PlateCategory = (string)this.plateCatTable[cmboxPlateCategory.Text];
                        }





                        AppProperties.vehicle.PlateNumber = this.txtBoxPlateNumber.Text;
                        AppProperties.vehicle.VehicleCategory = (string)this.vehicleCatTable[cmboxVehicleCategoty.Text];
                        AppProperties.vehicle.VehicleCategoryAr = vehicleCatAr;
                        vsd.hh.utilities.AppProperties.routeFromRecordViolation = false;
                        busyIndicator.IsBusy = false;
                        EnableDisableVehicleInputDetails(false);
                        this.cntControlVehcileSerachRecord.IsEnabled = true;
                        ucRecordViolationNonUAEVehicle ucNonUAEVeh = new ucRecordViolationNonUAEVehicle(this.m_mainWindow, this);
                        ucNonUAEVeh.PopulateVehicleSearchRecords();
                        ucNonUAEVeh.IsReadOnlyFileds(false);
                        this.cntControlVehcileSerachRecord.Content = ucNonUAEVeh;
                       // ucNonUAEVeh.txtBoxOperatorName.Focus();
                        this.UpdateLayout();
                        // this.cntControlVehcileSerachRecord.Content = new ucRecordViolationNonUAEVehicle(this.m_mainWindow);

                        //  this.cntControlVehcileSerachRecord.Content = this.m_mainWindow.m_PagesList[5];
                        // EnableDisableVehicleInputDetails(false);
                        //Non UAE Vehicle Violation Screen


                    }
                    else
                    {
                        //UAE Vehcile


                        IVehicleProfile iVehicleProfile = ((IVehicleProfile)VehicleProfileManager.GetInstance());
                        string country = (string)this.countryTable[cmboxCountry.Text];
                        string source = (string)this.emirateTable[cmboxEmirates.Text];
                        string category = (string)this.plateCatTable[cmboxPlateCategory.Text];
                        string code = (string)this.plateCodeTable[cmboxPlateCode.Text];
                        string number = txtBoxPlateNumber.Text.Trim();
                        // ProgressDialogResult result2 = ProgressDialog.ProgressDialog.Execute(this.m_mainWindow, lblSearchingVehicle.Content.ToString(), (bw, we) =>
                        //{
                        //  iVehicleProfile.GetVehicleProfileDetails(country, source, category, number, code);
                        // });
                        ProgressDialogResult result = ProgressDialog.ProgressDialog.Execute(this.m_mainWindow, lblSearchingVehicle.Content.ToString(), (bw, we) =>
                        {

                            iVehicleProfile.GetVehicleProfileDetails(country, source, category, number, code);

                            // So this check in order to avoid default processing after the Cancel button has been pressed.
                            // This call will set the Cancelled flag on the result structure.
                            ProgressDialog.ProgressDialog.CheckForPendingCancellation(bw, we);

                        }, ProgressDialogSettings.WithSubLabelAndCancel);

                        if (result.Cancelled)
                            return;
                        else if (result.OperationFailed)
                            return;


                        if (AppProperties.businessError)
                        {
                            AppProperties.vehicle = null;
                            AppProperties.recordedViolation = null;
                            AppProperties.recordedViolation = new Violation();
                            AppProperties.recordedViolation.InspectionArea = AppProperties.location;

                            WPFMessageBox.Show(new CommonUtils().GetStringValue("DataValidation"), AppProperties.errorMessageFromBusiness);
                            AppProperties.businessError = false;
                            // busyIndicator.IsBusy = false;
                            //    LandingScreenEn landing = new LandingScreenEn();
                            //   _render.switchDisplay(form, landing);
                            //    this.m_mainWindow.MainContentControl.Content = this.m_mainWindow.m_PagesList[3];
                            return;
                        }
                        if (AppProperties.IsException)
                        {
                            AppProperties.IsException = false;
                            WPFMessageBox.Show(new CommonUtils().GetStringValue("DataValidation"), new CommonUtils().GetStringValue("ErrorException"));
                            ucNonUAEVehNew = new ucRecordViolationNonUAEVehicle(m_mainWindow, this);
                            //ucNonUAEVehNew.IsReadOnlyFileds(true);
                            this.cntControlVehcileSerachRecord.Content = ucNonUAEVehNew;
                           // ucNonUAEVehNew.txtBoxOperatorName.Focus();
                            this.UpdateLayout();
                            AppProperties.vehicle = null;
                            //  ClearFields();
                            return;
                        }

                        if (null == AppProperties.vehicle)
                        {
                            WPFMessageBox.Show(new CommonUtils().GetStringValue("DataValidation"), new CommonUtils().GetStringValue("VehicleNotFound"));
                            ucNonUAEVehNew = new ucRecordViolationNonUAEVehicle(m_mainWindow, this);
                            //ucNonUAEVehNew.IsReadOnlyFileds(true);
                            this.cntControlVehcileSerachRecord.Content = ucNonUAEVehNew;
                            //ucNonUAEVehNew.txtBoxOperatorName.Focus();
                            this.UpdateLayout();
                            // this.m_mainWindow.MainContentControl.Content = this.m_mainWindow.m_PagesList[3];
                            //  this.m_mainWindow.MainContentControl.Content = new ucLocationSelectionEn(m_mainWindow);
                            return;
                        }
                        AppProperties.vehicle.VehicleCategory = (string)this.vehicleCatTable[cmboxVehicleCategoty.Text];
                        AppProperties.vehicle.VehicleCategoryAr = vehicleCatAr;

                        if (AppProperties.vehicle.Emirate.Equals(AppProperties.defaultEmirate, StringComparison.CurrentCultureIgnoreCase) && AppProperties.isOnline)
                        {

                            vsd.hh.utilities.AppProperties.routeFromRecordViolation = true;
                            // MessageBox.Show("Vehicle Information Found!!!");
                            EnableDisableVehicleInputDetails(false);

                            //  VehicleProfileInspectionScreenEn RvDubai = new VehicleProfileInspectionScreenEn();
                            // _render.switchDisplay(form, RvDubai);

                            this.cntControlVehcileSerachRecord.IsEnabled = true;
                            ucVehicleProfileInspection ucUAEVehicleReuslt = new ucVehicleProfileInspection(this.m_mainWindow);
                            ucUAEVehicleReuslt.PopulateData();
                            this.cntControlVehcileSerachRecord.Content = ucUAEVehicleReuslt;
                          //  ucNonUAEVehNew.txtBoxOperatorName.Focus();
                            this.UpdateLayout();
                            busyIndicator.IsBusy = false;
                            //  this.cntControlVehcileSerachRecord.Content = this.m_mainWindow.m_PagesList[6];
                            return;

                        }
                        else
                        {
                            AppProperties.isOnline = true;
                            vsd.hh.utilities.AppProperties.routeFromRecordViolation = false; ;
                            //MessageBox.Show("Non Dubai");
                            // this.cntControlVehcileSerachRecord.Content
                            //EnableDisableVehicleInputDetails(false);
                            //EnableDisableVehcileResult(true);
                            //EnableUAEVehicleOptions(false);
                            EnableDisableVehicleInputDetails(false);

                            //  VehicleProfileInspectionScreenEn RvDubai = new VehicleProfileInspectionScreenEn();
                            // _render.switchDisplay(form, RvDubai);

                            this.cntControlVehcileSerachRecord.IsEnabled = true;
                            ucVehicleProfileInspection ucUAEVehicleReuslt = new ucVehicleProfileInspection(this.m_mainWindow);
                            ucUAEVehicleReuslt.PopulateData();
                            this.cntControlVehcileSerachRecord.Content = ucUAEVehicleReuslt;
                         //   ucNonUAEVehNew.txtBoxOperatorName.Focus();
                            this.UpdateLayout();
                            busyIndicator.IsBusy = false;
                            /*
                            // RecordViolationNonDubaiScreenEn RVNonDubai = new RecordViolationNonDubaiScreenEn();
                            // _render.switchDisplay(form, RVNonDubai);
                            EnableDisableVehicleInputDetails(false);
                            this.cntControlVehcileSerachRecord.IsEnabled = true;
                            //  this.cntControlVehcileSerachRecord.Content = this.m_mainWindow.m_PagesList[5];
                            ucRecordViolationNonUAEVehicle ucNonUAEVeh = new ucRecordViolationNonUAEVehicle(this.m_mainWindow,this);
                            ucNonUAEVeh.IsReadOnlyFileds(false);
                            ucNonUAEVeh.PopulateVehicleSearchRecords();
                            this.cntControlVehcileSerachRecord.Content = ucNonUAEVeh;
                            busyIndicator.IsBusy = false;
                            return;*/
                        }

                    }
                }
                busyIndicator.IsBusy = false;
            }

            catch (Exception ex)
            {
                CommonUtils.WriteLog(ex.StackTrace);
                WPFMessageBox.Show(new CommonUtils().GetStringValue("Exception"), ex.Message, ex.StackTrace, WPFMessageBoxButtons.OK, WPFMessageBoxImage.Error);
            }
        }
Exemplo n.º 3
0
 public void ResetFiledsOnSlectionChanged()
 {
     this.txtBoxPlateNumber.Text = "";
     this.txtPlateCode.Text = "";
     ucRecordViolationNonUAEVehicle ucNonUAEVeh = new ucRecordViolationNonUAEVehicle(this.m_mainWindow, this);
     ucNonUAEVeh.PopulateVehicleSearchRecords();
     this.cntControlVehcileSerachRecord.Content = ucNonUAEVeh;
 }