Example #1
0
        private void btnGenerateActivatedLicense_Click(object sender, EventArgs e)
        {
            int id = Convert.ToInt32(this.SaveActivation());

            this.activation = licenseService.GetActivationById(id);

            if (this.activation.CPUID == string.Empty || this.activation.ActivationCode == string.Empty)
            {
                MessageBox.Show("You must generate an activation code before activation.", "Error");
            }
            else
            {
                if (LicenseUtility.GenerateLicense(licenseFeatures, activation))
                {
                    MessageBox.Show("Success", "Generate License File");
                    this.Close();
                }
            }
        }
Example #2
0
        void ulvActivations_ItemDoubleClick(object sender, ItemDoubleClickEventArgs e)
        {
            if (ulvActivations.SelectedItems.Count > 0)
            {
                if (this.currentLicenseId != -1)
                {
                    LMan4.com.licensemanager4web.License l = licenseService.GetLicenseById(this.currentLicenseId);
                    LMan4.com.licensemanager4web.LicenseFeaturesParams lf = licenseService.GetLicenseFeatureParams(this.currentLicenseId);
                    LMan4.com.licensemanager4web.Activation            a  = licenseService.GetActivationById(Convert.ToInt32(ulvActivations.SelectedItems[0].Key));

                    AddActivation frm = new AddActivation(l, lf, a);
                    frm.FormClosed += new FormClosedEventHandler(frm_FormClosed);
                    frm.Show();
                }
                else
                {
                    MessageBox.Show("Please select and existing license record, or save current record before creating an activation record.", "Error");
                }
            }
        }