private void SetProperHelpMessage() { if (string.IsNullOrEmpty(VIN)) { HelpMessage = Resources.msgSecurityVEHICLEScan; Background = new SolidColorBrush(Colors.White); } else { if (!string.IsNullOrEmpty(GatePass) && GatePass.Length != 8) { HelpMessage = Resources.msgSecurityGatePass; Background = new SolidColorBrush(Colors.Orange); if (GatePass.Length != 8) { if (GatePass.Length > 8) { HelpMessage = Resources.msgSecurityLongGatePass; Background = new SolidColorBrush(Colors.IndianRed); } else { HelpMessage = Resources.msgSecurityShortGatePass; Background = new SolidColorBrush(Colors.IndianRed); } } } else if (string.IsNullOrEmpty(GatePass)) { HelpMessage = Resources.msgSecurityGatePass; Background = new SolidColorBrush(Colors.Orange); } else if (!VIN.EndsWith(GatePass)) { HelpMessage = Resources.msgSecurityNoMatch; Background = new SolidColorBrush(Colors.IndianRed); } else { HelpMessage = Resources.msgSecurityMatch; Background = new SolidColorBrush(Colors.Green); } } }
private bool ProcessCommand_CanExecute(object obj) { return(!string.IsNullOrEmpty(VIN) && !string.IsNullOrEmpty(GatePass) && VIN.EndsWith(GatePass)); }