/// <summary> /// Registers a copy of software for a new installation on the client's machine /// </summary> /// <param name="productCode">Unique product code as provided to the client</param> /// <returns>Registration info to the client</returns> public RegistrationInfo RegisterProduct(string productCode) { var clientSoftwareProfile = softwareProfileService.GetSoftwareProfileProductCode(productCode); if (clientSoftwareProfile != null) { var client = clientSoftwareProfile.Client; RegistrationInfo regInfo = new RegistrationInfo(); regInfo.FirstRegisteredDate = (DateTime)client.DateRegistered; regInfo.RegisteredTo = client.ClientName; regInfo.ClientId = (int)client.Id; return(regInfo); } else { return(null); } }
/// <summary> /// Returns software registration information to the client /// </summary> /// <param name="clientId"></param> /// <returns></returns> public RegistrationInfo GetRegistrationInfo(int clientId) { var client = clientService.GetClientById(clientId); if (client != null) { var clientSoftwareProfile = client.ClientSoftwareProfile; //Map information from the db entities to the RegistrationInfo entity RegistrationInfo regInfo = new RegistrationInfo(); regInfo.ClientId = client.Id; regInfo.FirstRegisteredDate = (DateTime)client.DateRegistered; regInfo.RegisteredTo = client.ClientName; regInfo.NoOfLicenses = (int)clientSoftwareProfile.LicensesPurchased; return(regInfo); } return(null); }