本文整理汇总了C#中MySqlDatabase.RegisterClientInfo方法的典型用法代码示例。如果您正苦于以下问题:C# MySqlDatabase.RegisterClientInfo方法的具体用法?C# MySqlDatabase.RegisterClientInfo怎么用?C# MySqlDatabase.RegisterClientInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MySqlDatabase
的用法示例。
在下文中一共展示了MySqlDatabase.RegisterClientInfo方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ModifyClientInfo
private void ModifyClientInfo()
{
try
{
using (Database db = new MySqlDatabase())
{
ClientInfo ci = db.GetClientInfo(Util.UserId);
string lastName = ci.LastName;
string firstName = ci.FirstName;
string addressLine1 = ci.AddressLine1;
string addressLine2 = ci.AddressLine2;
string zipcode = ci.ZipCode;
string city = ci.City;
string state = ci.State;
string country = ci.Country;
string language = ci.Language;
string telephone = ci.Telephone;
string cellular = ci.Cellular; // Cellular.Text;
string accountOwner = ci.AccountOwner;
string bumaCode = BumaNo.Text.Trim();
string senaCode = SenaNo.Text.Trim();
string isrcCode = ISRC.Text.Trim();
string twitterId = ci.TwitterId.Trim();
string facebookId = ci.FacebookId.Trim();
string soundcloudId = ci.SoundCloudId.Trim();
string soniallId = ci.SoniallId.Trim();
string ownerKind = ci.OwnerKind;
string referer = ci.Referer;
char gender = ci.Gender;
string stagename = ci.stagename;
string companyname = ci.CompanyName;
DateTime birthday = Convert.ToDateTime(ci.Birthdate);
if (ci != null)
referer = ci.Referer;
db.RegisterClientInfo(lastName,
firstName,
addressLine1,
addressLine2,
zipcode,
state,
city,
country,
language,
telephone,
cellular,
companyname,
Util.UserId,
accountOwner,
bumaCode,
senaCode,
isrcCode,
twitterId,
facebookId,
soundcloudId,
soniallId,
ownerKind,
string.Empty,
string.Empty,
string.Empty,
referer,
gender,
birthday,
stagename);
// Remove the user's identification certificate so a new one
// can be registered.
UserInfo ui = db.GetUser(Util.UserId);
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);
if (File.Exists(identDocPath))
{
string filePattern = string.Format("ID{0:D10}.*.cer", ui.UserId);
string[] files = Directory.GetFiles(userDocPath, filePattern);
int highIndex = -1;
foreach (string file in files)
{
string filename = Path.GetFileName(file);
if (filename != null)
{
string[] parts = filename.Split('.');
if (parts.Length == 3)
{
int index;
if (int.TryParse(parts[1], out index))
{
if (index > highIndex)
highIndex = index;
}
}
}
}
if (highIndex > -1)
{
++highIndex;
while (highIndex > 0)
{
//.........这里部分代码省略.........
示例2: ModifyUserButtonClick
/// <summary>
/// Handler for the ModifyUserButton click event
/// </summary>
/// <param name="sender">the control that sent this event</param>
/// <param name="e">the arguments associated with the click</param>
public void ModifyUserButtonClick(Object sender, ImageClickEventArgs e)
{
try
{
string lastName = LastName.Text;
string firstName = FirstName.Text;
string addressLine1 = AddressLine1.Text;
string addressLine2 = AddressLine2.Text;
string zipcode = Zipcode.Text;
string city = City.Text;
string state = State.Text;
string country = string.Empty;
if (Country.SelectedIndex > -1)
country = Country.Items[Country.SelectedIndex].Text;
string language = string.Empty;
language = Language.SelectedIndex > -1 ? Language.Items[Language.SelectedIndex].Text : LanguageIndex.Value;
string telephone = Telephone.Text;
string cellular = string.Empty; // Cellular.Text;
string accountOwner = AccountOwner.Text;
string bumaCode = BumaID.Text;
string senaCode = SenaCode.Text;
string isrcCode = IsrcCode.Text;
string twitterId = TwitterID.Text;
string facebookId = FacebookID.Text;
string soundcloudId = SoundCloudID.Text;
string soniallId = SoniallID.Text;
string ownerKind = string.Empty;
//string emailReceipt = EmailForReceipt.Text;
//string referer = Referer.Text;
string referer = string.Empty;
char gender = Convert.ToChar(Gender.SelectedItem.Value);
DateTime birthday = Convert.ToDateTime("Birthday.Text");
//if (!DateTime.TryParse(Birthday.Text, culture, DateTimeStyles.AssumeLocal, out birthday))
// birthday = new DateTime(1, 1, 1, 0, 0, 0);
if (OwnerKind.SelectedIndex > -1)
ownerKind = OwnerKind.Items[OwnerKind.SelectedIndex].Text;
using (Database db = new MySqlDatabase())
{
ClientInfo ci = db.GetClientInfo(Util.UserId);
if (ci != null)
referer = ci.Referer;
db.RegisterClientInfo(lastName,
firstName,
addressLine1,
addressLine2,
zipcode,
state,
city,
country,
language,
telephone,
cellular,
Convert.ToString(ViewState["CompanyName"]),
Util.UserId,
accountOwner,
bumaCode,
senaCode,
isrcCode,
twitterId,
facebookId,
soundcloudId,
soniallId,
ownerKind,
string.Empty,
string.Empty,
Convert.ToString(ViewState["EmailReceipt"]),
referer,
gender,
birthday,
Convert.ToString(ViewState["StageName"]));
// Remove the user's identification certificate so a new one
// can be registered.
UserInfo ui = db.GetUser(Util.UserId);
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);
if (File.Exists(identDocPath))
{
string filePattern = string.Format("ID{0:D10}.*.cer", ui.UserId);
string[] files = Directory.GetFiles(userDocPath, filePattern);
int highIndex = -1;
foreach (string file in files)
{
string filename = Path.GetFileName(file);
if (filename != null)
{
string[] parts = filename.Split('.');
if (parts.Length == 3)
{
int index;
if (int.TryParse(parts[1], out index))
{
//.........这里部分代码省略.........
示例3: RegisterClientInfoUsingFBCredentials
void RegisterClientInfoUsingFBCredentials(string firstName, string lastName, string email, string pwd)
{
long userid = Util.UserId;
if (userid == 0)
{
// Oops, something went wrong, report it and bail out
return;
}
CultureInfo culture = new CultureInfo("nl-NL");
if (Session["culture"] != null)
culture = Session["culture"] as CultureInfo;
using (Database db = new MySqlDatabase())
{
string lastname = lastName;
string firstname = firstName;
string addressline1 = string.Empty; //GetStringFromWizardTextBox("AddressLine1");
string addressline2 = string.Empty; //GetStringFromWizardTextBox("AddressLine2");
string zipcode = string.Empty; //GetStringFromWizardTextBox("Zipcode");
string state = string.Empty; //GetStringFromWizardTextBox("State");
string city = string.Empty; //GetStringFromWizardTextBox("City");
string country = string.Empty;
string language = string.Empty; //GetStringFromWizardDropDown("Language");
if (string.IsNullOrEmpty(language))
{
language = LanguageIndex.Value;
}
language = string.Empty;
string telephone = string.Empty; //GetStringFromWizardTextBox("Telephone");
string cellular = string.Empty; //GetStringFromWizardTextBox("Cellular");
string companyname = string.Empty;
string accountowner = string.Empty;
string bumacode = string.Empty;
string senacode = string.Empty; //GetStringFromWizardTextBox("SenaCode");
string isrccode = string.Empty; //GetStringFromWizardTextBox("IsrcCode");
string twitterid = string.Empty; //GetStringFromWizardTextBox("TwitterID");
string facebookid = string.Empty; //GetStringFromWizardTextBox("FacebookID");
string soundcloudid = string.Empty;
string soniallid = string.Empty; //GetStringFromWizardTextBox("SoniallID");
string ownerkind = string.Empty;
string creditcardnr = string.Empty;
string creditcardcvv = string.Empty;
string emailforreceipt = email;
string referer = string.Empty; // GetStringFromWizardTextBox("Referer");
//string activationCode = GetStringFromWizardTextBox("ActivationCode");
char gender = '\0';
//string bday = GetStringFromWizardTextBox("Birthday");
string bday = string.Empty; //GetValueFromWizardWebDateChooser("Birthday");
string stagename = string.Empty;
DateTime birthday = new DateTime(1, 1, 1, 0, 0, 0);
//if (!DateTime.TryParse(bday, culture, DateTimeStyles.AssumeLocal, out birthday))
// birthday = new DateTime(1, 1, 1, 0, 0, 0);
long clientid = db.RegisterClientInfo(
lastname,
firstname,
addressline1,
addressline2,
zipcode,
state,
city,
country,
language,
telephone,
cellular,
companyname,
userid,
accountowner,
bumacode,
senacode,
isrccode,
twitterid,
facebookid,
soundcloudid,
soniallid,
ownerkind,
creditcardnr,
creditcardcvv,
emailforreceipt,
referer,
gender,
birthday,
stagename);
if (clientid == 0)
{
Literal ErrorMessage =
RegisterUser.CreateUserStep.ContentTemplateContainer.FindControl("ErrorMessage") as Literal;
if (ErrorMessage != null)
ErrorMessage.Text = Resources.Resource.CouldntRegister;
}
else
{
UserInfo ui = db.GetUser(userid);
ClientInfo ci = db.GetClientInfo(userid);
// When a user comes from an confirmation and used a different mail adres which was given in confirmation
// then the confirmation mail must be updated to keep the link. -Lambert 2012-12-1
Guid confirmationid;
if (!string.IsNullOrEmpty(Request.Params["id"]) && Guid.TryParse(Request.Params["id"], out confirmationid))
{
int tp;
//.........这里部分代码省略.........
示例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);
}
}
示例5: 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);
}
}