本文整理汇总了C#中MySqlDatabase.GetProductNames方法的典型用法代码示例。如果您正苦于以下问题:C# MySqlDatabase.GetProductNames方法的具体用法?C# MySqlDatabase.GetProductNames怎么用?C# MySqlDatabase.GetProductNames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MySqlDatabase
的用法示例。
在下文中一共展示了MySqlDatabase.GetProductNames方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FillAccountInformation
private void FillAccountInformation()
{
try
{
const string spanFormat = "<span class=\"accountData\">{0}</span>";
using (Database db = new MySqlDatabase())
{
UserInfo ui = db.GetUser(Util.UserId);
ClientInfo ci = db.GetClientInfo(Util.UserId);
CultureInfo cultureInfo = CultureInfo.CurrentCulture;
CountryInfo countryInfo = Util.GetCountryInfo(ci.Country);
if (countryInfo != null)
//cultureInfo = new CultureInfo(countryInfo.CultureName);
cultureInfo = new CultureInfo(cultureInfo.LCID);
string name = ci.GetFullName();
if (!string.IsNullOrEmpty(ci.AccountOwner))
name = ci.AccountOwner;
string subTypeName = "???";
string[] productNames = db.GetProductNames();
int subType = ui.SubscriptionType;
if (subType > 0)
--subType;
if (subType > -1 && subType < productNames.Length)
subTypeName = productNames[subType];
ButtonEditAccount.NavigateUrl = "~/Member/MemberEdit.aspx?mode=edit&pid=" + ui.SubscriptionType;
AccountNameLabel.Text = string.Format(spanFormat, ci.GetFullName());
string gender = string.Empty;
switch (ci.Gender)
{
case 'F':
gender = Resources.Resource.Female;
break;
case 'M':
gender = Resources.Resource.Male;
break;
}
Gender.Text = gender;
Birthdate.Text = ci.Birthdate.ToString("dd-MM-yyyy");
StringBuilder sb = new StringBuilder();
sb.Append(ci.AddressLine1);
if (!string.IsNullOrEmpty(ci.AddressLine2))
{
sb.Append("<br/>");
sb.Append(ci.AddressLine2);
}
sb.Append("<br/>");
sb.Append(ci.ZipCode);
sb.Append(" ");
sb.Append(ci.City);
sb.Append(", ");
sb.Append(ci.State);
sb.Append("<br/>");
sb.Append(ci.Country);
Address.Text = string.Format(spanFormat, sb.ToString());
Telephone.Text = string.Format(spanFormat, ci.Telephone);
MemberSinceLabel.Text = string.Format(spanFormat, ui.MemberSince.Date.ToString("D", cultureInfo));
EmailLabel.Text = string.Format(spanFormat, ui.Email);
IamLabel.Text = string.Format(spanFormat, ci.OwnerKind);
BumaCodeLabel.Text = string.Format(spanFormat, ci.BumaCode);
TwitterIdLabel.Text = string.Format(spanFormat, ci.TwitterId);
FacebookIdLabel.Text = string.Format(spanFormat, ci.FacebookId);
SoundCloudLabel.Text = string.Format(spanFormat, ci.SoundCloudId);
SoniallIdLabel.Text = string.Format(spanFormat, ci.SoniallId);
SenaCodeLabel.Text = string.Format(spanFormat, ci.SenaCode);
IsrcCodeLabel.Text = string.Format(spanFormat, ci.IsrcCode);
//CreditLiteral.Text = string.Format(spanFormat, ui.Credits);
string userDocPath = db.GetUserDocumentPath(ui.UserId, Session["access"] as string);
string identDocName = string.Format("ID{0:D10}.cer", ui.UserId);
string identDocPath = Path.Combine(userDocPath, identDocName);
// Assume the button will need to be visible, if not so we will discover afterwards
UploadCredentialsButton.Visible = true;
if (File.Exists(identDocPath))
{
IdentityCertificate.Text = Path.GetFileName(identDocPath);
DownloadIdent.Visible = true;
DownloadIdent.NavigateUrl = string.Format("~/DownloadHandler.ashx?file='{0}'", identDocPath);
UploadCredentialsButton.Visible = false;
}
else
{
// credential document has been marked as 'old' due to changed information
// of the client and no new credential file has been uploaded
identDocName = string.Format("ID{0:D10}.0.cer", ui.UserId);
identDocPath = Path.Combine(userDocPath, identDocName);
if (File.Exists(identDocPath))
{
IdentityCertificate.Text = Path.GetFileName(identDocPath);
DownloadIdent.Visible = true;
DownloadIdent.NavigateUrl = string.Format("~/DownloadHandler.ashx?file='{0}'", identDocPath);
}
}
}
}
//.........这里部分代码省略.........