/// <summary> /// Событие при вводе текста в поле "DirectInputTextBox" /// </summary> private void DirectInputTextBox_TextChanged(object sender, TextChangedEventArgs e) { List <string> zxc = fieldsController.GetBbkNumbers(); string word = DirectInputTextBox.Text; if (zxc.Contains(word)) { BbkWarningBtn.Visibility = Visibility.Collapsed; foreach (var item in booksController.GetBookWithId(Settings.Default.selectBook)) { if (word != item.fields.field_knowledge_bbk && word != "") { SaveBtn.IsEnabled = true; } else { SaveBtn.IsEnabled = false; } } } else { BbkWarningBtn.Visibility = Visibility.Visible; SaveBtn.IsEnabled = false; } if (NewAuthorInput.Text == "" || NewNameInput.Text == "" || NewBBkInputComboBox.Text == "" || NewIsbnInput.Text == "" || NewYearInput.Text == "" || NewInterpreterComboBox.Text == "" || NewChamberComboBox.Text == "") { SaveBtn.IsEnabled = false; } }
public bool CheckBbkString(string bbk) { foreach (var item in fieldsController.GetBbkNumbers()) { if (item.Contains(bbk)) { return(true); } } return(false); }
/// <summary> /// Событие при вводе текста в поле "DirectInputTextBox" /// </summary> private void DirectInputTextBox_TextChanged(object sender, TextChangedEventArgs e) { List <string> zxc = fieldsController.GetBbkNumbers(); string word = DirectInputTextBox.Text; if (zxc.Contains(word)) { BbkWarningBtn.Visibility = Visibility.Collapsed; } else { BbkWarningBtn.Visibility = Visibility.Visible; } }
public bool CheckBb2k(string bbk) { //List<char> delimiterChars = new List<char>(); //delimiterChars.Add(','); //delimiterChars.Add(';'); //List<string> bbkParts = new List<string>(); foreach (var item in fieldsController.GetBbkNumbers()) { if (item.Contains(bbk)) { return(true); } else { return(false); } } return(true); }