protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { ZNodeLicenseManager lm = new ZNodeLicenseManager(); ZNodeLicenseType lt; lt = lm.Validate(); DaysRemaining = lm.DemoDaysRemaining().ToString() + " Days Remaining"; } }
/// <summary> /// Activate button clicked /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnActivateLicense_Click(object sender, EventArgs e) { //check if user agreed to EULA if (!chkEULA.Checked) { lblError.Text = "Storefront Activation requires that you accept the software license agreement (EULA)"; return; } //get the target license requested ZNodeLicenseType lt = ZNodeLicenseType.Trial; //default if (chkFreeTrial.Checked) { lt = ZNodeLicenseType.Trial; } else if (chkEntLicense.Checked) { lt = ZNodeLicenseType.Enterprise; } else if (chkSerLicense.Checked) { lt = ZNodeLicenseType.Server; } //install license ZNodeLicenseManager lm = new ZNodeLicenseManager(); bool retval = false; string ErrorMessage = ""; retval = lm.InstallLicense(lt,txtSerialNumber.Text.Trim(),txtName.Text, txtEmail.Text,out ErrorMessage); //if success if (retval) { lblConfirm.Text = "Your Znode Storefront license has been successfully activated."; pnlConfirm.Visible = true; pnlLicenseActivate.Visible = false; ZNodeLogging.LogActivity(104,customerIPaddress,DomainName,txtName.Text, txtEmail.Text,lblConfirm.Text); } //install failed else { lblError.Text = "Failed to activate license. "; lblError.Text = lblError.Text + ErrorMessage; ZNodeLogging.LogActivity(105, customerIPaddress, DomainName, txtName.Text, txtEmail.Text, lblError.Text); } }
/// <summary> /// /// </summary> protected void CheckLicense() { // Get the target license requested ZNodeLicenseType lt = ZNodeLicenseType.Invalid; //Create Instance for License Manager ZNodeLicenseManager LicenseManager = new ZNodeLicenseManager(); lt = LicenseManager.Validate(); }