private void btnNew_Click(object sender, EventArgs e) { frmConstantsDataEntry form = new frmConstantsDataEntry(); if (form.ShowAddNew()) { Populate(); } }
private void lstConstants_DoubleClick(object sender, EventArgs e) { if (lstConstants.SelectedItems.Count > 0) { string type = lstConstants.SelectedItems[0].SubItems[1].Text; string name = lstConstants.SelectedItems[0].SubItems[0].Text; string functionName = type == "Runtime" ? lstConstants.SelectedItems[0].SubItems[2].Text : ""; string value = type == "Runtime" ? "" : lstConstants.SelectedItems[0].SubItems[2].Text; frmConstantsDataEntry form = new frmConstantsDataEntry(); if (form.ShowEdit(name, type, functionName, value)) { Populate(); } } }
private void btnEdit_Click(object sender, EventArgs e) { if (lstConstants.SelectedItems.Count > 0) { string type = lstConstants.SelectedItems[0].SubItems[1].Text; string name = lstConstants.SelectedItems[0].SubItems[0].Text; string functionName = type == "Runtime" ? lstConstants.SelectedItems[0].SubItems[2].Text : ""; string value = type == "Runtime" ? "" : lstConstants.SelectedItems[0].SubItems[2].Text; frmConstantsDataEntry form = new frmConstantsDataEntry(); if (form.ShowEdit(name, type, functionName, value)) { Populate(); } } }