本文整理汇总了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");
}
}
示例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");
}
}
}
示例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 = "";
}
示例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);
}
}
示例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");
}