本文整理汇总了C#中MySqlDatabase.UpdateSocialCredential方法的典型用法代码示例。如果您正苦于以下问题:C# MySqlDatabase.UpdateSocialCredential方法的具体用法?C# MySqlDatabase.UpdateSocialCredential怎么用?C# MySqlDatabase.UpdateSocialCredential使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MySqlDatabase
的用法示例。
在下文中一共展示了MySqlDatabase.UpdateSocialCredential方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Persist
public void Persist(
OAuthTokenResponse me,
string oauth_token,
string oauth_verifier)
{
if (_clientInfo == null)
GetUser();
using (Database db = new MySqlDatabase())
{
ClientInfo ci = db.GetClientInfo(Util.UserId);
db.UpdateSocialCredential(ci.ClientId, SocialConnector.Twitter, "twitterid", Convert.ToString(me.UserId));
db.UpdateSocialCredential(ci.ClientId, SocialConnector.Twitter, "oauthtoken", oauth_token);
db.UpdateSocialCredential(ci.ClientId, SocialConnector.Twitter, "oauthverifier", oauth_verifier);
_clientInfo.TwitterId = me.ScreenName;
db.RegisterClientInfo(
_clientInfo.LastName,
_clientInfo.FirstName,
_clientInfo.AddressLine1,
_clientInfo.AddressLine2,
_clientInfo.ZipCode,
_clientInfo.State,
_clientInfo.City,
_clientInfo.Country,
_clientInfo.Language,
_clientInfo.Telephone,
_clientInfo.Cellular,
_clientInfo.CompanyName,
_clientInfo.UserId,
_clientInfo.AccountOwner,
_clientInfo.BumaCode,
_clientInfo.SenaCode,
_clientInfo.IsrcCode,
_clientInfo.TwitterId,
_clientInfo.FacebookId,
_clientInfo.SoundCloudId,
_clientInfo.SoniallId,
_clientInfo.OwnerKind,
_clientInfo.CreditCardNr,
_clientInfo.CreditCardCvv,
_clientInfo.EmailReceipt,
_clientInfo.Referer,
_clientInfo.Gender,
_clientInfo.Birthdate,
_clientInfo.stagename);
}
}
示例2: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
string scope = Request.QueryString["scope"];
string access_token = Request.QueryString["access_token"];
if (!string.IsNullOrEmpty(access_token))
{
using (Database db = new MySqlDatabase())
{
UserInfo ui = db.GetUser(Util.UserId);
ClientInfo ci = db.GetClientInfo(ui.UserId);
db.UpdateSocialCredential(ci.ClientId, SocialConnector.SoundCloud, "access_token", access_token);
db.UpdateSocialCredential(ci.ClientId, SocialConnector.SoundCloud, "scope", scope);
db.UpdateSoundCloudId(ci.ClientId, GetUserData(access_token));
}
}
}
示例3: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
string retUrl = Request.Params["url"].Trim('#');
string accessToken = string.Empty;
using (Database db = new MySqlDatabase())
{
ClientInfo ci = db.GetClientInfo(Util.UserId);
string[] kvps = retUrl.Split('&');
foreach (string kvp in kvps)
{
string[] parts = kvp.Split('=');
if (parts.Length == 2)
{
string key = parts[0];
string val = parts[1];
if (val.EndsWith(",/social/soundcloud.aspx"))
val = val.Substring(0, val.Length - ",/social/soundcloud.aspx".Length);
if (string.Compare(key, "access_token", true) == 0)
accessToken = val;
db.UpdateSocialCredential(ci.ClientId, SocialConnector.SoundCloud, key, val);
}
}
}
if (!string.IsNullOrEmpty(accessToken))
{
string userName = GetUserData(accessToken);
using (Database db = new MySqlDatabase())
{
UserInfo ui = db.GetUser(Util.UserId);
ClientInfo ci = db.GetClientInfo(ui.UserId);
db.UpdateSoundCloudId(ci.ClientId, userName);
}
}
}
示例4: Persist
/// <summary>
/// Save Facebook data to the database
/// </summary>
/// <param name="me">Me info</param>
/// <param name="accessToken">Access token</param>
/// <param name="expires">Experiation of the access token</param>
public void Persist(Me me, string accessToken, DateTime expires)
{
if (_clientInfo == null) GetUser();
using (Database db = new MySqlDatabase())
{
db.UpdateSocialCredential(_clientInfo.ClientId, SocialConnector.Facebook, "facebookid", me.Id);
db.UpdateSocialCredential(_clientInfo.ClientId, SocialConnector.Facebook, "accesstoken", accessToken);
db.UpdateSocialCredential(_clientInfo.ClientId, SocialConnector.Facebook, "accesstokenexpires", expires.ToString("o"));
string facebookId = me.Name;
_clientInfo.FacebookId = facebookId;
db.RegisterClientInfo(
_clientInfo.LastName,
_clientInfo.FirstName,
_clientInfo.AddressLine1,
_clientInfo.AddressLine2,
_clientInfo.ZipCode,
_clientInfo.State,
_clientInfo.City,
_clientInfo.Country,
_clientInfo.Language,
_clientInfo.Telephone,
_clientInfo.Cellular,
_clientInfo.CompanyName,
_clientInfo.UserId,
_clientInfo.AccountOwner,
_clientInfo.BumaCode,
_clientInfo.SenaCode,
_clientInfo.IsrcCode,
_clientInfo.TwitterId,
_clientInfo.FacebookId,
_clientInfo.SoundCloudId,
_clientInfo.SoniallId,
_clientInfo.OwnerKind,
_clientInfo.CreditCardNr,
_clientInfo.CreditCardCvv,
_clientInfo.EmailReceipt,
_clientInfo.Referer,
_clientInfo.Gender,
_clientInfo.Birthdate,
_clientInfo.stagename);
}
}