本文整理汇总了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;
}