//метод, изменяющий данные динамической кнопки-заметки private void ChangeToDo(string todo_id, DateTime todo_time, string todo_text, string todo_cat, string todo_com) { Note_ Note_forChange = dbManager_Mainf.Search_DataBase(Key); Note_forChange.Time = todo_time; Note_forChange.ToDo = todo_text; Note_forChange.Cathegory = todo_cat; Note_forChange.Comment = todo_com; dbManager_Mainf.Replace_DB(Key, Note_forChange); //перезапуск - отрисовать элементы заново. Application.Restart(); }
private void LoadData(string id) { Note_ tempNote = dbManager_Editf.Search_DataBase(id); todo_textBox.Text = tempNote.ToDo; numericUpDown1.Value = tempNote.Time.Hour; numericUpDown2.Value = tempNote.Time.Minute; for (int i = 0; i < cat_comboBox.Items.Count; i++) { if (cat_comboBox.Items[i].Equals(tempNote.Cathegory)) { cat_comboBox.SelectedItem = cat_comboBox.Items[i].ToString(); } } }