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


C# MySqlDatabase.GetSetting方法代码示例

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


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

示例2: GetConfiguration

 private string GetConfiguration(string key)
 {
     string res = null;
     using (Database db = new MySqlDatabase())
     {
         res = db.GetSetting(key);
     }
     return res;
 }
开发者ID:nageshverma2003,项目名称:TrackProtectSource,代码行数:9,代码来源:fbsignup.aspx.cs

示例3: FillFacebookInfo

        private bool FillFacebookInfo()
        {
            if (!string.IsNullOrEmpty(_clientInfo.FacebookId))
            {
                using (Database db = new MySqlDatabase())
                {
                    ClientInfo ci = db.GetClientInfo(Util.UserId);

                    AuthenticationService authServices = new AuthenticationService();

                    Me me;

                    string accessToken = string.Empty;

                    if (authServices.TryAuthenticate(out me, out accessToken))
                    {
                        Session["FBACC"] = accessToken;

                        try
                        {
                            Session["FBID"] = me.Id;
                        }
                        catch { }

                        Session["AppId"] = db.GetSetting("facebook.app_id");

                        Session["AppSecret"] = db.GetSetting("facebook.app_secret");

                        cbxSendToFacebook.Enabled = true;

                        FacebookMsg.Enabled = true;

                        cbxSendToFacebook.Visible = true;

                        return true;
                    }
                    else
                    {
                        Session["FBACC"] = Session["FBID"] = Session["AppId"] = Session["AppSecret"] = null;

                        db.RemoveSocialCredential(ci.ClientId, SocialConnector.Facebook);
                        db.UpdateFacebookID(ci.ClientId);

                        cbxSendToFacebook.Enabled = false;

                        FacebookMsg.Enabled = false;

                        cbxSendToFacebook.Visible = false;

                        return false;
                    }
                }
            }

            Session["FBACC"] = Session["FBID"] = Session["AppId"] = Session["AppSecret"] = null;

            cbxSendToFacebook.Enabled = false;

            FacebookMsg.Enabled = false;

            cbxSendToFacebook.Visible = false;

            return false;
        }
开发者ID:nageshverma2003,项目名称:TrackProtectSource,代码行数:64,代码来源:RegisterDocument.aspx.cs


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