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


C# MySqlDatabase.GetProductDescription方法代码示例

本文整理汇总了C#中MySqlDatabase.GetProductDescription方法的典型用法代码示例。如果您正苦于以下问题:C# MySqlDatabase.GetProductDescription方法的具体用法?C# MySqlDatabase.GetProductDescription怎么用?C# MySqlDatabase.GetProductDescription使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MySqlDatabase的用法示例。


在下文中一共展示了MySqlDatabase.GetProductDescription方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            Session["bodyid"] = "user-home";

            if (!IsPostBack)
            {
                int ecl, vcl;
                Util.GetUserClearanceLevels(Util.UserId, out vcl, out ecl);

                int tmp = 0;
                int pid = -1;
                decimal tmpDec = 0m;
                decimal unitprice = 0m;

                if (Request.Params["pid"] != null)
                {
                    if (int.TryParse(Request.Params["pid"], out tmp))
                        pid = tmp;
                    Session["subscription.productid"] = pid;
                    Session["pid"] = pid;
                }

                string desc = string.Empty;
                using (Database db = new MySqlDatabase())
                {
                    UserInfo ui = db.GetUser(Util.UserId);
                    ClientInfo ci = db.GetClientInfo(Util.UserId);

                    DataSet ds = db.GetRegister(Util.UserId);
                    int protectedTracks = ds.Tables[0].Rows.Count;

                    LoggedOnTitle.Text = Resources.Resource.LoggedOnTitle;
                    LoggedOnUserName.Text = string.Format("<span><b>{0}</b></span>", ci.FirstName); // ci.GetFullName());
                    CreditsLiteral.Text = Convert.ToString(Util.GetUserCredits(Util.UserId));
                    ProtectedLiteral.Text = Convert.ToString(protectedTracks);
                    decimal percentComplete = 0m;
                    if (Session["percentComplete"] != null)
                        percentComplete = Convert.ToDecimal(Session["percentComplete"]);
                    CompletedLiteral.Text = string.Empty;
                    if (percentComplete < 100)
                        CompletedLiteral.Text = string.Format(Resources.Resource.PercentComplete, percentComplete / 100m);
                    divAccPerCompleted.Visible = ClickToLinkLiteral.Visible = (CompletedLiteral.Text != string.Empty);

                    string unitpriceStr = db.GetSetting("unitprice");
                    if (decimal.TryParse(unitpriceStr, out tmpDec))
                        unitprice = tmpDec;
                    Session["subscription.unitprice"] = unitprice;
                    Session["amt"] = unitprice;

                    CultureInfo culture = null;

                    if (Convert.ToString(Session["culture"]).Contains("nl"))
                    {
                        culture = new CultureInfo("nl-NL");
                    }
                    else if (Convert.ToString(Session["culture"]).Contains("en"))
                    {
                        culture = new CultureInfo("en-US");
                    }
                    else
                    {
                        culture = new CultureInfo("nl-NL");
                    }

                    desc = db.GetProductDescription(pid, culture);
                    if (vcl >= 100 || ecl >= 100)
                        desc = Resources.Resource.SubscriptionPurchase;
                }

                SubscriptionLiteral.Text = desc;
            }

            if (Convert.ToString(Session["culture"]).Contains("nl"))
            {
                ClientScript.RegisterStartupScript
                    (this.GetType(), "HighLightLangBtn", "HighLightLangBtn('" + "ctl00_HeadLoginView_LanguageNL" + "');", true);
                ClientScript.RegisterStartupScript
                    (this.GetType(), "UnHighLightLangBtn", "UnHighLightLangBtn('" + "ctl00_HeadLoginView_LanguageUS" + "');", true);
            }
            else
            {
                ClientScript.RegisterStartupScript
                    (this.GetType(), "HighLightLangBtn", "HighLightLangBtn('" + "ctl00_HeadLoginView_LanguageUS" + "');", true);
                ClientScript.RegisterStartupScript
                    (this.GetType(), "UnHighLightLangBtn", "UnHighLightLangBtn('" + "ctl00_HeadLoginView_LanguageNL" + "');", true);
            }

            this.Page.Form.DefaultButton = SubscriptionSubmit.UniqueID;
        }
开发者ID:nageshverma2003,项目名称:TrackProtectSource,代码行数:89,代码来源:Subscription.aspx.cs


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