public License() { TrialSettings = new LicenseTrialSettings(); base.KeyGeneratorType = KeyGeneratorTypes.StaticSmall; base.TrailNotificationSettings = new TrailNotificationSettings(); TrialSettings.ExpirationOptions = TrialExpirationOptions.Days; TrialSettings.ExpirationData = "30"; base.TrailNotificationSettings.TryButtonDelay = 7; }
public License() { TrialSettings = new LicenseTrialSettings(); base.KeyGeneratorType = KeyGeneratorTypes.StaticSmall; base.TrailNotificationSettings = new TrailNotificationSettings(); TrialSettings.ExpirationOptions = TrialExpirationOptions.Days; TrialSettings.ExpirationData = "30"; base.TrailNotificationSettings.TryButtonDelay = 7; }
public IQueryable<LicenseTrialSettings> UpdateTrialSettings(LicenseTrialSettings trialSettings) { int newId; //using (ScutexEntities db1 = new ScutexEntities()) //{ var trialSet = (from ts in db.TrialSettings where ts.TrialSettingId == trialSettings.TrialSettingId select ts).First(); trialSet.TrialExpirationOptionId = (int)trialSettings.ExpirationOptions; trialSet.ExpirationData = trialSettings.ExpirationData; db.SaveChanges(); newId = trialSet.TrialSettingId; //} return GetTrialSettingsById(newId); }
public IQueryable<LicenseTrialSettings> InsertTrialSettings(LicenseTrialSettings trialSettings) { int newId; //using (ScutexEntities db1 = new ScutexEntities()) //{ TrialSetting ts = new TrialSetting(); Mapper.CreateMap<Model.LicenseTrialSettings, TrialSetting>(); ts = Mapper.Map<Model.LicenseTrialSettings, TrialSetting>(trialSettings); ts.TrialExpirationOptionId = (int)trialSettings.ExpirationOptions; db.AddToTrialSettings(ts); db.SaveChanges(); newId = ts.TrialSettingId; //} return GetTrialSettingsById(newId); }
public void SingleUserSetup() { License.Name = "UnitTest License"; Product p = new Product(); p.Name = "UnitTest Product"; p.Description = "Just a product for unit testing"; License.LicenseId = 1; License.Product = p; License.KeyGeneratorType = KeyGeneratorTypes.StaticSmall; LicenseTrialSettings ts = new LicenseTrialSettings(); ts.ExpirationOptions = TrialExpirationOptions.Days; ts.ExpirationData = "30"; License.TrialSettings = ts; LicenseSet ls = new LicenseSet(); ls.LicenseId = 1; ls.LicenseSetId = 1; ls.Name = "Unit Test License Set"; ls.MaxUsers = 5; ls.SupportedLicenseTypes = LicenseKeyTypeFlag.SingleUser; License.LicenseSets = new NotifyList<LicenseSet>(); License.LicenseSets.Add(ls); CreateFile(new ClientLicense(License)); }
public void InvalidTrialSetup() { License.Name = "UnitTest License"; Product p = new Product(); p.Name = "UnitTest Product"; p.Description = "Just a product for unit testing"; License.LicenseId = 1; License.Product = p; License.KeyGeneratorType = KeyGeneratorTypes.StaticSmall; LicenseTrialSettings ts = new LicenseTrialSettings(); ts.ExpirationOptions = TrialExpirationOptions.Days; ts.ExpirationData = "30"; License.TrialSettings = ts; LicenseSet ls = new LicenseSet(); ls.LicenseId = 1; ls.LicenseSetId = 1; ls.Name = "Unit Test License Set"; ls.MaxUsers = 5; ls.SupportedLicenseTypes = LicenseKeyTypeFlag.Enterprise; License.LicenseSets = new NotifyList<LicenseSet>(); License.LicenseSets.Add(ls); ClientLicense lic2 = new ClientLicense(License); lic2.RunCount = 10; lic2.LastRun = DateTime.Now.AddMonths(12); lic2.FirstRun = DateTime.Now.AddMonths(24); CreateFile(lic2); }