Esempio n. 1
0
        /// <summary>
        /// Called when we want to edit the current license type
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void bnEditLicenseType_Click(object sender, EventArgs e)
        {
            FormLicenseType form = new FormLicenseType(lvLicenseTypes.SelectedItems[0].Tag as LicenseType);

            if (form.ShowDialog() == DialogResult.OK)
            {
                UltraListViewItem editedItem        = lvLicenseTypes.SelectedItems[0];
                LicenseType       editedLicenseType = form.LicenseType;
                editedItem.Tag = editedLicenseType;

                // Re-load the data
                InitializeLicenseTypes();
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Called when we want to add a new license type
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void bnAddLicenseType_Click(object sender, EventArgs e)
        {
            FormLicenseType form = new FormLicenseType(null);

            if (form.ShowDialog() == DialogResult.OK)
            {
                LicenseType            newLicenseType = form.LicenseType;
                UltraListViewSubItem[] subItemArray   = new UltraListViewSubItem[1];
                subItemArray[0]       = new UltraListViewSubItem();
                subItemArray[0].Value = (newLicenseType.PerComputer) ? "Yes" : "No";
                UltraListViewItem item = new UltraListViewItem(newLicenseType.Name, subItemArray);
                item.Tag = newLicenseType;
                lvLicenseTypes.Items.Add(item);
            }
        }