本文整理汇总了C#中Sedogo.BusinessObjects.SedogoUser类的典型用法代码示例。如果您正苦于以下问题:C# SedogoUser类的具体用法?C# SedogoUser怎么用?C# SedogoUser使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SedogoUser类属于Sedogo.BusinessObjects命名空间,在下文中一共展示了SedogoUser类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Page_Load
//===============================================================
// Function: Page_Load
//===============================================================
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
int eventID = int.Parse(Request.QueryString["EID"]);
SedogoEvent sedogoEvent = new SedogoEvent(Session["loggedInUserFullName"].ToString(), eventID);
eventNameLabel.Text = sedogoEvent.eventName;
SedogoUser eventOwner = new SedogoUser(Session["loggedInUserFullName"].ToString(), sedogoEvent.userID);
string dateString = "";
DateTime startDate = sedogoEvent.startDate;
MiscUtils.GetDateStringStartDate(eventOwner, sedogoEvent.dateType, sedogoEvent.rangeStartDate,
sedogoEvent.rangeEndDate, sedogoEvent.beforeBirthday, ref dateString, ref startDate);
eventDateLabel.Text = dateString;
eventVenueLabel.Text = sedogoEvent.eventVenue.Replace("\n", "<br/>");
deleteImageButton.Attributes.Add("onclick", "if(confirm('Are you sure you want to delete this picture?')){}else{return false}");
if (sedogoEvent.eventPicFilename == "")
{
deleteImageButton.Visible = false;
}
SetFocus(eventPicFileUpload);
}
}
示例2: Page_Load
//===============================================================
// Function: Page_Load
//===============================================================
protected void Page_Load(object sender, EventArgs e)
{
int userID = int.Parse(Request.QueryString["UID"].ToString());
int loggedInUserID = int.Parse(Session["loggedInUserID"].ToString());
SedogoUser user = new SedogoUser(Session["loggedInUserFullName"].ToString(), userID);
SedogoUser loggedInUser = new SedogoUser(Session["loggedInUserFullName"].ToString(), loggedInUserID);
sidebarControl.userID = loggedInUserID;
sidebarControl.user = loggedInUser;
userProfileControl.loggedInUserID = loggedInUserID;
userProfileControl.userID = userID;
userProfileControl.user = user;
eventsListControl.userID = userID;
eventsListControl.user = user;
if( userID == loggedInUserID )
{
//sendMessageToUserLink.Visible = false;
}
//sendMessageToUserLink.NavigateUrl = "sendUserMessage.aspx?EID=-1&UID=" + userID.ToString();
}
示例3: Page_Load
//===============================================================
// Function: Page_Load
//===============================================================
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
int eventID = int.Parse(Request.QueryString["EID"]);
int userID = int.Parse(Session["loggedInUserID"].ToString());
SedogoEvent sedogoEvent = new SedogoEvent(Session["loggedInUserFullName"].ToString(), eventID);
eventNameLabel.Text = sedogoEvent.eventName;
SedogoUser eventOwner = new SedogoUser(Session["loggedInUserFullName"].ToString(), sedogoEvent.userID);
string dateString = "";
DateTime startDate = sedogoEvent.startDate;
MiscUtils.GetDateStringStartDate(eventOwner, sedogoEvent.dateType, sedogoEvent.rangeStartDate,
sedogoEvent.rangeEndDate, sedogoEvent.beforeBirthday, ref dateString, ref startDate);
messageToLabel.Text = eventOwner.firstName + " " + eventOwner.lastName;
eventDateLabel.Text = dateString;
eventVenueLabel.Text = sedogoEvent.eventVenue.Replace("\n", "<br/>");
SetFocus(messageTextBox);
if (Session["SendMessageCaptcha"] == null || (string)Session["SendMessageCaptcha"] == "N")
{
registerCaptcha.Visible = true;
}
else
{
registerCaptcha.Visible = false;
}
}
}
示例4: Page_Load
//===============================================================
// Function: Page_Load
//===============================================================
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
int eventID = -1;
if (Request.QueryString["EID"] != null)
{
eventID = int.Parse(Request.QueryString["EID"]);
}
int messageToUserID = int.Parse(Request.QueryString["UID"]);
int parentMessageID = -1;
if (Request.QueryString["PMID"] != null)
{
parentMessageID = int.Parse(Request.QueryString["PMID"]);
}
int messageID = -1;
if (Request.QueryString["MID"] != null)
{
messageID = int.Parse(Request.QueryString["MID"]);
}
if (int.Parse(Session["loggedInUserID"].ToString()) == messageToUserID)
{
messageToUserID = Message.GetAltEmailUserID(parentMessageID, messageToUserID);
}
if( eventID > 0 )
{
goalNameDiv.Visible = true;
try
{
SedogoEvent sedogoEvent = new SedogoEvent(Session["loggedInUserFullName"].ToString(), eventID);
eventNameLabel.Text = sedogoEvent.eventName;
}
catch
{
eventNameLabel.Text = "";
}
}
else
{
goalNameDiv.Visible = false;
}
SedogoUser messageToUser = new SedogoUser(Session["loggedInUserFullName"].ToString(), messageToUserID);
messageToLabel.Text = messageToUser.firstName + " " + messageToUser.lastName;
SetFocus(messageTextBox);
if (Session["SendMessageCaptcha"] == null || (string)Session["SendMessageCaptcha"] == "N")
{
registerCaptcha.Visible = true;
}
else
{
registerCaptcha.Visible = false;
}
}
}
示例5: deleteButton_Click
//===============================================================
// Function: deleteButton_Click
//===============================================================
protected void deleteButton_Click(object sender, EventArgs e)
{
int userID = int.Parse(Request.QueryString["UID"]);
SedogoUser sedogoUser = new SedogoUser(Session["loggedInAdministratorName"].ToString(),
userID);
sedogoUser.Delete();
Response.Redirect("usersList.aspx");
}
示例6: Page_Load
//===============================================================
// Function: Page_Load
//===============================================================
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
int eventID = int.Parse(Request.QueryString["EID"]);
SedogoEvent sedogoEvent = new SedogoEvent("", eventID);
SedogoUser eventOwner = new SedogoUser("", sedogoEvent.userID);
int userID = -1;
if (Session["loggedInUserID"] != null)
{
userID = int.Parse(Session["loggedInUserID"].ToString());
}
sidebarControl.userID = userID;
string currentUserFullName = "";
if (userID > 0)
{
SedogoUser user = new SedogoUser("", userID);
sidebarControl.user = user;
bannerAddFindControl.userID = userID;
currentUserFullName = user.firstName + " " + user.lastName;
addressBookLink1.Visible = true;
addressBookLink2.Visible = true;
addressBookLink3.Visible = true;
addressBookLink4.Visible = true;
addressBookLink5.Visible = true;
}
else
{
addressBookLink1.Visible = false;
addressBookLink2.Visible = false;
addressBookLink3.Visible = false;
addressBookLink4.Visible = false;
addressBookLink5.Visible = false;
}
string dateString = "";
DateTime startDate = sedogoEvent.startDate;
MiscUtils.GetDateStringStartDate(eventOwner, sedogoEvent.dateType, sedogoEvent.rangeStartDate,
sedogoEvent.rangeEndDate, sedogoEvent.beforeBirthday, ref dateString, ref startDate);
additionalInviteTextTextBox.Text = currentUserFullName + " thought you might be interested in this.";
eventTitleLabel.Text = sedogoEvent.eventName;
eventOwnersNameLabel.Text = eventOwner.firstName + " " + eventOwner.lastName;
eventDateLabel.Text = dateString;
eventDescriptionLabel.Text = sedogoEvent.eventDescription.Replace("\n", "<br/>");
eventNameLabel.Text = sedogoEvent.eventName;
goalNameLabel.Text = sedogoEvent.eventName;
goalVenueLabel.Text = sedogoEvent.eventVenue;
editedDateLabel.Text = sedogoEvent.lastUpdatedDate.ToString("dd MMMM yyyy");
}
}
示例7: 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());
}
示例8: Page_Load
//===============================================================
// Function: Page_Load
//===============================================================
protected void Page_Load(object sender, EventArgs e)
{
int userID = -1;
if (Session["loggedInUserID"] != null)
{
userID = int.Parse(Session["loggedInUserID"].ToString());
SedogoUser user = new SedogoUser(Session["loggedInUserFullName"].ToString(), userID);
sidebarControl.user = user;
}
sidebarControl.userID = userID;
}
示例9: messagesRepeater_ItemDataBound
//===============================================================
// Function: messagesRepeater_ItemDataBound
//===============================================================
protected void messagesRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.DataItem != null &&
(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem))
{
DataRowView row = e.Item.DataItem as DataRowView;
int eventUserID = -1;
if (row["UserID"].ToString() != "")
{
eventUserID = int.Parse(row["UserID"].ToString());
}
Literal eventNameLabel = e.Item.FindControl("eventNameLabel") as Literal;
Literal userNameLabel = e.Item.FindControl("userNameLabel") as Literal;
if (eventUserID < 0)
{
int userID = int.Parse(row["UserID"].ToString());
SedogoUser messageToUser = new SedogoUser(Session["loggedInUserFullName"].ToString(), userID);
userNameLabel.Text = "To: <a href=\"userTimeline.aspx?UID=" + userID + "\" target=\"_top\">"
+ messageToUser.firstName + " " + messageToUser.lastName + "</a> ";
eventNameLabel.Text = "";
}
else
{
userNameLabel.Text = "To: <a href=\"userTimeline.aspx?UID=" + eventUserID + "\" target=\"_top\">"
+ row["FirstName"] + " " + row["LastName"] + "</a> ";
eventNameLabel.Text = "Goal: <a href=\"viewEvent.aspx?EID=" + row["EventID"] + "\">"
+ row["EventName"] + "</a>";
}
Image eventPicThumbnailImage = e.Item.FindControl("eventPicThumbnailImage") as Image;
string eventPicThumbnail = row["eventPicThumbnail"].ToString();
if (eventPicThumbnail == "")
{
eventPicThumbnailImage.ImageUrl = "./images/eventThumbnailBlank.png";
}
else
{
var eventID = int.Parse(row["EventID"].ToString());
var sedogoEvent = new SedogoEvent(string.Empty, eventID);
eventPicThumbnailImage.ImageUrl =
ResolveUrl(ImageHelper.GetRelativeImagePath(sedogoEvent.eventID, sedogoEvent.eventGUID,
ImageType.EventThumbnail));
//eventPicThumbnailImage.ImageUrl = "./assets/eventPics/" + eventPicThumbnail;
}
Literal messageLabel = e.Item.FindControl("messageLabel") as Literal;
messageLabel.Text = row["MessageText"].ToString();
}
}
示例10: dlMember_ItemDataBound
protected void dlMember_ItemDataBound(Object sender, DataListItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item ||
e.Item.ItemType == ListItemType.AlternatingItem)
{
// Retrieve the Label control in the current DataListItem.
Image profilePicImage = (Image)e.Item.FindControl("profilePicImage");
string profilePicThumbnail = ((DataRowView)e.Item.DataItem).Row.ItemArray[13].ToString();
//string profilePicThumbnail = ((DataRowView)e.Item.DataItem).Row.ItemArray[12].ToString();
int userID = int.Parse(((DataRowView)e.Item.DataItem).Row.ItemArray[0].ToString());
if (profilePicThumbnail != "")
{
profilePicImage.ImageUrl = "assets/profilePics/" + profilePicThumbnail;
}
else
{
SedogoUser user = new SedogoUser("", userID);
if (user.gender == "M")
{
// 1,2,5
int avatarID = 5;
switch ((userID % 6))
{
case 0: case 1: avatarID = 1; break;
case 2: case 3: avatarID = 2; break;
}
profilePicImage.ImageUrl = "~/images/avatars/avatar" + avatarID.ToString() + "sm.gif";
}
else
{
// 3,4,6
int avatarID = 6;
switch ((userID % 6))
{
case 0: case 1: avatarID = 3; break;
case 2: case 3: avatarID = 4; break;
}
profilePicImage.ImageUrl = "~/images/avatars/avatar" + avatarID.ToString() + "sm.gif";
}
}
profilePicImage.Height = 33;
profilePicImage.Width = 33;
profilePicImage.Style.Add("cursor", "pointer");
profilePicImage.Style.Add("padding-bottom", "6px");
profilePicImage.Style.Add("padding-right", "6px");
profilePicImage.Attributes.Add("onmouseover", "ShowHideDiv(" + userID.ToString() + ")");
}
}
示例11: Page_Load
//===============================================================
// Function: Page_Load
//===============================================================
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
int userID = int.Parse(Session["loggedInUserID"].ToString());
sidebarControl.userID = userID;
SedogoUser user = new SedogoUser(Session["loggedInUserFullName"].ToString(), userID);
sidebarControl.user = user;
bannerAddFindControl.userID = userID;
PopulateTrackedEventsList(userID);
}
}
示例12: achievedEventsRepeater_ItemDataBound
//===============================================================
// Function: achievedEventsRepeater_ItemDataBound
//===============================================================
protected void achievedEventsRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.DataItem != null &&
(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem))
{
DataRowView row = e.Item.DataItem as DataRowView;
int eventID = int.Parse(row["EventID"].ToString());
SedogoEvent sedogoEvent = new SedogoEvent(Session["loggedInUserFullName"].ToString(), eventID);
SedogoUser eventOwner = new SedogoUser("", sedogoEvent.userID);
string dateString = "";
DateTime startDate = sedogoEvent.startDate;
MiscUtils.GetDateStringStartDate(eventOwner, sedogoEvent.dateType, sedogoEvent.rangeStartDate,
sedogoEvent.rangeEndDate, sedogoEvent.beforeBirthday, ref dateString, ref startDate);
HyperLink eventNameLabel = e.Item.FindControl("eventNameLabel") as HyperLink;
eventNameLabel.NavigateUrl = "viewEvent.aspx?EID=" + row["EventID"].ToString();
eventNameLabel.Text = row["EventName"].ToString();
Label eventDateLabel = e.Item.FindControl("eventDateLabel") as Label;
eventDateLabel.Text = dateString;
Label dateAchievedLabel = e.Item.FindControl("dateAchievedLabel") as Label;
if (sedogoEvent.eventAchievedDate > DateTime.MinValue)
{
dateAchievedLabel.Text = sedogoEvent.eventAchievedDate.ToString("dd MMM yyyy");
}
else
{
dateAchievedLabel.Text = "";
}
//HyperLink userNameLabel = e.Item.FindControl("userNameLabel") as HyperLink;
//userNameLabel.Text = row["FirstName"].ToString() + " " + row["LastName"].ToString();
//userNameLabel.NavigateUrl = "userTimeline.aspx?UID=" + sedogoEvent.userID.ToString();
Image eventImage = e.Item.FindControl("eventImage") as Image;
string eventPicThumbnail = row["EventPicThumbnail"].ToString();
if (eventPicThumbnail == "")
{
eventImage.ImageUrl = "~/images/eventThumbnailBlank.png";
}
else
{
var _event = new SedogoEvent(string.Empty, eventID);
eventImage.ImageUrl = ResolveUrl(ImageHelper.GetRelativeImagePath(_event.eventID, _event.eventGUID, ImageType.EventThumbnail));
}
}
}
示例13: Page_Load
//===============================================================
// Function: Page_Load
//===============================================================
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
int userID = int.Parse(Request.QueryString["UID"]);
SedogoUser sedogoUser = new SedogoUser(Session["loggedInAdministratorName"].ToString(),
userID);
firstNameTextBox.Text = sedogoUser.firstName;
lastNameTextBox.Text = sedogoUser.lastName;
emailAddress.Text = sedogoUser.emailAddress;
deleteButton.Attributes.Add("onclick", "if(confirm('Are you sure you want to delete this user?')){document.forms[0].target = '_top';return true;}else{return false}");
}
}
示例14: 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");
}
}
示例15: 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 = "";
}