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


C# SedogoUser.Add方法代码示例

本文整理汇总了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());
    }
开发者ID:sedogo,项目名称:Sedogo,代码行数:15,代码来源:addUser.aspx.cs

示例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=\"\">");
//.........这里部分代码省略.........
开发者ID:sedogo,项目名称:Sedogo,代码行数:101,代码来源:register.aspx.cs


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