private void updateLogEntry() { if (lvwMain.SelectedIndices.Count == 0) { messageBoxOK("An entry must be selected before it can be updated."); return; } ListViewItem item = lvwMain.SelectedItems[0]; clsTimeEntry entry = (clsTimeEntry)item.Tag; try { frmAddUpdate addUpdate = new frmAddUpdate(2, entry); if (addUpdate.ShowDialog() == DialogResult.OK) { refreshView(); } } catch { throw; } finally { refreshView(); } }
private void btnAdd_Click(object sender, EventArgs e) { frmAddUpdate addUpdate = new frmAddUpdate(1, null); if (addUpdate.ShowDialog() == DialogResult.OK) { refreshView(); } }
private void btnAdd_Click(object sender, EventArgs e) { frmAddUpdate addUpdate = new frmAddUpdate(); addUpdate.Mode = "Add"; addUpdate.ZipCode = new clsZipCode(); if (addUpdate.ShowDialog(this) == DialogResult.OK) { loadListBox(); } }
private void btnUpdate_Click(object sender, EventArgs e) { if (lstZipCodes.SelectedItems.Count == 0) { return; } frmAddUpdate addUpdate = new frmAddUpdate(); addUpdate.Mode = "Update"; int index = lstZipCodes.SelectedIndex; addUpdate.ZipCode = (clsZipCode)mZipCodeResultsAL[index]; if (addUpdate.ShowDialog(this) == DialogResult.OK) { loadListBox(); } }