Q: How can we check the license type (Perpetual/Subscription/Expiry) ?
I just need to know is there a way to query the radio button value of Perpetual/Subscription/Expiry Date which is selected.
A: see below
In our example applications this function will allow you to determine and show the License Status etc i.e. Perpetual/Subscription/Expiry
You will need to use this and change to your needs:
---------------------------------
private void ShowLicenseStatus(int LicenseStatus)
{
//Clear Down status box
txtStatus.Text = "";
//Show info in trial
if (LicenseStatus == (int)Shafer.LicenseStatus.PROD_INTRIAL)
{
int TrialExpiresinSecs = 0;
string TrialExpiryDate = "";
//Get the length left in trial in Seconds
ShaferError = oShafer.GetTrialExpirySecs(ref TrialExpiresinSecs);
if (ShaferError != (int)Shafer.ErrorCodes.FC_OK)
{
Shafer.ErrorCodes Err = (Shafer.ErrorCodes)ShaferError;
string ErrMess = "";
Shafer.GetErrorMessage((int)Err, ref ErrMess);
MessageBox.Show(ErrMess);
Application.Exit();
}
//Get the Actual Expiry Date
oShafer.GetTrialExpiryDate(ref TrialExpiryDate);
if (ShaferError != (int)Shafer.ErrorCodes.FC_OK)
{
Shafer.ErrorCodes Err = (Shafer.ErrorCodes)ShaferError;
string ErrMess = "";
Shafer.GetErrorMessage((int)Err, ref ErrMess);
MessageBox.Show(ErrMess);
Application.Exit();
}
txtStatus.Text += "IN TRIAL \r\n";
txtStatus.Text += "Trial Expires in " + TrialExpiresinSecs.ToString() + " secs \r\n";
txtStatus.Text += "Trial Expires " + TrialExpiryDate.ToString() + "\r\n";
}
//Show info Activated with a Subscription period
if (LicenseStatus == (int)Shafer.LicenseStatus.PROD_AUTHORIZED || LicenseStatus == (int)Shafer.LicenseStatus.PROD_CONCURRENT)
{
int SubscriptionExpiresinSecs = 0;
string SubscriptionExpiryDate = "";
//Get the length left in trial in Seconds
ShaferError = oShafer.GetSubscriptionExpirySecs(ref SubscriptionExpiresinSecs);
if (ShaferError == (int)Shafer.ErrorCodes.FC_LICFILE_CORRUPT)
{
//Check for other fatal errors
if (ShaferError != (int)Shafer.ErrorCodes.FC_OK && ShaferError != (int)Shafer.ErrorCodes.FC_LICFILE_CORRUPT)
{
Shafer.ErrorCodes Err = (Shafer.ErrorCodes)ShaferError;
string ErrMess = "";
Shafer.GetErrorMessage((int)Err, ref ErrMess);
MessageBox.Show(ErrMess);
Application.Exit();
}
if (LicenseStatus == (int)Shafer.LicenseStatus.PROD_CONCURRENT)
txtStatus.Text += "ACTIVATED PERPETUAL LICENSE (CONCURRENCY)\r\n";
else
txtStatus.Text += "ACTIVATED PERPETUAL LICENSE \r\n";
}
else
{
//Check for aother fatal errors
if (ShaferError != (int)Shafer.ErrorCodes.FC_OK)
{
Shafer.ErrorCodes Err = (Shafer.ErrorCodes)ShaferError;
string ErrMess = "";
Shafer.GetErrorMessage((int)Err, ref ErrMess);
MessageBox.Show(ErrMess);
Application.Exit();
}
//Get the Actual Subscription Expiry Date
oShafer.GetSubscriptionExpiryDate(ref SubscriptionExpiryDate);
if (ShaferError != (int)Shafer.ErrorCodes.FC_OK && ShaferError != (int)Shafer.ErrorCodes.FC_LICFILE_CORRUPT)
{
Shafer.ErrorCodes Err = (Shafer.ErrorCodes)ShaferError;
string ErrMess = "";
Shafer.GetErrorMessage((int)Err, ref ErrMess);
MessageBox.Show(ErrMess);
Application.Exit();
}
if (LicenseStatus == (int)Shafer.LicenseStatus.PROD_CONCURRENT)
txtStatus.Text += "SUBSCRIPTION LICENSE (CONCURRENCY) \r\n";
else
txtStatus.Text += "SUBSCRIPTION LICENSE \r\n";
txtStatus.Text += "Subscription Expires in " + SubscriptionExpiresinSecs.ToString() + " secs \r\n";
txtStatus.Text += "Subscription Expires " + SubscriptionExpiryDate.ToString() + "\r\n";
}
}
}
I just need to know is there a way to query the radio button value of Perpetual/Subscription/Expiry Date which is selected.
A: see below
In our example applications this function will allow you to determine and show the License Status etc i.e. Perpetual/Subscription/Expiry
You will need to use this and change to your needs:
---------------------------------
private void ShowLicenseStatus(int LicenseStatus)
{
//Clear Down status box
txtStatus.Text = "";
//Show info in trial
if (LicenseStatus == (int)Shafer.LicenseStatus.PROD_INTRIAL)
{
int TrialExpiresinSecs = 0;
string TrialExpiryDate = "";
//Get the length left in trial in Seconds
ShaferError = oShafer.GetTrialExpirySecs(ref TrialExpiresinSecs);
if (ShaferError != (int)Shafer.ErrorCodes.FC_OK)
{
Shafer.ErrorCodes Err = (Shafer.ErrorCodes)ShaferError;
string ErrMess = "";
Shafer.GetErrorMessage((int)Err, ref ErrMess);
MessageBox.Show(ErrMess);
Application.Exit();
}
//Get the Actual Expiry Date
oShafer.GetTrialExpiryDate(ref TrialExpiryDate);
if (ShaferError != (int)Shafer.ErrorCodes.FC_OK)
{
Shafer.ErrorCodes Err = (Shafer.ErrorCodes)ShaferError;
string ErrMess = "";
Shafer.GetErrorMessage((int)Err, ref ErrMess);
MessageBox.Show(ErrMess);
Application.Exit();
}
txtStatus.Text += "IN TRIAL \r\n";
txtStatus.Text += "Trial Expires in " + TrialExpiresinSecs.ToString() + " secs \r\n";
txtStatus.Text += "Trial Expires " + TrialExpiryDate.ToString() + "\r\n";
}
//Show info Activated with a Subscription period
if (LicenseStatus == (int)Shafer.LicenseStatus.PROD_AUTHORIZED || LicenseStatus == (int)Shafer.LicenseStatus.PROD_CONCURRENT)
{
int SubscriptionExpiresinSecs = 0;
string SubscriptionExpiryDate = "";
//Get the length left in trial in Seconds
ShaferError = oShafer.GetSubscriptionExpirySecs(ref SubscriptionExpiresinSecs);
if (ShaferError == (int)Shafer.ErrorCodes.FC_LICFILE_CORRUPT)
{
//Check for other fatal errors
if (ShaferError != (int)Shafer.ErrorCodes.FC_OK && ShaferError != (int)Shafer.ErrorCodes.FC_LICFILE_CORRUPT)
{
Shafer.ErrorCodes Err = (Shafer.ErrorCodes)ShaferError;
string ErrMess = "";
Shafer.GetErrorMessage((int)Err, ref ErrMess);
MessageBox.Show(ErrMess);
Application.Exit();
}
if (LicenseStatus == (int)Shafer.LicenseStatus.PROD_CONCURRENT)
txtStatus.Text += "ACTIVATED PERPETUAL LICENSE (CONCURRENCY)\r\n";
else
txtStatus.Text += "ACTIVATED PERPETUAL LICENSE \r\n";
}
else
{
//Check for aother fatal errors
if (ShaferError != (int)Shafer.ErrorCodes.FC_OK)
{
Shafer.ErrorCodes Err = (Shafer.ErrorCodes)ShaferError;
string ErrMess = "";
Shafer.GetErrorMessage((int)Err, ref ErrMess);
MessageBox.Show(ErrMess);
Application.Exit();
}
//Get the Actual Subscription Expiry Date
oShafer.GetSubscriptionExpiryDate(ref SubscriptionExpiryDate);
if (ShaferError != (int)Shafer.ErrorCodes.FC_OK && ShaferError != (int)Shafer.ErrorCodes.FC_LICFILE_CORRUPT)
{
Shafer.ErrorCodes Err = (Shafer.ErrorCodes)ShaferError;
string ErrMess = "";
Shafer.GetErrorMessage((int)Err, ref ErrMess);
MessageBox.Show(ErrMess);
Application.Exit();
}
if (LicenseStatus == (int)Shafer.LicenseStatus.PROD_CONCURRENT)
txtStatus.Text += "SUBSCRIPTION LICENSE (CONCURRENCY) \r\n";
else
txtStatus.Text += "SUBSCRIPTION LICENSE \r\n";
txtStatus.Text += "Subscription Expires in " + SubscriptionExpiresinSecs.ToString() + " secs \r\n";
txtStatus.Text += "Subscription Expires " + SubscriptionExpiryDate.ToString() + "\r\n";
}
}
}