本文整理汇总了C#中Sedogo.BusinessObjects.SedogoUser.Add方法的典型用法代码示例。如果您正苦于以下问题:C# SedogoUser.Add方法的具体用法?C# SedogoUser.Add怎么用?C# SedogoUser.Add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sedogo.BusinessObjects.SedogoUser
的用法示例。
在下文中一共展示了SedogoUser.Add方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: saveButton_Click
//===============================================================
// Function: saveButton_Click
//===============================================================
protected void saveButton_Click(object sender, EventArgs e)
{
SedogoUser sedogoUser = new SedogoUser(Session["loggedInAdministratorName"].ToString());
sedogoUser.firstName = firstNameTextBox.Text;
sedogoUser.lastName = lastNameTextBox.Text;
sedogoUser.emailAddress = emailAddress.Text;
sedogoUser.Add();
sedogoUser.UpdatePassword(userPassword.Text);
Response.Redirect("editUser.aspx?UID=" + sedogoUser.userID.ToString());
}
示例2: registerUserButton_click
//===============================================================
// Function: registerUserButton_click
//===============================================================
protected void registerUserButton_click(object sender, EventArgs e)
{
if (registerCaptcha.IsValid == true)
{
string emailAddress = emailAddressTextBox.Text;
emailAddress = emailAddress.Trim().ToLower();
string userPassword = passwordTextBox1.Text.Trim();
// Verify this email has not been used before
int testUserID = SedogoUser.GetUserIDFromEmailAddress(emailAddress);
if (testUserID > 0)
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "Alert", "alert(\"This email address is already registered, please log in, or click on the forgot your password link on the home page.\");", true);
}
else
{
// Create the user
SedogoUser newUser = new SedogoUser("");
DateTime dateOfBirth;
if (dateOfBirthYear.SelectedIndex > 0 && dateOfBirthMonth.SelectedIndex > 0
&& dateOfBirthDay.SelectedIndex > 0)
{
dateOfBirth = new DateTime(int.Parse(dateOfBirthYear.SelectedValue),
int.Parse(dateOfBirthMonth.SelectedValue), int.Parse(dateOfBirthDay.SelectedValue));
}
else
{
dateOfBirth = DateTime.MinValue;
}
newUser.firstName = firstNameTextBox.Text;
newUser.lastName = lastNameTextBox.Text;
newUser.emailAddress = emailAddress;
if (genderMaleRadioButton.Checked == true)
{
newUser.gender = "M";
}
else
{
newUser.gender = "F";
}
newUser.homeTown = homeTownTextBox.Text;
if (dateOfBirth > DateTime.MinValue)
{
newUser.birthday = dateOfBirth;
}
newUser.timezoneID = int.Parse(timezoneDropDownList.SelectedValue);
//Nikita Knyazev. Facebook Authentication. Start
try
{
if (Session["facebookUserID"] != null)
newUser.facebookUserID = (long)Session["facebookUserID"];
}
catch (Exception ex)
{
}
//Nikita Knyazev. Facebook Authentication. Finish
newUser.avatarNumber = int.Parse(avatarComboBox.SelectedValue);
newUser.Add();
newUser.UpdatePassword(userPassword);
// Send registration email
GlobalData gd = new GlobalData((string)Session["loggedInUserFullName"]);
string siteBaseURL = gd.GetStringValue("SiteBaseURL");
StringBuilder emailBodyCopy = new StringBuilder();
emailBodyCopy.AppendLine("<html>");
emailBodyCopy.AppendLine("<head><title></title><meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">");
emailBodyCopy.AppendLine("<style type=\"text/css\">");
emailBodyCopy.AppendLine(" body, td, p { font-size: 15px; color: #9B9885; font-family: Arial, Helvetica, Sans-Serif }");
emailBodyCopy.AppendLine(" p { margin: 0 }");
emailBodyCopy.AppendLine(" h1 { color: #00ccff; font-size: 18px; font-weight: bold; }");
emailBodyCopy.AppendLine(" a, .blue { color: #00ccff; text-decoration: none; }");
emailBodyCopy.AppendLine(" img { border: 0; }");
emailBodyCopy.AppendLine("</style></head>");
emailBodyCopy.AppendLine("<body bgcolor=\"#f0f1ec\">");
emailBodyCopy.AppendLine(" <table width=\"692\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">");
//emailBodyCopy.AppendLine(" <tr><td colspan=\"3\"><img src=\"http://www.sedogo.com/email-template/images/email-template_01.png\" width=\"692\" height=\"32\" alt=\"\"></td></tr>");
emailBodyCopy.AppendLine(" <tr><td style=\"background: #fff\" width=\"30\"></td>");
emailBodyCopy.AppendLine(" <td style=\"background: #fff\" width=\"632\">");
emailBodyCopy.AppendLine(" <h1>Thanks for registering with Sedogo</h1>");
emailBodyCopy.AppendLine(" <p>Please click on the link below to confirm your email.</p>");
emailBodyCopy.AppendLine(" <p><a href=\"" + siteBaseURL + "/e/?G=" + newUser.GUID + "\"><u>click here</u></a>.</p>");
emailBodyCopy.AppendLine(" <br /><br />");
emailBodyCopy.AppendLine(" <p>Regards</p><a href=\"http://www.sedogo.com\" class=\"blue\"><strong>The Sedogo Team.</strong></a><br />");
emailBodyCopy.AppendLine(" <br /></td>");
emailBodyCopy.AppendLine(" <td style=\"background: #fff\" width=\"30\"></td></tr></table></body></html>");
// Old version, removed because of spam filters
//emailBodyCopy.AppendLine(" <br /><br /><br /><a href=\"http://www.sedogo.com\"><img src=\"http://www.sedogo.com/email-template/images/logo.gif\" /></a></td>");
//emailBodyCopy.AppendLine(" <td style=\"background: #fff\" width=\"30\"></td></tr><tr><td colspan=\"3\">");
//emailBodyCopy.AppendLine(" <img src=\"http://www.sedogo.com/email-template/images/email-template_05.png\" width=\"692\" height=\"32\" alt=\"\">");
//.........这里部分代码省略.........