本文整理汇总了C#中AccountType.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# AccountType.ToString方法的具体用法?C# AccountType.ToString怎么用?C# AccountType.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AccountType
的用法示例。
在下文中一共展示了AccountType.ToString方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Account
public Account(User user, AccountType type)
{
_user = user;
_Id++;
_type = type;
_AccountId = type.ToString() + _Id.ToString();
}
示例2: setUserRole
public void setUserRole(String username, AccountType accountType)
{
AccountDAO accountDao = new AccountDAO();
AccountDTO accountDto = accountDao.find(username);
accountDto.accountType = accountType.ToString();
accountDao.merge(accountDto);
}
示例3: SubCount
private void SubCount(int userId, AccountType accountType, int setCount, int? updateUserId)
{
var numCount = _userAccountRepository.SubCount(userId, accountType, setCount, updateUserId);
if (numCount != 1)
{
Logger.Warn(String.Format("减少{4}发生影响行数不为1,userid={0},foverCount={1},updateId={2},numCount={3}", userId, setCount, updateUserId, numCount, accountType.ToString()));
}
}
示例4: TestContext
public TestContext(AccountType accType)
{
this.AccountType = accType;
if (AccountType == AccountType.Gross)
Symbol = "EURUSD";
else
Symbol = "EUR/USD";
VeryLowPrice = 0.5;
VeryHighPrice = 1.5;
Volume = 10000;
this.Comment = string.Format("UnitTest for {0} account", accType.ToString());
}
示例5: Given_an_account
private Account Given_an_account(AccountType type = AccountType.Sales)
{
return Api.Accounts
.Where(string.Format("Type == \"{0}\"", type.ToString().ToUpper()))
.Find()
.FirstOrDefault() ??
Api.Create(new Account
{
Name = Random.GetRandomString(20),
Code = Random.GetRandomString(10),
Type = type
});
}
示例6: SetAccountType
public void SetAccountType(AccountType type)
{
if (Application.platform != RuntimePlatform.OSXEditor && Application.platform != RuntimePlatform.WindowsEditor && this.mAccount != null)
{
AndroidJavaClass androidJavaClass = new AndroidJavaClass("com.tendcloud.tenddata.TDGAAccount$AccountType");
AndroidJavaObject androidJavaObject = androidJavaClass.CallStatic<AndroidJavaObject>("valueOf", new object[]
{
type.ToString()
});
this.mAccount.Call("setAccountType", new object[]
{
androidJavaObject
});
}
}
示例7: TryParseAccountType
private static bool TryParseAccountType(string value, out AccountType accountType)
{
var success = Enum.TryParse(value, out accountType);
if (!success) return false;
decimal d;
var isInvalid = Decimal.TryParse(accountType.ToString(), out d);
return !isInvalid;
}
示例8: createHttpClient
private HttpClient createHttpClient(Uri baseUri, string userName, string password,
AccountType? accountType, IWebProxy proxy, bool compressionEnabled, TimeSpan timeout)
{
bool autenticationDisabled = string.IsNullOrEmpty(userName) && string.IsNullOrEmpty(password);
HttpClientHandler handler = new HttpClientHandler
{
AutomaticDecompression = compressionEnabled
? DecompressionMethods.GZip | DecompressionMethods.Deflate
: DecompressionMethods.None,
Credentials = autenticationDisabled ? null : createCredentials(baseUri, userName, password),
PreAuthenticate = !autenticationDisabled,
UseProxy = proxy != null,
Proxy = proxy
};
HttpClient client = new HttpClient(handler, true)
{
BaseAddress = baseUri,
Timeout = timeout
};
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue(_defaultMediaType));
if (compressionEnabled)
{
client.DefaultRequestHeaders.AcceptEncoding.Add(StringWithQualityHeaderValue.Parse("gzip"));
client.DefaultRequestHeaders.AcceptEncoding.Add(StringWithQualityHeaderValue.Parse("deflate"));
}
if (!autenticationDisabled && accountType != null)
client.DefaultRequestHeaders.Add(_accountTypeHeaderName, accountType.ToString());
return client;
}
示例9: Create
/// <summary>
/// Creates an account given the <see cref="T:AccountType"/> to create.
/// </summary>
/// <param name="accountType">The <see cref="T:AccountType"/> of the account to create.</param>
/// <returns>The newly created account.</returns>
public static Account Create(AccountType accountType)
{
return Create(accountType.ToString());
}
示例10: CreateAccount
public AccountBase CreateAccount(AccountType accountType)
{
var objectHandle = Activator.CreateInstance(null, string.Format("{0}Account", accountType.ToString()));
return (AccountBase)objectHandle.Unwrap();
}
示例11: SaveIndex
private void SaveIndex(List<Guid> indexItems, AccountType accountType)
{
Dictionary<string, string> results = new Dictionary<string, string>();
Uri indexFileUri = new Uri("/" + accountType.ToString() + "Index.txt", UriKind.Relative);
using (Package package = ZipPackage.Open(this.FilePath, System.IO.FileMode.OpenOrCreate)) {
// Either get the existing PackagePart or create a new one
PackagePart indexPart = null;
if (package.PartExists(indexFileUri)) {
indexPart = package.GetPart(indexFileUri);
} else {
indexPart = package.CreatePart(indexFileUri, "text/xml");
}
// Now write the settings to the package
using (StreamWriter sw = new StreamWriter(indexPart.GetStream())) {
foreach (Guid accountId in indexItems) {
sw.WriteLine(accountId.ToString());
}
}
}
}
示例12: ReadIndex
private List<Guid> ReadIndex(AccountType accountType)
{
List<Guid> results = new List<Guid>();
Uri indexFileUri = new Uri("/" + accountType.ToString() + "Index.txt", UriKind.Relative);
using (Package package = ZipPackage.Open(this.FilePath, System.IO.FileMode.OpenOrCreate)) {
if (package.PartExists(indexFileUri)) {
PackagePart indexPart = package.GetPart(indexFileUri);
using (StreamReader reader = new StreamReader(indexPart.GetStream())) {
string line = null;
while ((line = reader.ReadLine()) != null) {
Guid accountId = new Guid(line);
results.Add(accountId);
}
}
}
}
return results;
}
示例13: DeleteProvider
public ActionResult DeleteProvider(string timelineId, string user, AccountType accountType)
{
var config = SocialAllianceConfig.Read();
var timelineConfig = config.ReadTimeline(timelineId, true);
try
{
if (accountType == AccountType.youTube)
{
timelineConfig.YouTubeProviders.Remove(user);
}
else
{
timelineConfig.TwitterProviders.Remove(user);
}
SocialAllianceConfig.CreateOrUpdateTimeline(timelineConfig);
}
catch
{
TempData["Error"] = "There was an error deleting the entry, maybe it has already been deleted.";
}
return PartialView("_" + accountType.ToString() + "ProvidersListPartial", timelineConfig);
}