public class UserContacts
{
private const string CompanyName = "companyName";
private const string FirstName = "firstName";
private const string LastName = "lastName";
private const string Address1 = "address1";
private const string Address2 = "address2";
private const string CountryCode = "countryCode";
private const string Country = "country";
private const string City = "city";
private const string Email = "email";
private const string RegionCode = "regionCode";
private const string PostalCode = "postalCode";
private const string Phone = "phone";
private const string UpdateDateEpoch = "updateDateEpoch";
private const string IsNewAccount = "isNewAccount";
private const string SomeId = "someId";
private const string ShipPrefix = "ship_";
public static Dictionary<string, string> GetUserAttributes(string userName)
{
switch (userName.ToLower())
{
case "kalle":
return GetKalle();
case "tobi":
return GetTobi();
case "john":
return GetJohnDoe();
case "hacker":
return GetHacker();
case "blank":
return GetBlank();
default:
return GetKalle();
}
}
private static Dictionary<string, string> GetKalle()
{
var userAttribute = new Dictionary<string, string>();
userAttribute[FirstName] = "Kalle";
userAttribute[LastName] = "Kabowski";
userAttribute[Address1] = "Somewherestrasse 2";
userAttribute[CountryCode] = "DE";
userAttribute[Country] = "Deutschland";
userAttribute[Email] = "
[email protected]";
return userAttribute;
}
private static Dictionary<string, string> GetTobi()
{
var userAttribute = new Dictionary<string, string>();
userAttribute[SomeId] = "1234567";
userAttribute[Email] = "
[email protected]";
userAttribute[CompanyName] = "companyname";
userAttribute[FirstName] = "Tobi";
userAttribute[LastName] = "Krawallbruder";
userAttribute[Address1] = "Somewherestrasse 2";
userAttribute[Address2] = "3 Etage";
userAttribute[RegionCode] = "IL";
userAttribute[PostalCode] = "50935";
userAttribute[CountryCode] = "US";
userAttribute[Country] = "United States";
userAttribute[City] = "Chicago";
userAttribute[Phone] = "0221 1234556";
userAttribute[UpdateDateEpoch] = DateTime.Now.ToString();
userAttribute[IsNewAccount] = "false";
userAttribute[ShipPrefix + CompanyName] = "companyname 2.0";
userAttribute[ShipPrefix + FirstName] = "Tobi 2.0";
userAttribute[ShipPrefix + LastName] = "Krawallbruder 2.0";
userAttribute[ShipPrefix + Address1] = "Somewherestrasse 2.0";
userAttribute[ShipPrefix + Address2] = string.Empty;
userAttribute[ShipPrefix + RegionCode] = "ON";
userAttribute[ShipPrefix + City] = "Ontario";
userAttribute[ShipPrefix + PostalCode] = "50920";
userAttribute[ShipPrefix + CountryCode] = "CA";
userAttribute[ShipPrefix + Country] = "Canada";
return userAttribute;
}
private static Dictionary<string, string> GetJohnDoe()
{
var userAttribute = new Dictionary<string, string>();
userAttribute[SomeId] = "1234568";
userAttribute[Email] = "
[email protected]";
userAttribute[CompanyName] = "companyname";
userAttribute[FirstName] = "John";
userAttribute[LastName] = "Doe";
userAttribute[Address1] = "114 Long Beach Blvd";
userAttribute[Address2] = "3 Etage";
userAttribute[RegionCode] = "CA";
userAttribute[City] = "Long Beach";
userAttribute[PostalCode] = "90802";
userAttribute[CountryCode] = "US";
userAttribute[Country] = "United States";
userAttribute[Phone] = "0221 1234556";
userAttribute[UpdateDateEpoch] = DateTime.Now.ToString();
userAttribute[IsNewAccount] = "false";
return userAttribute;
}
private static Dictionary<string, string> GetHacker()
{
var userAttribute = new Dictionary<string, string>();
userAttribute[SomeId] = "<script type=\"text/javascript\">alert('someId');</script>";
userAttribute[Email] = "<script type=\"text/javascript\">alert('email');</script>";
userAttribute[CompanyName] = "<script type=\"text/javascript\">alert('company');</script>";
userAttribute[FirstName] = "<script type=\"text/javascript\">alert('firstname');</script>";
userAttribute[LastName] = "<script type=\"text/javascript\">alert('lastname');</script>";
userAttribute[Address1] = "<script type=\"text/javascript\">alert('address1');</script>";
userAttribute[Address2] = "<script type=\"text/javascript\">alert('address2');</script>";
userAttribute[RegionCode] = "<script type=\"text/javascript\">alert('region');</script>";
userAttribute[City] = "<script type=\"text/javascript\">alert('region');</script>";
userAttribute[PostalCode] = "<script type=\"text/javascript\">alert('postalcode');</script>";
userAttribute[CountryCode] = "<script type=\"text/javascript\">alert('countrycode');</script>";
userAttribute[Country] = "<script type=\"text/javascript\">alert('country');</script>";
userAttribute[Phone] = "<script type=\"text/javascript\">alert('phone');</script>";
userAttribute[UpdateDateEpoch] = DateTime.Now.ToString();
userAttribute[IsNewAccount] = "false";
return userAttribute;
}
private static Dictionary<string, string> GetBlank()
{
var userAttribute = new Dictionary<string, string>();
userAttribute[SomeId] = String.Empty;
userAttribute[Email] = String.Empty;
userAttribute[CompanyName] = String.Empty;
userAttribute[FirstName] = String.Empty;
userAttribute[LastName] = String.Empty;
userAttribute[Address1] = String.Empty;
userAttribute[Address2] = String.Empty;
userAttribute[City] = String.Empty;
userAttribute[RegionCode] = String.Empty;
userAttribute[PostalCode] = String.Empty;
userAttribute[CountryCode] = String.Empty;
userAttribute[Country] = String.Empty;
userAttribute[Phone] = String.Empty;
userAttribute[UpdateDateEpoch] = DateTime.Now.ToString();
userAttribute[IsNewAccount] = "false";
return userAttribute;
}
}