Exemple #1
0
 public Response <License> Post(LicenseRequest request)
 {
     try
     {
         License license = LicenseDAL.GetNewLicense(request.User, request.ApplicationID);
         return(new Response <License>(license));
     }
     catch (Exception ex)
     {
         return(new Response <License>(ex.Message));
     }
 }
        private void LicenseDetail_Load(object sender, System.EventArgs e)
        {
            LicenseDetail licenseDetail = LicenseDAL.GetLicenseDetail();

            if (licenseDetail == null)
            {
                MessageBox.Show("No Valid Lincense found");
                this.Close();
                return;
            }

            txt_createdAt.Text  = licenseDetail.CreateDateTime.ToString();
            txt_licenseKey.Text = licenseDetail.UID;
            txt_validUpto.Text  = licenseDetail.ValidUpto.ToString();
        }
        public void GetAuthorizationKeyTest()
        {
            User user = new User()
            {
                Address      = "Address",
                City         = "City",
                EmailAddress = "EmailAddress",
                Name         = "GetAuthorizationKeyTestMethod",
                PhoneNumber  = "PhoneNumber",
                State        = "State",
                Zip          = "Zip"
            };

            string  hardwareID = "HardwareID";
            Guid    guid       = new Guid("5FD3560A-0EFD-4E48-9DF9-C4FA3F44BA15");
            License license    = LicenseDAL.GetNewLicense(user, guid);

            string authKey = GetAuthorizationKey(hardwareID, guid, license.Key);

            Assert.AreEqual(Registration.GenerateSHA1Hash(string.Concat(hardwareID, guid.ToString(), license.Key)), authKey);
        }
 public License RequestLicense(User user, Guid applicationID)
 {
     return(LicenseDAL.GetNewLicense(user, applicationID));
 }