sunyi 5 лет назад
Родитель
Сommit
1ec717ae34

+ 7 - 7
OTS/OTSModelSharp/Measure/GetStageInfo/DlgLicenseInfo.cs

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

+ 5 - 2
OTS/OTSModelSharp/OTSLicMgr.cs

@@ -65,7 +65,10 @@ namespace OTSModelSharp
         const int TEXTFILE_ITEM_COLUMN_NUMBER = 2;
 
         //Email address
-        const String SUPPORT_EMAIL_ADDRESS = "OTSSupport@opton.com.cn";
+       public   String SUPPORT_EMAIL_ADDRESS = "OTSSupport@opton.com.cn";
+
+        //Email title
+       public String SUPPORT_EMAIL_TITLE = "License info";
 
         // constructor
         public void OTSLicenseFile()
@@ -239,7 +242,7 @@ namespace OTSModelSharp
 
 
         // check if COTSLicenseInfo is valid license info
-        public bool IsValidLicense(OTS_SOFT_PACKAGE_ID a_nPackId,
+        public bool IsValidLicense(COTSLicenseInfo.OTS_SOFT_PACKAGE_ID a_nPackId,
                                         COTSLicenseInfo a_poLicenseInfo,
                                         OTS_LICENSE_STATUS a_nLicStatus,
                                         bool a_bCheckMachinId /*= TRUE*/,