private void cmb2ndFormProgramOrSite_SelectedIndexChanged(object sender, EventArgs e) { RecordIndex = cmb2ndFormProgramOrSite.SelectedIndex; if (RecordDictionary.Count == 0) { return; } var record = RecordDictionary.ElementAt(RecordIndex); var value = record.Value; txt2ndFormProgramSite.Text = value.Site; txt2ndFormUserId.Text = value.UserId; txt2ndFormPassword.Text = value.Password; txt2ndFormMisc.Text = value.Misc; RecordId = value.Id; }
private void btn2ndFormDelete_Click(object sender, EventArgs e) { RecordIndex = cmb2ndFormProgramOrSite.SelectedIndex; var record = RecordDictionary.ElementAt(RecordIndex); var value = record.Value; var question = "Delete Record for '" + value.Site + "'?"; DialogResult result = MessageBox.Show(question, "Open SZMe", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (result == DialogResult.Yes) { DeleteRecord(); Reset(); ReloadRecordAndComboBox(); } }
//SET RECORD ID private void SetRecordId() { //GET INDEX FOR COMBOBOX var comboBoxIndex = cmb2ndFormProgramOrSite.SelectedIndex; //GET RECORD MATCHING SELECTED COMBO BOX INDEX var record = RecordDictionary.ElementAt(comboBoxIndex); if (RecordDictionary.Count <= 1) { RecordId = 0; return; } //GET RECORD ID RecordId = record.Value.Id; }
private void btn2ndFormEdit_Click(object sender, EventArgs e) { RecordIndex = cmb2ndFormProgramOrSite.SelectedIndex; var record = RecordDictionary.ElementAt(RecordIndex); var value = record.Value; var question = "Edit Record for '" + value.Site + "'?"; DialogResult result = MessageBox.Show(question, "Open SZMe", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { cmb2ndFormProgramOrSite.Enabled = false; EnableAllButtons(); EnableAllTextBoxes(); EnableClipboardButtons(); btn2ndFormNew.Enabled = false; btn2ndFormDelete.Enabled = false; RemovePasswordChar(); } }