private void cb_DropDownOpened(object sender, EventArgs e) { var list_gaps = new List <string>(); list_settings_sensors = db.GetItems <ModelGaps>(); foreach (var item in list_settings_sensors) { list_gaps.Add(item.Name_gaps + " " + item.Array_gaps); } ComboBoxGaps.ItemsSource = list_gaps; }
private void Save_Click(object sender, RoutedEventArgs e) { if (Name_gaps.Text == string.Empty) { MessageBox.Show("Заповніть поля!", "Network Security Module", MessageBoxButton.OK, MessageBoxImage.Information); } else { TextBox txtBox; var array_gaps = new List <int>(); for (var i = 1; i <= count_txtbox + 1; i++) { txtBox = (TextBox)GroupBoxCountClient.FindName("txtBox" + i); array_gaps.Add(Convert.ToInt32(txtBox.Text)); } var item_parameter = new ModelGaps() { Name_gaps = Name_gaps.Text, Array_gaps = JsonConvert.SerializeObject(array_gaps) }; db.SaveItem(item_parameter, false); ListViewParameter.ItemsSource = db.GetItems <ModelGaps>(); } }
public PageSettings() { InitializeComponent(); connection = new DataBaseConnection().SQLiteConnection(); db = new DataBaseHelp(connection); ListViewParameter.ItemsSource = db.GetItems <ModelGaps>(); ChangeCountTextBox.Gap(GroupBoxCountClient, 1, 4, "txtBox", 7, true); }
private void Param1_cb_DropDownOpened(object sender, EventArgs e) { itemsParameterCountConnectClients = db.GetItems <ModelTabelParameter>().Where(w => w.Name_parameter.Contains(NameCountConnectClients)).ToList(); GetNameParameter(itemsParameterCountConnectClients, param1_cb); }