|
|
@@ -36,6 +36,8 @@ namespace OTSModelSharp.Measure.GetStageInfo
|
|
|
bool m_bAdd;
|
|
|
|
|
|
COTSLicenseInfo m_pLicenseInfo;
|
|
|
+
|
|
|
+ COTSLicMgr m_OTSLicMgr = new COTSLicMgr(null);
|
|
|
public DlgLicenseInfo()
|
|
|
{
|
|
|
InitializeComponent();
|
|
|
@@ -139,7 +141,7 @@ namespace OTSModelSharp.Measure.GetStageInfo
|
|
|
a_pOTSLicenseInfo.SetLicType((COTSLicenseInfo.OTS_LICENSE_TYPE)m_nCombeLicenseType);
|
|
|
a_pOTSLicenseInfo.SetExpireDate(m_oExpireData);
|
|
|
|
|
|
- String strEmail = COTSLicMgr::GetLicenseInfoTextBody(a_pOTSLicenseInfo);//升级完COTSLicMgr再修改此处
|
|
|
+ String strEmail = m_OTSLicMgr.GetLicenseInfoTextBody(a_pOTSLicenseInfo);//升级完COTSLicMgr再修改此处
|
|
|
strEmail.Trim();
|
|
|
if (strEmail == "")
|
|
|
{
|
|
|
@@ -148,7 +150,7 @@ namespace OTSModelSharp.Measure.GetStageInfo
|
|
|
return;
|
|
|
}
|
|
|
// email license info string
|
|
|
- if (!SendEmail(SUPPORT_EMAIL_ADDRESS, SUPPORT_EMAIL_TITLE, strEmail))//此方法做成接口
|
|
|
+ if (!SendEmail(m_OTSLicMgr.SUPPORT_EMAIL_ADDRESS, SUPPORT_EMAIL_TITLE, strEmail))//此方法做成接口
|
|
|
{
|
|
|
// email license info string, return if send email fails
|
|
|
|
|
|
@@ -173,7 +175,7 @@ namespace OTSModelSharp.Measure.GetStageInfo
|
|
|
String strPathName = openFileDialog.FileName;
|
|
|
|
|
|
// try to load license info from a text file
|
|
|
- COTSLicenseInfo pOTSLicenseInfo = COTSLicMgr::LoadLicenseInfoFromTextFile(strPathName);
|
|
|
+ COTSLicenseInfo pOTSLicenseInfo = m_OTSLicMgr.LoadLicenseInfoFromTextFile(strPathName);
|
|
|
|
|
|
|
|
|
// set control data with the license info
|
|
|
@@ -259,7 +261,7 @@ namespace OTSModelSharp.Measure.GetStageInfo
|
|
|
a_pOTSLicenseInfo.SetExpireDate(m_oExpireData);
|
|
|
|
|
|
//create license info text file
|
|
|
- if (!COTSLicMgr::CreateLicenseInfoFileText(a_pOTSLicenseInfo))
|
|
|
+ if (!m_OTSLicMgr.CreateLicenseInfoFileText(a_pOTSLicenseInfo))
|
|
|
{
|
|
|
return;
|
|
|
}
|
|
|
@@ -300,11 +302,11 @@ namespace OTSModelSharp.Measure.GetStageInfo
|
|
|
|
|
|
// test the license info
|
|
|
otsdataconst.OTS_LICENSE_STATUS nLicStatus = otsdataconst.OTS_LICENSE_STATUS.INVALID;
|
|
|
- COTSLicMgr licMgr = new COTSLicMgr();
|
|
|
- licMgr.IsValidLicense(Convert.ToInt32(pOTSLicenseInfo.GetPackId()), pOTSLicenseInfo, ref Convert.ToInt32(nLicStatus), false, false);
|
|
|
+
|
|
|
+ m_OTSLicMgr.IsValidLicense(pOTSLicenseInfo.GetPackId(), pOTSLicenseInfo, nLicStatus, false, false);
|
|
|
if (nLicStatus >= OTS_LICENSE_STATUS.OTS_LICENSE_STATUS_CAN_HAVEKEY && nLicStatus <= OTS_LICENSE_STATUS.MAX)
|
|
|
{
|
|
|
- strEditLicenseKey = COTSLicMgr.EncryptLicenseInfo(pOTSLicenseInfo);//升级完COTSLicMgr再修改此处
|
|
|
+ strEditLicenseKey = m_OTSLicMgr.EncryptLicenseInfo(pOTSLicenseInfo);//升级完COTSLicMgr再修改此处
|
|
|
}
|
|
|
// get license key string =========================
|
|
|
|