//============================================================================* // GetLicenses() //============================================================================* protected void GetLicenses() { m_eErrorCode = eErrorCodes.None; cSQL SQL = new cSQL(Server, Database, UserID, Password); string strCommand = String.Format("SELECT * FROM Licenses WHERE ActivationKey = '{0}' AND Name = '{1}' AND Email = '{2}'", m_strKey, m_strName, m_strEmail); SqlDataReader Reader = SQL.ExecuteQuery(strCommand); if (Reader != null) { m_Page.Response.Write(String.Format("GetLicenses: {0:G}<br />\n", (int)cKeyCommand.eErrorCodes.None)); while (Reader.Read()) { m_Page.Response.Write("License:<br />\n"); m_Page.Response.Write(String.Format("Key: {0}<br />\n", Reader["ActivationKey"].ToString())); m_Page.Response.Write(String.Format("Name: {0}<br />\n", Reader["Name"].ToString())); m_Page.Response.Write(String.Format("Email: {0}<br />\n", Reader["Email"].ToString())); m_Page.Response.Write(String.Format("Computer: {0}<br />\n", Reader["Computer"].ToString())); m_Page.Response.Write(String.Format("NIC: {0}<br />\n", Reader["NIC"].ToString())); } } else { m_Page.Response.Write(String.Format("AddLicense: Error {0:G} - {1}", SQL.ErrorCode, SQL.ErrorMessage)); } SQL.Close(); }
//============================================================================* // AddLicense() //============================================================================* protected void AddLicense() { m_eErrorCode = eErrorCodes.None; cSQL SQL = new cSQL(Server, Database, UserID, Password); string strCommand = String.Format("INSERT INTO Licenses (ActivationKey, Name, Email) VALUES ('{0}', '{1}', '{2}')", m_strKey, m_strName, m_strEmail); int nCount = SQL.ExecuteCommand(strCommand); m_Page.Response.Write(String.Format("AddLicense: {0:G}\n", SQL.ErrorCode)); }