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


C# SedogoUser.Update方法代码示例

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


在下文中一共展示了SedogoUser.Update方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: saveButton_Click

    //===============================================================
    // Function: saveButton_Click
    //===============================================================
    public void saveButton_Click(object sender, EventArgs e)
    {
        SedogoUser user = new SedogoUser(Session["loggedInUserFullName"].ToString(),
            int.Parse(Session["loggedInUserID"].ToString()));

        if (profilePicFileUpload.PostedFile.ContentLength != 0)
        {
            int fileSizeBytes = profilePicFileUpload.PostedFile.ContentLength;

            GlobalData gd = new GlobalData((string)Session["loggedInUserFullName"]);
            string fileStoreFolder = gd.GetStringValue("FileStoreFolder") + @"\temp";

            string originalFileName = Path.GetFileName(profilePicFileUpload.PostedFile.FileName);
            string destPath = Path.Combine(fileStoreFolder, originalFileName);
            int status = -1;
            if ((profilePicFileUpload.PostedFile.ContentType == "image/jpeg"
                || profilePicFileUpload.PostedFile.ContentType == "image/gif"
                || profilePicFileUpload.PostedFile.ContentType == "image/png")
                && Path.GetExtension(destPath) != ""
                )
            {
                destPath = destPath.Replace(" ", "_");
                destPath = MiscUtils.GetUniqueFileName(destPath);
                string savedFilename = Path.GetFileName(destPath);

                profilePicFileUpload.PostedFile.SaveAs(destPath);

                status = MiscUtils.CreatePreviews(Path.GetFileName(destPath),
                    int.Parse(Session["loggedInUserID"].ToString()));
            }

            if (status >= 0)
            {
                Response.Redirect("profileRedirect.aspx");
            }
            else
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "Alert", "alert(\"This type of image is not supported, please choose another.\");", true);
            }
        }
        else
        {
            user.avatarNumber = int.Parse(avatarComboBox.SelectedValue);
            user.Update();

            Response.Redirect("profileRedirect.aspx");
        }
    }
开发者ID:sedogo,项目名称:site,代码行数:51,代码来源:setProfileImage.aspx.cs

示例2: Page_Load

    //===============================================================
    // Function: Page_Load
    //===============================================================
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string GUID = "";
            if (Request.QueryString["G"] != null)
            {
                GUID = (string)Request.QueryString["G"];
            }

            int userID = -1;
            if (GUID != "")
            {
                userID = SedogoUser.GetUserIDFromGUID(GUID);
            }

            if (userID > 0)
            {
                SedogoUser newUser = new SedogoUser("", userID);
                if (newUser.loginEnabled == true)
                {
                    Session["SedogoConfirmError"] = "AlreadyActivated";
                    Response.Redirect("confirmError.aspx");
                }
                else
                {
                    newUser.loginEnabled = true;
                    newUser.Update();
                }
            }
            else
            {
                Session["SedogoConfirmError"] = "InvalidUser";
                Response.Redirect("confirmError.aspx");
            }
        }
    }
开发者ID:sedogo,项目名称:site,代码行数:40,代码来源:default.aspx.cs

示例3: saveButton_Click

    //===============================================================
    // Function: saveButton_Click
    //===============================================================
    protected void saveButton_Click(object sender, EventArgs e)
    {
        int userID = int.Parse(Request.QueryString["UID"]);

        SedogoUser sedogoUser = new SedogoUser(Session["loggedInAdministratorName"].ToString(),
            userID);
        sedogoUser.firstName = firstNameTextBox.Text;
        sedogoUser.lastName = lastNameTextBox.Text;
        sedogoUser.emailAddress = emailAddress.Text;
        sedogoUser.Update();

        string newPassword = userPassword.Text.Trim();
        if (newPassword != "")
        {
            sedogoUser.UpdatePassword(userPassword.Text);
        }
        userPassword.Text = "";
    }
开发者ID:sedogo,项目名称:Sedogo,代码行数:21,代码来源:editUser.aspx.cs

示例4: SaveFacebookID

    private void SaveFacebookID(SedogoUser user)
    {
        try{

            if (user.facebookUserID < 0 && Session["facebookUserID"] != null)
            {
                user.facebookUserID = (long)Session["facebookUserID"];
                user.Update();
            }
        }
        catch(Exception ex)
        {
            Sedogo.BusinessObjects.ErrorLog errorLog = new Sedogo.BusinessObjects.ErrorLog();
            errorLog.WriteLog("login", "SaveFacebookID", ex.Message,
                Sedogo.BusinessObjects.logMessageLevel.errorMessage);
        }
    }
开发者ID:sedogo,项目名称:Sedogo,代码行数:17,代码来源:login.aspx.cs

示例5: saveChangesButton_click

    //===============================================================
    // Function: saveChangesButton_click
    //===============================================================
    protected void saveChangesButton_click(object sender, EventArgs e)
    {
        string emailAddress = emailAddressTextBox.Text;
        emailAddress = emailAddress.Trim().ToLower();

        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;
        }

        SedogoUser user = new SedogoUser(Session["loggedInUserFullName"].ToString(),
            int.Parse(Session["loggedInUserID"].ToString()));

        user.firstName = firstNameTextBox.Text;
        user.lastName = lastNameTextBox.Text;
        user.emailAddress = emailAddress;
        if (genderMaleRadioButton.Checked == true)
        {
            user.gender = "M";
        }
        else
        {
            user.gender = "F";
        }
        user.homeTown = homeTownTextBox.Text;
        if (dateOfBirth > DateTime.MinValue)
        {
            user.birthday = dateOfBirth;
        }
        user.profileText = headlineTextBox.Text;
        user.timezoneID = int.Parse(timezoneDropDownList.SelectedValue);
        user.enableSendEmails = enableEmailCheckbox.Checked;
        user.avatarNumber = int.Parse(avatarComboBox.SelectedValue);
        user.Update();

        Session["loggedInUserFirstName"] = user.firstName;
        Session["loggedInUserLastName"] = user.lastName;
        Session["loggedInUserEmailAddress"] = user.emailAddress;
        Session["loggedInUserFullName"] = user.firstName + " " + user.lastName;

        Response.Redirect("profileRedirect.aspx");
    }
开发者ID:sedogo,项目名称:site,代码行数:52,代码来源:editProfile.aspx.cs


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