当前位置: 首页>>代码示例>>C#>>正文


C# MySqlDatabase.GetProductNames方法代码示例

本文整理汇总了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);
                        }
                    }
                }
            }
//.........这里部分代码省略.........
开发者ID:nageshverma2003,项目名称:TrackProtectSource,代码行数:101,代码来源:AccountOverview.aspx.cs


注:本文中的MySqlDatabase.GetProductNames方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。