private void BtnContinueTrial_Click(object sender, EventArgs e) { bool isPermanently = false; int nrestDays = _WebbActivateCls.GetRestDays(); if (nrestDays <= 0 && !_WebbActivateCls.IsPermanently) { MessageBox.Show("Webb Report Wizard\n\nThe trial version of this product have been expired!\nContact Webb Electronics today for purchase!\n\nPhone:972-242-5400", "Expired", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); this.txtKeys.Focus(); return; } _WebbActivateCls.LastUseDay = DateTime.Now.Date; WebbAcivateCls.Save(_WebbActivateCls, string.Empty); DialogResult = DialogResult.OK; }
public ActivateProductForm(RegisterWebbReportProduct _RegisterWebbProduct, WebbAcivateCls webbActivateCls) { _WebbActivateCls = webbActivateCls; int nRestDays = webbActivateCls.GetRestDays(); if (nRestDays <= 0) { MessageBox.Show("The trial version of this product have been expired!\nContact Webb Electronics today for purchase!\n\nPhone:972-242-5400", "expired", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } InitializeComponent(); registerWebbProduct = _RegisterWebbProduct; this.txtSeeds.Text = registerWebbProduct.GetSerialNumber(); if (!webbActivateCls.Activate) { this.lblExpired.Text = "To use 'Webb Report Wizard',Your need to activate it first! "; this.BtnContinueTrial.Visible = false; } else if (nRestDays <= 0) { this.lblExpired.Text = "The trial version of this product has expired! "; this.BtnContinueTrial.Visible = false; } else { this.lblExpired.Text = string.Format("{0} days left for the trial version of Webb Report Wizard!", nRestDays); this.BtnContinueTrial.Visible = true; } }