public void ManageLicense() { _Child = _Parent.CreateNode("Manage License"); Licenses lPage = new Licenses(); try { Assert.IsTrue(true); _Child.Pass("Called Licenses Class and Create Object"); } catch (AssertionException) { _Child.Fail("Failed to Called Licenses Class and Create Object"); throw; } lPage.lic(); Thread.Sleep(2000); try { Assert.IsTrue(true); _Child.Pass("Click View and Manage License"); } catch (AssertionException) { _Child.Fail("Failed to Click View and Manage License"); throw; } }
public bool SaveOrUpdate(Licenses license) { bool res = true; db.Session.Clear(); ITransaction transaction = db.Session.BeginTransaction(); try { db.Session.Save(license); transaction.Commit(); } catch { transaction.Rollback(); db.Session.Clear(); transaction = db.Session.BeginTransaction(); try { db.Session.SaveOrUpdate(license); transaction.Commit(); } catch { res = false; } } db.Session.Flush(); return(res); }
private void ProcessResponse() { string webResponse = Variables.WebResponse; if (webResponse.Split('[', ']')[1] == "SUCCESS") { string licenseCode = webResponse.Replace("[SUCCESS] ", String.Empty); Invoke((MethodInvoker) delegate { TextBoxLicenseCode.Text = licenseCode; if (CheckBoxCopyToClipboard.Checked) { Clipboard.SetText(licenseCode); } }); SetControls(true); ResetControls(true); Variables.Containers.Active.SetStatus("License successfully created.", 4); Licenses.GetLicenses(Variables.MyProgramsSelected.Programid); } else { Variables.Containers.Active.SetStatus(webResponse.Replace("[ERROR] ", String.Empty), 1); ResetControls(false); } }
public void PostReturnIdErrorIdClientTest() { var mockDependency = new Mock <ILicenseRepository>(); var modelLicenseModel = new LicenseModel() { ClientName = "test", }; var modelLicenses = new Licenses() { Number = "XXX-XXX-XXX-XXX", Id = 1, }; mockDependency.Setup(x => x.Insert(modelLicenses)).Returns(() => true); // Act var controller = new LicenseController() { AppRepo = mockDependency.Object }; // Assert var res = controller.PostReturnId(modelLicenseModel); if (res?.Data != null) { Assert.AreEqual("Id Client is required", res.Description); Assert.AreEqual(0, res.Data); } else { Assert.AreEqual(1, 2); } }
private static void LicensesRecords(DataBaseContext context) { if (context.Licenses.Any()) { return; } var license = new Licenses { Id = 1, IsActive = true, AssignedVersion = 1, IdClients = 1, Creation = DateTime.Now, Expiration = DateTime.Now.AddDays(100), Inclusion = DateTime.Now, IsActivated = false, Number = "1111-1111-1111-1111", IdentityNumber = null, IdApplication = 1, }; context.Licenses.Add(license); context.SaveChanges(); }
/// <summary> /// Gets and displays the licenses for the specified Programid. /// </summary> /// <param name="programid">The Programid to fetch the licenses for.</param> private void GetLicenses(object programid) { // Alerts the user that the licenses are being downloaded. Variables.Containers.Main.SetStatus("Loading licenses...", 3); Licenses.GetLicenses((string)programid); }
/// <summary> /// Clears all the global /// </summary> public static void ClearValues() { AccountingGroups.Clear(); CostProfileGroups.Clear(); CountriesOfOrigin.Clear(); CustomerIdConversions.Clear(); ExternalIdTypes.Clear(); ItemCategories.Clear(); ItemGroups.Clear(); ItemIds.Clear(); ItemIdSuffixes.Clear(); ItemRecords.Clear(); Languages.Clear(); Licenses.Clear(); LocalItemIds.Clear(); MetaDescriptions.Clear(); PricingGroups.Clear(); ProductCategories.Clear(); ProductFormats.Clear(); ProductGoups.Clear(); ProductLines.Clear(); Properties.Clear(); PsStatuses.Clear(); RequestStatus.Clear(); SpecialCharacters.Clear(); TariffCodes.Clear(); Territories.Clear(); ToolTips.Clear(); UpcProductFormatExceptions.Clear(); Upcs.Clear(); UserNames.Clear(); UserRoles.Clear(); WebCategoryList.Clear(); }
protected void GenerateProductKey_Click(object sender, EventArgs e) { var productPackage = CommerceCommon.GetProductPackage(base.CurrentSueetieProduct.ProductID); var purchase2 = new ProductPurchase { UserID = base.CurrentSueetieUserID, CartLinkID = CommerceCommon.GetCartLinkList(base.CurrentSueetieProduct.ProductID).Find(p => p.LicenseTypeID == 1).CartLinkID, ProductID = base.CurrentSueetieProduct.ProductID, PurchaseKey = CommerceCommon.GeneratePurchaseKey(), ActionID = 2 }; var productPurchase = purchase2; var num = Purchases.RecordPurchase(productPurchase); var spt = (SueetiePackageType)Enum.ToObject(typeof(SueetiePackageType), productPackage.PackageTypeID); var productLicense = new ProductLicense { License = LicensingCommon.CreateLicenseKey(SueetieLicenseType.Free, spt), PackageTypeID = productPackage.PackageTypeID, LicenseTypeID = 1, Version = productPackage.Version, UserID = base.CurrentSueetieUserID, CartLinkID = productPurchase.CartLinkID, PurchaseID = num }; Licenses.CreateProductLicense(productLicense); this.ltLicenseGeneration.Text = SueetieLocalizer.GetMarketplaceString("license_created_message"); this.ltNewLicense.Text = productLicense.License; this.SetActivePanel(this.pnlLicenseGeneration); }
private void LoadResources() { GitIgnores.Add(string.Empty, Strings.Common_ChooseAGitIgnore); SelectedGitIgnore = string.Empty; foreach (var line in _git.GetGitIgnores()) { GitIgnores.Add(line, $"{line} - .gitignore"); } Licenses.Add(string.Empty, Strings.Common_ChooseALicense); SelectedLicense = string.Empty; foreach (var line in _git.GetLicenses()) { Licenses.Add(line, line); } string defaultnamespace = _storage.GetUser().Username; foreach (var path in _web.GetNamespacesPathList()) { Namespaces.Add(path.id.ToString(), $"{path.name} - {path.full_path}"); if (path.full_path == defaultnamespace) { SelectedNamespaces = path.id.ToString(); } } }
public void PostReturnIdLicenseTest() { var mockDependency = new Mock <ILicenseRepository>(); var modelLicenseModel = new LicenseModel() { ClientName = "test", IdClient = 1, IdApplication = 5 }; var modelLicenses = new Licenses() { Number = "XXX-XXX-XXX-XXX", Id = 0, }; mockDependency.Setup(x => x.Insert(modelLicenses)).Returns(() => (bool)true); // Act var controller = new LicenseController { AppRepo = mockDependency.Object }; // Assert var res = controller.PostReturnId(modelLicenseModel); if (res?.Data != null) { Assert.AreEqual(modelLicenses.Id, res.Data); } else { Assert.AreEqual(1, 2); } }
public string TestAuth() { // Flickr downloader = new Flickr (this._apikey, this._email, this._password ); uploader = new Flickr(_apikey, _sharedsecret); return(uploader.AuthGetFrob()); // Looking to licenses try { Licenses licenses = uploader.PhotosLicensesGetInfo(); //foreach (License license in licenses.LicenseCollection) { // Console.WriteLine("License: {0} {1}", license.LicenseName, license.LicenseId); //} } catch (FlickrNet.FlickrException e) { Console.WriteLine(e.Code + ": " + e.Verbose); } // Searching some photos with a license int licenseNumber = 5; // att-sa string text = "infinity"; string[] tags = { "infinity", "love" }; photoURL = "http://www.flickr.com/photo_zoom.gne?id="; //for (int i=0; i < 2; i++) { // searchPags (text, 10, 1); // searchText (text); // searchTextLicense (text, licenseNumber); // searchTags (tags); //} }
private void LoadResources() { Licenses.Clear(); Licenses.Add(string.Empty, Strings.Common_ChooseALicense); SelectedLicense = string.Empty; foreach (var line in _git.GetLicenses()) { Licenses.Add(line, line); } Owners.Clear(); var user = _storage.GetUser(); if (user != null) { Owners.Add(new Ownership(user.Username, user.FullName, OwnershipTypes.User)); } Task.Run(async() => { var owners = await _web.GetUserOrginizationsAsync(); await ThreadingHelper.SwitchToMainThreadAsync(); foreach (var owner in owners) { Owners.Add(owner); } }); }
public void Restart() { DeselectMenuEntry(); NavState = PlayerNavigationState.FileSystem; delayElapsed = 10f; Password.Restart(); QuarantineTime = initQTime; if (Licenses.HasFlag(Licenses.BetterQuarantine)) { Licenses &= ~Licenses.BetterQuarantine; } if (Licenses.HasFlag(Licenses.QuarantineVirus)) { Licenses &= ~Licenses.QuarantineVirus; } if (Licenses.HasFlag(Licenses.CleanInfected)) { Licenses &= ~Licenses.CleanInfected; } Licenses = Licenses.None; usedLetters = null; usedLetters = new List <CoreComponent>(); }
public void Reload() { Licenses.Clear(); foreach (var item in LicenseRepository.RetrieveLicensesDueForRenewal(SpAgent.Product)) { Licenses.Add(item); } }
} // ToString public License GetLicense(string licenseId) { if (!LicensesSpecified || string.IsNullOrEmpty(licenseId)) { return(null); } return(Licenses.FirstOrDefault(license => string.Equals(license.Id, licenseId, StringComparison.InvariantCultureIgnoreCase))); } // GetLicense
public ActionResult LicenseDeleted(int id) { Licenses license = _context.Licenses.FirstOrDefault(x => x.Id == id); _context.Licenses.Remove(license); _context.SaveChanges(); return(RedirectToAction("AllLicense")); }
private void LoadResources() { Licenses.Add(string.Empty, Strings.Common_ChooseALicense); SelectedLicense = string.Empty; foreach (var line in _git.GetLicenses()) { Licenses.Add(line, line); } }
public bool InsertPermissions(Licenses license) { foreach (var row in license.Permissions) { row.IdLicense = license.Id; PermissionsRepository.Insert(row); } return(true); }
public IEnumerable <Models.License> Get(string license, string product) { var ip = _accessor.HttpContext.Connection.RemoteIpAddress.ToString(); if (license == "" || product == "") { yield return(null); } yield return(Licenses.GetLicense(product, license, ip)); }
private void m_LicenseInformationToolStripMenuItem_Click(object sender, EventArgs e) { using (LicenseForm dial = new LicenseForm(null, null, Assembly.GetEntryAssembly())) { Licenses cLicDial = new Licenses(); dial.SetAdditionalControl = cLicDial; dial.LicenceRequestMessageProvider = new LicenseForm.LicenceRequestMessageProviderDelegate(delegate() { return(cLicDial.GetLicenseMessageRequest()); }); dial.ShowDialog(this); } }
protected LicenseLevel(Licenses level, int lowRange, int highRange, Color?textBrush = null, string display = null) { this.Level = level; this.Name = level.ToString(); this.Display = string.IsNullOrWhiteSpace(display) ? this.Name.Substring(0, 1) : display; this.LowRange = lowRange; this.HighRange = highRange; this.TextColor = textBrush ?? Colors.White; this.BackgroundOverride = null; }
protected LicenseLevel(Licenses level, int lowRange, int highRange, Color?textColor = null, string display = null) { Level = level; Name = level.ToString(); Display = string.IsNullOrWhiteSpace(display) ? Name.Substring(0, 1) : display; LowRange = lowRange; HighRange = highRange; TextColor = textColor ?? Colors.White; BackgroundOverride = null; }
private void ShowLicenseDialog() { using (LicenseForm dial = new LicenseForm(null, null, Assembly.GetEntryAssembly())) { Licenses cLicDial = new Licenses(); dial.SetAdditionalControl = cLicDial; dial.LicenceRequestMessageProvider = new LicenseForm.LicenceRequestMessageProviderDelegate(() => cLicDial.GetLicenseMessageRequest()); dial.ShowDialog(this); } }
protected LicenseLevel(Licenses level, int lowRange, int highRange, Color? textBrush = null, string display = null) { this.Level = level; this.Name = level.ToString(); this.Display = string.IsNullOrWhiteSpace(display) ? this.Name.Substring(0, 1) : display; this.LowRange = lowRange; this.HighRange = highRange; this.TextColor = textBrush ?? Colors.White; this.BackgroundOverride = null; }
private async Task <CSTRepository?> FetchGithubRepositoryMetadata(PackageURL purl) { try { var github = new GitHubClient(new ProductHeaderValue("OSSGadget")); var ghRepository = await github.Repository.Get(purl.Namespace, purl.Name); if (ghRepository is null) { return(null); } Archived = ghRepository.Archived; CreatedAt = ghRepository.CreatedAt; UpdatedAt = ghRepository.UpdatedAt; Description = Utilities.GetMaxClippedLength(ghRepository.Description); IsFork = ghRepository.Fork; Forks = ghRepository.ForksCount; Homepage = Utilities.GetMaxClippedLength(ghRepository.Homepage); Id = ghRepository.Id; Language = Utilities.GetMaxClippedLength(ghRepository.Language); Name = ghRepository.Name; OpenIssuesCount = ghRepository.OpenIssuesCount; Parent = ghRepository.Parent?.Url; PushedAt = ghRepository.PushedAt; Size = ghRepository.Size; FollowersCount = ghRepository.StargazersCount; Uri = Utilities.GetMaxClippedLength(ghRepository.Url); StakeholdersCount = ghRepository.WatchersCount; if (ghRepository.License is not null) { Licenses ??= new List <License>(); Licenses.Add(new License() { Name = ghRepository.License.Name, Url = ghRepository.License.Url, SPIX_ID = ghRepository.License.SpdxId }); } Owner ??= new User() { Id = ghRepository.Owner.Id, Name = ghRepository.Owner.Name, Email = ghRepository.Owner.Email, Url = ghRepository.Owner.Url, Active = !ghRepository.Owner.Suspended }; } catch (Exception ex) { Logger.Debug($"Exception occurred while retrieving repository data: {ex}"); } return(this); }
} // GetLicense public LicensingData Clone() { var clone = new LicensingData { Licensed = Licensed.Clone(), Dependencies = Dependencies.Clone(), Licenses = Licenses.Clone() }; return(clone); } // Clone
public void LoadFromWeb() { if (GetLicenses() && !string.IsNullOrEmpty(licenceFile)) { Licenses = Licenses.LoadLicenses(licenceFile); } if (!Licenses.IsCache) { Licenses.SaveLicensesCache(); } }
private void AddThirdPartyIfExists(ZipArchive archive, string name) { var thirdParty = archive.GetEntry(name); if (thirdParty != null) { using var thirdPartyStream = thirdParty.Open(); using var licenseReader = new StreamReader(thirdPartyStream); Licenses.Add(License.GetLicense(LicenseType.ThirdPartyFile, licenseReader.ReadToEnd())); } }
private void licenseInformationToolStripMenuItem_Click(object sender, EventArgs e) { using (LicenseForm dial = new LicenseForm(Properties.Resources.about_CommServer, "Free ware", Assembly.GetEntryAssembly())) { Licenses cLicDial = new Licenses(); dial.SetAdditionalControl = cLicDial; dial.LicenceRequestMessageProvider = new LicenseForm.LicenceRequestMessageProviderDelegate( delegate() { return(cLicDial.GetLicenseMessageRequest()); }); dial.ShowDialog(); } }
private async void OnGenerateNewLicense() { var res = await ShowMessageAsync("Generate?", "Are you sure? Generate new license?", MessageDialogStyle.AffirmativeAndNegative, new MetroDialogSettings { AnimateShow = false }); if (res == MessageDialogResult.Affirmative) { Licenses.Add(GenerateNewLicense(LicensePeriod)); } }
public ActionResult LicenseCreated(Licenses license) { if (!ModelState.IsValid) { ModelState.AddModelError("", "Something went wrong!"); return(View("CreateLicense")); } _context.Licenses.Add(license); _context.SaveChanges(); return(RedirectToAction("AllLicense")); }
public LicensesSystem() { Licenses = Licenses.OpenLicensesCache(); GenerateList(); }
public void License(Licenses l) { if (!this.Started) return; Event e = new Event("ctD", this.SessionId, this.FlowNumber); e.Add("nm", "License"); string licenseType = ""; switch (l) { case Licenses.Free: { licenseType = "F"; break; } case Licenses.Trial: { licenseType = "T"; break; } case Licenses.Demo: { licenseType = "D"; break; } case Licenses.Registered: { licenseType = "R"; break; } case Licenses.Cracked: { licenseType = "C"; break; } } e.Add("vl", licenseType); this._array.Add(e); }
public void LoadFromWeb() { if(GetLicenses() && !string.IsNullOrEmpty(licenceFile)){ Licenses = Licenses.LoadLicenses(licenceFile); } if(!Licenses.IsCache){ Licenses.SaveLicensesCache(); } }