Example #1
0
        public override bool Equals(object obj)
        {
            if (
                obj is TargetFeedConfig other &&
                (ContentType == other.ContentType) &&
                ((TargetURL is null && other.TargetURL is null) || TargetURL.Equals(other.TargetURL, StringComparison.OrdinalIgnoreCase)) &&
                (Type == other.Type) &&
                ((Token is null && other.Token is null) || Token.Equals(other.Token)) &&
                LatestLinkShortUrlPrefixes.SequenceEqual(other.LatestLinkShortUrlPrefixes) &&
                (AssetSelection == other.AssetSelection) &&
                (Isolated == other.Isolated) &&
                (Internal == other.Internal) &&
                (AllowOverwrite == other.AllowOverwrite) &&
                (Flatten == other.Flatten))
            {
                if (FilenamesToExclude is null)
                {
                    return(other.FilenamesToExclude is null);
                }

                if (other.FilenamesToExclude is null)
                {
                    return(false);
                }

                return(FilenamesToExclude.SequenceEqual(other.FilenamesToExclude));
            }

            return(false);
        }
Example #2
0
        public IActionResult Index(QueryParametersViewModel viewModel)
        {
            if (ModelState.IsValid)
            {
                var viewUrl = TargetURL.GenerateURL(viewModel.ToDictionary());
                TempData["url"] = viewUrl;
                return(RedirectToAction("Index"));
            }

            return(View(viewModel));
        }
 public override bool Equals(object obj)
 {
     return
         (obj is TargetFeedConfig other &&
          (ContentType == other.ContentType) &&
          TargetURL.Equals(other.TargetURL, StringComparison.OrdinalIgnoreCase) &&
          (Type == other.Type) &&
          Token.Equals(other.Token) &&
          LatestLinkShortUrlPrefix.Equals(other.LatestLinkShortUrlPrefix, StringComparison.OrdinalIgnoreCase) &&
          (AssetSelection == other.AssetSelection) &&
          (Isolated == other.Isolated) &&
          (Internal == other.Internal) &&
          (AllowOverwrite == other.AllowOverwrite));
 }
Example #4
0
        public string GetTargetURL(bool ShouldAddNetworkInformation = true)
        {
            if (ShouldAddNetworkInformation)
            {
                try
                {
                    var user     = Member.Current;
                    var username = user.Name;

                    if (IsFromAutomaticNetwork)
                    {
                        AffiliateNetwork Network = TableHelper.SelectRows <AffiliateNetwork>(TableHelper.MakeDictionary("DisplayName", this.AdvertiserUsername))[0];

                        if (Network.AffiliateNetworkSoftwareType == AffiliateNetworkSoftwareType.Performa)
                        {
                            return(TargetURL + username + "/" + NetworkName + "/");
                        }
                        else if (Network.AffiliateNetworkSoftwareType == AffiliateNetworkSoftwareType.CPALead)
                        {
                            return(TargetURL + username);
                        }
                        else if (Network.AffiliateNetworkSoftwareType == AffiliateNetworkSoftwareType.AdGateMedia)
                        {
                            return(TargetURL + username);
                        }
                    }

                    return(TargetURL.Replace(UsernameToReplace1, username).Replace(UsernameToReplace2, username)
                           .Replace(EmailToReplace1, user.Email).Replace(EmailToReplace2, user.Email)
                           .Replace(AgeToReplace1, user.Age.ToString()).Replace(AgeToReplace2, user.Age.ToString())
                           .Replace(GenderToReplace1, user.Gender.GetLetter()).Replace(GenderToReplace2, user.Gender.GetLetter()));
                }
                catch (Exception ex)
                { }
            }
            return(TargetURL);
        }
Example #5
0
 public static void Init(TestContext context)
 {
     URL = TargetURL.GenerateDefaultURL();
 }
        public void TestDefaultDeal()
        {
            var deal = RequestManager.GetDeal(TargetURL.GenerateDefaultURL());

            Assert.IsTrue(deal.IsValidDeal());
        }