Пример #1
0
        private void OnUpdateCardSerialNumber(string technicianName)
        {
            Document.CardSerialNumber = null;

            if (!Technicians.IsNullOrEmpty())
            {
                foreach (var technician in Technicians)
                {
                    if (technician != null && !string.IsNullOrEmpty(technician.Number))
                    {
                        if (string.Equals(technician.Name, technicianName))
                        {
                            Document.CardSerialNumber = technician.Number;
                        }
                    }
                }
            }
        }
Пример #2
0
        private void OnSetDefault(object obj)
        {
            if (Technicians.IsNullOrEmpty() || SelectedTechnician == null)
            {
                return;
            }

            var currentDefault = Technicians.FirstOrDefault(c => c.IsDefault);

            if (currentDefault != null)
            {
                currentDefault.IsDefault = false;
                Repository.AddOrUpdate(currentDefault);
            }

            SelectedTechnician.IsDefault = true;
            Repository.AddOrUpdate(SelectedTechnician);
        }
Пример #3
0
        protected override void OnFastReadCompleted(object sender, DriverCardCompletedEventArgs e)
        {
            if (!e.IsSuccess)
            {
                StatusText = Resources.TXT_UNABLE_READ_SMART_CARD;
                SwitchReadButtonState(true);
                return;
            }

            if (e.CalibrationRecord == null)
            {
                if (IsCardReadUserInitiated)
                {
                    SwitchReadButtonState(true);
                    ShowError(Resources.EXC_NO_SMART_CARD_READERS_FOUND);
                }
            }
            else
            {
                if (RegistrationChangedCommand != null)
                {
                    RegistrationChangedCommand.Execute(GetRegistrationToQuery(e.CalibrationRecord));
                }

                Document.Convert(e.CalibrationRecord);

                if (!Technicians.IsNullOrEmpty() && !string.IsNullOrEmpty(e.CalibrationRecord.CardSerialNumber))
                {
                    foreach (var technician in Technicians)
                    {
                        if (technician != null && !string.IsNullOrEmpty(technician.Number))
                        {
                            if (string.Equals(technician.Number, e.CalibrationRecord.CardSerialNumber))
                            {
                                Document.Technician = technician.Name;
                            }
                        }
                    }
                }

                if (!string.IsNullOrEmpty(Document.TachographMake) && !string.IsNullOrEmpty(e.CalibrationRecord.VuPartNumber))
                {
                    if (string.Equals(Document.TachographMake, Resources.TXT_SIEMENS_VDO, StringComparison.CurrentCultureIgnoreCase))
                    {
                        if (e.CalibrationRecord.VuPartNumber.StartsWith(DataModel.Properties.Resources.TXT_SEED_TACHO_MODEL_NAME))
                        {
                            Document.TachographModel = e.CalibrationRecord.VuPartNumber;
                        }
                    }
                    if (string.Equals(Document.TachographMake, Resources.TXT_STONERIDGE, StringComparison.CurrentCultureIgnoreCase))
                    {
                        if (e.CalibrationRecord.VuPartNumber.StartsWith(Resources.TXT_STONERIDGE_CARD))
                        {
                            Document.TachographModel = e.CalibrationRecord.VuPartNumber;
                        }
                    }
                }

                PrintLabel(Document, false);

                StatusText = Resources.TXT_GENERATING_WORKSHOP_CARD_FILE;
                DriverCardReader.GenerateDump();
            }
        }