本文整理汇总了C#中DataLayer.GetMemberBy_Email方法的典型用法代码示例。如果您正苦于以下问题:C# DataLayer.GetMemberBy_Email方法的具体用法?C# DataLayer.GetMemberBy_Email怎么用?C# DataLayer.GetMemberBy_Email使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataLayer
的用法示例。
在下文中一共展示了DataLayer.GetMemberBy_Email方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnSubmit_Click
protected void btnSubmit_Click(object sender, EventArgs e)
{
DataLayer dl = new DataLayer();
if (dl.EmailExists(tbxEmail.Text))
{
string sPassword = dl.GetMemberBy_Email(tbxEmail.Text).Rows[0].ItemArray[1].ToString();
SmtpMail.SmtpServer = "relay-hosting.secureserver.net";
MailMessage mm;
mm = new MailMessage();
mm.BodyFormat = MailFormat.Html;
mm.To = tbxEmail.Text;
mm.From = "[email protected]";
mm.Subject = "Your password for ReferralNetworX.com";
mm.Body = "You requested to have your password sent to you. It is listed below.<br /><br />Username: " + tbxEmail.Text + "<br />Password: " + sPassword;
SmtpMail.Send(mm);
Session["resultColor"] = "#007700";
Session["resultTitle"] = "Password Sent";
Session["resultMessage"] = "Your password has been sent to your email.";
Session["resultReturnURL"] = "Default.aspx";
Response.Redirect("Result.aspx", true);
}
else
{
Session["resultColor"] = "#ff0000";
Session["resultTitle"] = "Email Not Found";
Session["resultMessage"] = "The email you provided was not found.";
Session["resultReturnURL"] = "Default.aspx";
Response.Redirect("Result.aspx", true);
}
}
示例2: btnSubmit_Click
protected void btnSubmit_Click(object sender, EventArgs e)
{
DataLayer dl = new DataLayer();
DataTable dt = dl.GetMemberBy_Email(sEmail);
string sTwitterFeedStyles = dt.Rows[0].ItemArray[32].ToString();
string sTwitterPassword = dt.Rows[0].ItemArray[27].ToString();
bool bUpdateTwitter = Convert.ToBoolean(dt.Rows[0].ItemArray[25]);
string sPersonalAvatar = dt.Rows[0].ItemArray[3].ToString();
if (fuPersonalAvatar.HasFile)
{
string sExt = fuPersonalAvatar.FileName.Remove(0, fuPersonalAvatar.FileName.LastIndexOf('.'));
fuPersonalAvatar.SaveAs(MapPath("~/images/MemberAvatars/" + lblEmail.Text + sExt));
sPersonalAvatar = lblEmail.Text + sExt;
}
string sBusinessLogo = dt.Rows[0].ItemArray[9].ToString();
if (fuBusinessLogo.HasFile)
{
string sExt = fuBusinessLogo.FileName.Remove(0, fuBusinessLogo.FileName.LastIndexOf('.'));
fuBusinessLogo.SaveAs(MapPath("~/images/BusinessLogos/" + lblEmail.Text + sExt));
sBusinessLogo = lblEmail.Text + sExt;
}
bool bAdmin = Convert.ToBoolean(dt.Rows[0].ItemArray[19]);
bool bModerator = Convert.ToBoolean(dt.Rows[0].ItemArray[20]);
bool bCanPostBlog = Convert.ToBoolean(dt.Rows[0].ItemArray[21]);
string sArticleCategory = dt.Rows[0].ItemArray[34].ToString();
dl.UpdateMember(sEmail, tbxName.Text, sPersonalAvatar, tbxPhone.Text, tbxInterests.Text.Replace("\n", "<br />").Replace("\r", ""), tbxWebsite.Text, tbxPersonalBio.Text.Replace("\n", "<br />").Replace("\r", ""), tbxBusinessName.Text, sBusinessLogo, tbxBusinessBio.Text.Replace("\n", "<br />").Replace("\r", ""), tbxAIM.Text, tbxMSN.Text, tbxYahoo.Text, tbxGoogleTalk.Text, tbxLocation.Text, tbxSignature.Text.Replace("\n", "<br />").Replace("\r", ""), bAdmin, bModerator, bCanPostBlog, cbxMemberNewsletter.Checked, cbxDailyMotivator.Checked, cbxShowEmail.Checked, bUpdateTwitter, tbxTwitterUsername.Text.Replace("@", ""), sTwitterPassword, ddlGender.SelectedValue, calBirthday.SelectedDate, ddlBusinessCategory.SelectedValue, sTwitterFeedStyles, sArticleCategory);
Session["resultColor"] = "#007700";
Session["resultTitle"] = "Profile Updated";
Session["resultMessage"] = "You Profile Has Been Updated Successfuly";
Session["resultReturnURL"] = "Profile.aspx?member=" + sEmail;
Response.Redirect("Result.aspx");
}
示例3: btnTwitterUpdate_Click
protected void btnTwitterUpdate_Click(object sender, EventArgs e)
{
DataLayer dl = new DataLayer();
DataTable dtMember = dl.GetMemberBy_Email(sMember);
string sTwitterUsername = dtMember.Rows[0].ItemArray[26].ToString();
string sTwitterPassword = dtMember.Rows[0].ItemArray[27].ToString();
Yedda.Twitter t = new Yedda.Twitter();
t.Update(sTwitterUsername, sTwitterPassword, tbxTwitterUpdate.Text, Yedda.Twitter.OutputFormatType.XML);
}
示例4: btnSumbit_Click
protected void btnSumbit_Click(object sender, EventArgs e)
{
DataLayer dl = new DataLayer();
DataTable dtMember = dl.GetMemberBy_Email(User.Identity.Name);
if (tbxPassword.Text == dtMember.Rows[0].ItemArray[1].ToString())
{
if (!dl.EmailExists(tbxEmail.Text))
{
string sPersonalAvatar = dtMember.Rows[0].ItemArray[3].ToString();
string sBusinessLogo = dtMember.Rows[0].ItemArray[9].ToString();
if (sPersonalAvatar != "no_avatar.gif")
{
string sExt = sPersonalAvatar.Remove(0, sPersonalAvatar.LastIndexOf('.'));
string sNewPersonalAvatar = tbxEmail.Text + sExt;
if (File.Exists(MapPath("~/images/MemberAvatars/" + sNewPersonalAvatar)))
File.Delete(MapPath("~/images/MemberAvatars/" + sNewPersonalAvatar));
File.Move(MapPath("~/images/MemberAvatars/" + sPersonalAvatar), MapPath("~/images/MemberAvatars/" + sNewPersonalAvatar));
sPersonalAvatar = sNewPersonalAvatar;
}
if (sBusinessLogo != "no_logo.gif")
{
string sExt = sBusinessLogo.Remove(0, sBusinessLogo.LastIndexOf('.'));
string sNewBusinessLogo = tbxEmail.Text + sExt;
if (File.Exists(MapPath("~/images/BusinessLogos/" + sNewBusinessLogo)))
File.Delete(MapPath("~/images/BusinessLogos/" + sNewBusinessLogo));
File.Move(MapPath("~/images/BusinessLogos/" + sBusinessLogo), MapPath("~/images/BusinessLogos/" + sNewBusinessLogo));
sBusinessLogo = sNewBusinessLogo;
}
FormsAuthentication.SignOut();
dl.UpdateMemberEmail(User.Identity.Name, tbxEmail.Text, sPersonalAvatar, sBusinessLogo);
FormsAuthentication.SetAuthCookie(tbxEmail.Text, false);
Session["resultColor"] = "#007700";
Session["resultTitle"] = "Email Changed";
Session["resultMessage"] = "Your email has been updated.";
Session["resultReturnURL"] = "Profile.aspx";
Response.Redirect("Result.aspx", true);
}
else
{
Session["resultColor"] = "#ff0000";
Session["resultTitle"] = "Email Exists";
Session["resultMessage"] = "The email you provided is already in use.";
Session["resultReturnURL"] = "ChangeEmail.aspx";
Response.Redirect("Result.aspx", true);
}
}
else
{
CustomValidator1.IsValid = false;
}
}
示例5: btnSumbit_Click
protected void btnSumbit_Click(object sender, EventArgs e)
{
DataLayer dl = new DataLayer();
DataTable dtMember = dl.GetMemberBy_Email(User.Identity.Name);
if (tbxCurrentPassword.Text == dtMember.Rows[0].ItemArray[1].ToString())
{
dl.UpdateMemberPassword(User.Identity.Name, tbxPassword.Text);
Session["resultColor"] = "#007700";
Session["resultTitle"] = "Password Changed";
Session["resultMessage"] = "Your password has been updated.";
Session["resultReturnURL"] = "Profile.aspx";
Response.Redirect("Result.aspx", true);
}
else
{
CustomValidator1.IsValid = false;
}
}
示例6: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
//if (!User.Identity.IsAuthenticated)
//{
// Session["resultColor"] = "#ff0000";
// Session["resultTitle"] = "Members Only";
// Session["resultMessage"] = "This is a members only area.<br />You must log in first.";
// Session["resultReturnURL"] = "Articles.aspx";
// Response.Redirect("Result.aspx", true);
//}
int iAID = 0;
if (Request.QueryString["aid"] == null)
{
Session["resultColor"] = "#ff0000";
Session["resultTitle"] = "No Article";
Session["resultMessage"] = "No Article Specified";
Session["resultReturnURL"] = "Articles.aspx";
Response.Redirect("Result.aspx", true);
}
else
{
iAID = Convert.ToInt32(Request.QueryString["aid"]);
}
DataLayer dl = new DataLayer();
if (User.Identity.IsAuthenticated)
{
loggedinpanels.Controls.Add(new LiteralControl("<div style=\"width:250px;\" class=\"contenttitle\">Featured Member</div><div class=\"contentpanel\">"));
DataTable dtRandomMember = dl.GetRandomMember();
loggedinpanels.Controls.Add(new LiteralControl("<table style=\"width:100%;\"><tr><td style=\"font-size:13px;text-align:center;\"><a href=\"Profile.aspx?member=" + dtRandomMember.Rows[0].ItemArray[0].ToString() + "\"><img style=\"border-width:0px;\" src=\"MakeThumbnail.aspx?size=100&image=images/MemberAvatars/" + dtRandomMember.Rows[0].ItemArray[3].ToString() + "\" /></a><br /><a href=\"Profile.aspx?member=" + dtRandomMember.Rows[0].ItemArray[0].ToString() + "\">View Profile</a></td><td style=\"padding-left:5px;font-size:13px;width:100%;\"><b>Name:</b> " + dtRandomMember.Rows[0].ItemArray[2].ToString() + "<br /><br /><b>Location:</b> " + dtRandomMember.Rows[0].ItemArray[17].ToString() + "<br /><br /><b>Business:</b> " + dtRandomMember.Rows[0].ItemArray[8].ToString() + "<br /><br />"));
if (dtRandomMember.Rows[0].ItemArray[6].ToString() != "")
{
loggedinpanels.Controls.Add(new LiteralControl("<center><a href=\"" + dtRandomMember.Rows[0].ItemArray[6].ToString() + "\">Visit Website</a></center>"));
}
loggedinpanels.Controls.Add(new LiteralControl("</td></tr></table></div>"));
}
DataTable dtMemberAd = dl.GetRandomAd();
loggedinpanels.Controls.Add(new LiteralControl("<div class=\"contenttitle\">Member Ad</div><div style=\"text-align:center;\" class=\"contentpanel\"><a href=\"" + dtMemberAd.Rows[0].ItemArray[2].ToString() + "\"><img style=\"width:230px; border-width:0px;\" src=\"" + dtMemberAd.Rows[0].ItemArray[1].ToString() + "\" /></a></div>"));
if (User.Identity.IsAuthenticated)
{
loggedinpanels.Controls.Add(new LiteralControl("<div style=\"width:250px;\" class=\"contenttitle\">Popular Topics</div><div style=\"font-size:15px;\" class=\"contentpanel\"><ul>"));
DataTable dtTopics = dl.GetFiveTopics();
foreach (DataRow dr in dtTopics.Rows)
{
loggedinpanels.Controls.Add(new LiteralControl("<li><a href=\"Topic.aspx?topic=" + dr.ItemArray[0].ToString() + "\">" + dr.ItemArray[4].ToString() + "</a></li>"));
}
loggedinpanels.Controls.Add(new LiteralControl("</ul></div>"));
}
DataTable dtArticle = dl.GetArticleBy_ArticleID(iAID);
if (dtArticle.Rows.Count == 0)
{
this.Title = "No Article Found";
articletitle.InnerText = "No Article Found";
}
else
{
this.Title = dtArticle.Rows[0].ItemArray[2].ToString();
articletitle.InnerText = dtArticle.Rows[0].ItemArray[2].ToString();
postedby.InnerHtml = "Posted by <a href=\"Profile.aspx?member=" + dtArticle.Rows[0].ItemArray[4].ToString() + "\">" + dl.GetFullMemberNameBy_Email(dtArticle.Rows[0].ItemArray[4].ToString()) + "</a>";
articlebody.InnerHtml = "<!-- AddThis Button BEGIN --><script type=\"text/javascript\">var addthis_pub=\"chevex\"; var addthis_hide_embed = true;</script><a href=\"http://www.addthis.com/bookmark.php?v=20\" onmouseover=\"return addthis_open(this, '', '[URL]', '[TITLE]')\" onmouseout=\"addthis_close()\" onclick=\"return addthis_sendto()\"><img src=\"http://s7.addthis.com/static/btn/sm-share-en.gif\" width=\"83\" height=\"16\" alt=\"Bookmark and Share\" style=\"border:0;\"/></a><script type=\"text/javascript\" src=\"http://s7.addthis.com/js/200/addthis_widget.js\"></script><!-- AddThis Button END --><br /><br />" + dtArticle.Rows[0].ItemArray[3].ToString();
DataTable dtMember = dl.GetMemberBy_Email(dtArticle.Rows[0].ItemArray[4].ToString());
articlebody.InnerHtml += "<br /><br />------------------------------------------------------<br />" + dtMember.Rows[0].ItemArray[18].ToString();
}
}
示例7: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if (Request.QueryString["topic"] != null)
{
int iTopicID = Convert.ToInt32(Request.QueryString["topic"]);
int iPageNumber = 0;
if (Request.QueryString["p"] != null)
{
iPageNumber = Convert.ToInt32(Request.QueryString["p"]);
}
if (!User.Identity.IsAuthenticated)
{
Session["resultColor"] = "#ff0000";
Session["resultTitle"] = "Members Only";
Session["resultMessage"] = "This is a members only area.<br />You must log in first.";
Session["resultReturnURL"] = "Topic.aspx?topic=" + iTopicID.ToString();
Response.Redirect("Result.aspx", true);
}
DataLayer dl = new DataLayer();
int iMaxPages = Convert.ToInt32(Math.Ceiling(Convert.ToDecimal(dl.GetReplyCountBy_TopicID(iTopicID)) / 15m));
pageNav1.NumPages = iMaxPages;
pageNav2.NumPages = iMaxPages;
DataTable dtTopic = dl.GetForumTopicBy_TopicID(iTopicID);
DataTable dtBoard = dl.GetForumBoardBy_BoardID(Convert.ToInt32(dtTopic.Rows[0].ItemArray[1]));
boardtitle.InnerHtml = "<span style=\"font-size:20px;\"><a href=\"Topics.aspx?board=" + dtBoard.Rows[0].ItemArray[0].ToString() + "\" class=\"titlelink\">-= " + dtBoard.Rows[0].ItemArray[1].ToString() + " =-</a></span>";
topictitle.InnerHtml = dtTopic.Rows[0].ItemArray[4].ToString();
DataTable dtPosts = dl.GetFifteenPostsBy_Page(iPageNumber, iTopicID);
DataTable dtMember = dl.GetMemberBy_Email(dtTopic.Rows[0].ItemArray[2].ToString());
if (iPageNumber == 0)
{
posts.Controls.Add(new LiteralControl("<div style=\"background-color:#CCDDCC;padding:10px;\"><table style=\"width:100%;\"><td rowspan=\"2\" style=\"vertical-align:top;text-align:center;font-size:17px;font-weight:bold;padding-right:15px;border-right:solid 2px #333333;width:150px;\"><a style=\"text-decoration:none;\" href=\"Profile.aspx?member=" + dtMember.Rows[0].ItemArray[0].ToString() + "\"><img style=\"border-width:0px;\" src=\"MakeThumbnail.aspx?size=150&image=images/MemberAvatars/" + dtMember.Rows[0].ItemArray[3].ToString() + "\" /></a><br /><br /><a href=\"Profile.aspx?member=" + dtMember.Rows[0].ItemArray[0].ToString() + "\">" + dtMember.Rows[0].ItemArray[2].ToString() + "</a></td><td style=\"text-align:left;vertical-align:top;padding-left:15px;\">" + dtTopic.Rows[0].ItemArray[5].ToString() + "<br /><br />----------------------------------<br />" + dtMember.Rows[0].ItemArray[18].ToString() + "<td></tr><tr><td style=\"vertical-align:bottom;padding-left:15px;padding-top:15px;\"><table cellpadding=\"0\" cellspacing=\"0\" style=\"width:100%;\"><tr><td style=\"text-align:left;vertical-align:bottom;font-size:12px;font-weight:bold;\">" + dtTopic.Rows[0].ItemArray[3].ToString() + "</td><td style=\"text-align:right;vertical-align:bottom;\">"));
if ((dl.IsMemberAdmin(User.Identity.Name)) || (dl.IsMemberModerator(User.Identity.Name)))
{
if (!Convert.ToBoolean(dtTopic.Rows[0].ItemArray[7]))
{
lbButton = new LinkButton();
lbButton.Text = "Lock";
lbButton.Click += new EventHandler(lbButtonLock_Click);
posts.Controls.Add(lbButton);
}
else
{
lbButton = new LinkButton();
lbButton.Text = "Unlock";
lbButton.Click += new EventHandler(lbButtonUnLock_Click);
posts.Controls.Add(lbButton);
}
posts.Controls.Add(new LiteralControl(" "));
if (!Convert.ToBoolean(dtTopic.Rows[0].ItemArray[6]))
{
lbButton = new LinkButton();
lbButton.Text = "Sticky";
lbButton.Click += new EventHandler(lbButtonSticky_Click);
posts.Controls.Add(lbButton);
}
else
{
lbButton = new LinkButton();
lbButton.Text = "Unsticky";
lbButton.Click += new EventHandler(lbButtonUnSticky_Click);
posts.Controls.Add(lbButton);
}
posts.Controls.Add(new LiteralControl(" <b>|</b> "));
}
if ((User.Identity.Name.ToLower() == dtTopic.Rows[0].ItemArray[2].ToString().ToLower()) || (dl.IsMemberAdmin(User.Identity.Name)) || (dl.IsMemberModerator(User.Identity.Name)))
{
posts.Controls.Add(new LiteralControl("<a href=\"AddEditTopic.aspx?topic=" + iTopicID.ToString() + "\">Edit</a> "));
lbDelete = new LinkButton();
lbDelete.Text = "Delete";
lbDelete.Click += new EventHandler(lbDeleteTopic_Click);
posts.Controls.Add(lbDelete);
posts.Controls.Add(new LiteralControl(" "));
}
if (!Convert.ToBoolean(dtTopic.Rows[0].ItemArray[7]))
{
posts.Controls.Add(new LiteralControl("<a href=\"AddEditPost.aspx?topic=" + iTopicID.ToString() + "\">Reply</a>"));
}
else
{
posts.Controls.Add(new LiteralControl("<span style=\"font-style:italic;color:#ff0000;\">Topic Locked</span>"));
}
posts.Controls.Add(new LiteralControl("</td></tr></table></td></tr></table></div>"));
}
bool bColored = false;
if (iPageNumber > 0)
bColored = true;
bool bFirst = true;
foreach (DataRow dr in dtPosts.Rows)
{
dtMember = dl.GetMemberBy_Email(dr.ItemArray[2].ToString());
posts.Controls.Add(new LiteralControl("<div style=\""));
if (bColored)
{
//.........这里部分代码省略.........
示例8: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if (User.Identity.IsAuthenticated)
{
addcomment.Visible = true;
memberoptions.Visible = true;
sMember = User.Identity.Name;
}
else
{
memberoptions.Visible = false;
addcomment.Visible = false;
}
if (Request.QueryString["member"] != null)
{
sMember = Request.QueryString["member"];
}
else if ((Request.QueryString["member"] == null) && (!User.Identity.IsAuthenticated))
{
Session["resultColor"] = "#ff0000";
Session["resultTitle"] = "No Member Specified";
Session["resultMessage"] = "No MemberID was specified.";
Session["resultReturnURL"] = "Default.aspx";
Response.Redirect("Result.aspx");
}
DataLayer dl = new DataLayer();
Object[] oMember = dl.GetMemberBy_Email(sMember).Rows[0].ItemArray;
string sEmail = oMember[0].ToString();
string sName = oMember[2].ToString();
string sPersonalAvatar = oMember[3].ToString();
string sPhone = oMember[4].ToString();
string sInterests = oMember[5].ToString();
string sWebsite = oMember[6].ToString();
string sPersonalBio = oMember[7].ToString();
string sBusinessName = oMember[8].ToString();
string sBusinessLogo = oMember[9].ToString();
string sBusinessDescription = oMember[10].ToString();
DateTime dtJoinDate = Convert.ToDateTime(oMember[11]);
string sAIM = oMember[13].ToString();
string sMSN = oMember[14].ToString();
string sYahoo = oMember[15].ToString();
string sGoogleTalk = oMember[16].ToString();
string sLocation = oMember[17].ToString();
string sSignature = oMember[18].ToString();
bool bMemberNewsletter = Convert.ToBoolean(oMember[22]);
bool bDailyMotivaotr = Convert.ToBoolean(oMember[23]);
bool bShowEmail = Convert.ToBoolean(oMember[24]);
bool bUpdateTwitter = Convert.ToBoolean(oMember[25]);
string sTwitterUsername = oMember[26].ToString();
string sTwitterPassword = oMember[27].ToString();
string sGender = oMember[28].ToString();
DateTime dtBirthday = Convert.ToDateTime(oMember[30]);
string sBusinessCategory = oMember[31].ToString();
string[] sTwitterFeedStyles = oMember[32].ToString().Split(',');
bool bDeleted = Convert.ToBoolean(oMember[33]);
string sMembershipType = oMember[38].ToString();
if (bDeleted)
{
Session["resultColor"] = "#ff0000";
Session["resultTitle"] = "Profile Doesn't Exist";
Session["resultMessage"] = "That member no longer exists.";
Session["resultReturnURL"] = "Default.aspx";
Response.Redirect("Result.aspx", true);
}
hlSendMessage.NavigateUrl = "SendMessage.aspx?member=" + sEmail;
imgAvatar.ImageUrl = "MakeThumbnail.aspx?size=300&image=images/MemberAvatars/" + sPersonalAvatar;
hlAvatar.NavigateUrl = "images/MemberAvatars/" + sPersonalAvatar;
lblName.Text = sName;
membername.InnerHtml = sName + "'s Profile";
this.Title = sName + "'s Profile";
lblJoinDate.Text = dtJoinDate.ToString("d");
TimeSpan ts = DateTime.Now.Subtract(dtBirthday);
lblAge.Text = Convert.ToString(ts.Days / 365);
lblGender.Text = sGender;
lblLocation.Text = sLocation;
divInterests.InnerHtml = sInterests;
divPersonalBio.InnerHtml = sPersonalBio;
if (sSignature != "")
{
divSignature.InnerHtml = "<br /><hr />" + sSignature;
}
imgLogo.ImageUrl = "MakeThumbnail.aspx?size=300&image=images/BusinessLogos/" + sBusinessLogo;
hlLogo.NavigateUrl = "images/BusinessLogos/" + sBusinessLogo;
lblBusinessName.Text = sBusinessName;
lblBusinessCategory.Text = sBusinessCategory;
divBusinessDescription.InnerHtml = sBusinessDescription;
hlEmail.Text = sEmail;
hlEmail.NavigateUrl = "mailto:" + sEmail;
lblPhone.Text = sPhone;
hlWebsite.Text = sWebsite;
hlWebsite.NavigateUrl = sWebsite;
hlTwitterProfile.Text = sTwitterUsername;
hlTwitterProfile.NavigateUrl = "http://www.twitter.com/" + sTwitterUsername;
//.........这里部分代码省略.........
示例9: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
Session["CaptchaImageText"] = CaptchaImage.GenerateRandomCode(random);
}
if (!User.Identity.IsAuthenticated)
{
anonymousbox.Visible = true;
anonymousbox2.Visible = true;
cbxThumbsUp.Visible = false;
}
else
{
anonymousbox.Visible = false;
anonymousbox2.Visible = false;
}
int iPageNumber = 0;
if (Request.QueryString["p"] != null)
{
iPageNumber = Convert.ToInt32(Request.QueryString["p"]);
}
int iBlogID = 0;
if (Request.QueryString["bid"] == null)
{
Response.Redirect("Blogs.aspx", true);
}
else
{
iBlogID = Convert.ToInt32(Request.QueryString["bid"]);
}
DataLayer dl = new DataLayer();
int iMaxPages = Convert.ToInt32(Math.Ceiling(Convert.ToDecimal(dl.GetBlogCommentCount(iBlogID)) / 15m));
pageNav1.NumPages = iMaxPages;
pageNav2.NumPages = iMaxPages;
DataTable dtBlog = dl.GetBlogBy_BlogID(iBlogID);
if (dtBlog.Rows.Count == 0)
{
this.Title = "No Blog Found";
blogtitle.InnerText = "No Blog Found";
addcomment.Visible = false;
}
else
{
if (dtBlog.Rows[0].ItemArray[5].ToString() == "Members Only")
{
if (!User.Identity.IsAuthenticated)
{
Session["resultColor"] = "#ff0000";
Session["resultTitle"] = "Members Only";
Session["resultMessage"] = "This is a members only blog.<br />You must log in first.";
Session["resultReturnURL"] = "Blogs.aspx";
Response.Redirect("Result.aspx", true);
}
}
DataTable dtComments = dl.GetFifteenBlogCommentsBy_Page(iPageNumber, iBlogID);
if (User.Identity.IsAuthenticated)
{
if (dl.GaveBlogThumbsUpAlready(iBlogID, User.Identity.Name) || (User.Identity.Name.ToLower() == dtBlog.Rows[0].ItemArray[1].ToString().ToLower()))
{
cbxThumbsUp.Visible = false;
}
else
{
cbxThumbsUp.Visible = true;
}
}
this.Title = dtBlog.Rows[0].ItemArray[3].ToString();
blogtitle.InnerText = dtBlog.Rows[0].ItemArray[3].ToString();
postedby.InnerHtml = "Posted by <a href=\"Profile.aspx?member=" + dtBlog.Rows[0].ItemArray[1].ToString() + "\">" + dl.GetFullMemberNameBy_Email(dtBlog.Rows[0].ItemArray[1].ToString()) + "</a> | " + Convert.ToDateTime(dtBlog.Rows[0].ItemArray[2]).ToString("D") + " | " + dl.GetBlogCommentCount(Convert.ToInt32(dtBlog.Rows[0].ItemArray[0])) + " Comment(s) | <!-- AddThis Button BEGIN --><script type=\"text/javascript\">var addthis_pub=\"chevex\"; var addthis_hide_embed = true;</script><a href=\"http://www.addthis.com/bookmark.php?v=20\" onmouseover=\"return addthis_open(this, '', '[URL]', '[TITLE]')\" onmouseout=\"addthis_close()\" onclick=\"return addthis_sendto()\"><img src=\"http://s7.addthis.com/static/btn/sm-share-en.gif\" width=\"83\" height=\"16\" alt=\"Bookmark and Share\" style=\"border:0;\"/></a><script type=\"text/javascript\" src=\"http://s7.addthis.com/js/200/addthis_widget.js\"></script><!-- AddThis Button END -->";
blogcontent.InnerHtml = dtBlog.Rows[0].ItemArray[4].ToString().Replace("~", "") + "<br /><br /><b>" + dl.GetBlogThumbsUpCount(iBlogID).ToString() + " Thumbs Up!</b>";
bool bColored = true;
foreach (DataRow dr in dtComments.Rows)
{
string sEmail = "";
string sLink = "";
string sAvatar = "";
string sName = "";
string sSignature = "";
if (dr.ItemArray[1].ToString().StartsWith("ANON"))
{
string[] sSplit = dr.ItemArray[1].ToString().Split('|');
sLink = sSplit[2];
sAvatar = "images/MemberAvatars/no_avatar.gif";
sName = sSplit[1];
}
else
{
DataTable dtMember = dl.GetMemberBy_Email(dr.ItemArray[1].ToString());
sEmail = dtMember.Rows[0].ItemArray[0].ToString();
//.........这里部分代码省略.........
示例10: btnSubmit_Click
//.........这里部分代码省略.........
mm.Body = tbxName.Text + " signed up on ReferralNetworX.com.";
mm.Body += "<br /><br /><a href=\"http://www.referralnetworx.com/profile.aspx?member=" + tbxEmail.Text + "\">Click to view</a>";
SmtpMail.Send(mm);
mm = new MailMessage();
mm.BodyFormat = MailFormat.Html;
mm.To = tbxEmail.Text;
mm.From = "[email protected]";
mm.Subject = "Welcome to ReferralNetworX.com!";
mm.Body = "Welcome " + dl.GetMemberNameBy_Email(tbxEmail.Text) + ",<br /><br />";
mm.Body += " We are dedicated to helping you and your business succeed. I truly hope RNX helps you to grow to new heights and accomplish your goals. I am confident that you will provide a lot of value to the RNX community and that your knowledge will benefit everyone! Please <a href=\"http://www.referralnetworx.com/referralnetworx/Topic.aspx?topic=50\">visit our forums to say hi</a> to fellow members and get to know everyone. Also, be sure to log in and edit your profile. The more information you provide about yourself and your business, the more you will get noticed and more opportunities will be presented to you.<br /><br />Here is your username and temporary password:<br />Password - " + iPassword.ToString() + " (You can change this after logging in)<br />Username - " + tbxEmail.Text + "<br /><br />Alex Ford<br />Referral NetworX Administrator";
SmtpMail.Send(mm);
try
{
dl.DeleteNonMember(tbxEmail.Text);
}
catch { }
Session["resultColor"] = "#007700";
Session["resultTitle"] = "Member Added";
Session["resultMessage"] = "Member Added Successfuly";
Session["resultReturnURL"] = "ManageMembers.aspx";
Response.Redirect("Result.aspx");
}
else
{
if (cbxDeleteMember.Checked)
{
DataLayer dl = new DataLayer();
dl.DeleteMember(lbxMembers.SelectedValue);
Session["resultColor"] = "#007700";
Session["resultTitle"] = "Member Deleted";
Session["resultMessage"] = "Member Deleted Successfuly";
Session["resultReturnURL"] = "ManageMembers.aspx";
Response.Redirect("Result.aspx");
}
else
{
DataLayer dl = new DataLayer();
DataTable dt = dl.GetMemberBy_Email(lbxMembers.SelectedValue);
string sTwitterFeedStyles = dt.Rows[0].ItemArray[32].ToString();
string sPersonalAvatar = dt.Rows[0].ItemArray[3].ToString();
string sMemberAvatar = dt.Rows[0].ItemArray[3].ToString();
string sPhone = dt.Rows[0].ItemArray[4].ToString();
string sInterests = dt.Rows[0].ItemArray[5].ToString();
string sWebsite = dt.Rows[0].ItemArray[6].ToString();
string sPersonalBio = dt.Rows[0].ItemArray[7].ToString();
string sBusinessLogo = dt.Rows[0].ItemArray[9].ToString();
string sBusinessBio = dt.Rows[0].ItemArray[10].ToString();
string sAIM = dt.Rows[0].ItemArray[13].ToString();
string sMSN = dt.Rows[0].ItemArray[14].ToString();
string sYahoo = dt.Rows[0].ItemArray[15].ToString();
string sGoogleTalk = dt.Rows[0].ItemArray[16].ToString();
string sLocation = dt.Rows[0].ItemArray[17].ToString();
string sSignature = dt.Rows[0].ItemArray[18].ToString();
bool bShowEmail = Convert.ToBoolean(dt.Rows[0].ItemArray[24]);
bool bUpdateTwitter = Convert.ToBoolean(dt.Rows[0].ItemArray[25]);
string sTwitterUsername = dt.Rows[0].ItemArray[26].ToString();
string sTwitterPassword = dt.Rows[0].ItemArray[27].ToString();
string sGender = dt.Rows[0].ItemArray[28].ToString();
DateTime dtBirthday = Convert.ToDateTime(dt.Rows[0].ItemArray[30]);
string sBusinessCategory = dt.Rows[0].ItemArray[31].ToString();
dl.UpdateMember(lbxMembers.SelectedValue, tbxName.Text, sPersonalAvatar, sPhone, sInterests, sWebsite, sPersonalBio, tbxBusinessName.Text, sBusinessLogo, sBusinessBio, sAIM, sMSN, sYahoo, sGoogleTalk, sLocation, sSignature, cbxAdmin.Checked, cbxModerator.Checked, cbxCanPostBlog.Checked, cbxMemberNewsletter.Checked, cbxDailyMotivator.Checked, bShowEmail, bUpdateTwitter, sTwitterUsername, sTwitterPassword, sGender, dtBirthday, sBusinessCategory, sTwitterFeedStyles, ddlArticleColumn.SelectedValue);
if (lbxMembers.SelectedValue.ToUpper() != tbxEmail.Text.ToUpper())
{
if (sPersonalAvatar != "no_avatar.gif")
{
string sExt = sPersonalAvatar.Remove(0, sPersonalAvatar.LastIndexOf('.'));
string sNewPersonalAvatar = tbxEmail.Text + sExt;
if (File.Exists(MapPath("~/images/MemberAvatars/" + sNewPersonalAvatar)))
File.Delete(MapPath("~/images/MemberAvatars/" + sNewPersonalAvatar));
File.Move(MapPath("~/images/MemberAvatars/" + sPersonalAvatar), MapPath("~/images/MemberAvatars/" + sNewPersonalAvatar));
sPersonalAvatar = sNewPersonalAvatar;
}
if (sBusinessLogo != "no_logo.gif")
{
string sExt = sBusinessLogo.Remove(0, sBusinessLogo.LastIndexOf('.'));
string sNewBusinessLogo = tbxEmail.Text + sExt;
if (File.Exists(MapPath("~/images/BusinessLogos/" + sNewBusinessLogo)))
File.Delete(MapPath("~/images/BusinessLogos/" + sNewBusinessLogo));
File.Move(MapPath("~/images/BusinessLogos/" + sBusinessLogo), MapPath("~/images/BusinessLogos/" + sNewBusinessLogo));
sBusinessLogo = sNewBusinessLogo;
}
dl.UpdateMemberEmail(lbxMembers.SelectedValue, tbxEmail.Text, sPersonalAvatar, sBusinessLogo);
if (User.Identity.Name.ToUpper() == lbxMembers.SelectedValue.ToUpper())
{
FormsAuthentication.SignOut();
FormsAuthentication.SetAuthCookie(tbxEmail.Text, false);
}
}
Session["resultColor"] = "#007700";
Session["resultTitle"] = "Member Updated";
Session["resultMessage"] = "Member Updated Successfuly ";
Session["resultReturnURL"] = "ManageMembers.aspx";
Response.Redirect("Result.aspx");
}
}
}
示例11: lbxMembers_SelectedIndexChanged
protected void lbxMembers_SelectedIndexChanged(object sender, EventArgs e)
{
memberform.Visible = true;
editoptions.Visible = true;
addedit.InnerText = "Edit Member";
string sEmail = lbxMembers.SelectedValue;
DataLayer dl = new DataLayer();
DataRow drMember = dl.GetMemberBy_Email(sEmail).Rows[0];
cbxDeleteMember.Visible = true;
cbxDeleteMember.Checked = false;
cbxDeleteMember_CheckedChanged(null, null);
lblDeleteMember.Visible = true;
tbxEmail.Text = drMember.ItemArray[0].ToString();
hlEditFullProfile.NavigateUrl = "EditProfile.aspx?member=" + drMember.ItemArray[0].ToString();
hlViewProfile.NavigateUrl = "Profile.aspx?member=" + drMember.ItemArray[0].ToString();
tbxName.Text = drMember.ItemArray[2].ToString();
tbxBusinessName.Text = drMember.ItemArray[8].ToString();
cbxAdmin.Checked = Convert.ToBoolean(drMember.ItemArray[19]);
cbxModerator.Checked = Convert.ToBoolean(drMember.ItemArray[20]);
cbxCanPostBlog.Checked = Convert.ToBoolean(drMember.ItemArray[21]);
cbxMemberNewsletter.Checked = Convert.ToBoolean(drMember.ItemArray[22]);
cbxDailyMotivator.Checked = Convert.ToBoolean(drMember.ItemArray[23]);
string sArticleCategory = drMember.ItemArray[34].ToString();
lblSubscriptionID.Text = drMember.ItemArray[35].ToString();
if (sArticleCategory != "None")
{
for (int iCount = 0; iCount < ddlArticleColumn.Items.Count; iCount++)
{
if (sArticleCategory == ddlArticleColumn.Items[iCount].ToString())
{
ddlArticleColumn.SelectedIndex = iCount;
break;
}
}
}
else
{
ddlArticleColumn.SelectedIndex = 0;
}
cbxAdmin_CheckedChanged(null, null);
}
示例12: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
DataLayer dl = new DataLayer();
if (!User.Identity.IsAuthenticated)
{
Session["resultColor"] = "#ff0000";
Session["resultTitle"] = "Not Logged In";
Session["resultMessage"] = "You must log in first.";
Session["resultReturnURL"] = "EditProfile.aspx";
Response.Redirect("Result.aspx");
}
if (!this.IsPostBack)
{
int iStartYear = DateTime.Now.Year - 105;
int iEndYear = DateTime.Now.Year - 3;
for (int iCount = iStartYear; iCount <= iEndYear; iCount++)
{
ddlBirthYear.Items.Add(iCount.ToString());
}
sEmail = User.Identity.Name;
if ((dl.IsMemberAdmin(User.Identity.Name) && (Request.QueryString["member"] != null)))
{
sEmail = Request.QueryString["member"];
if (!dl.IsMemberAdmin(User.Identity.Name))
{
sEmail = User.Identity.Name;
}
}
this.ViewState["sEmail"] = sEmail;
DataRow drMember = dl.GetMemberBy_Email(sEmail).Rows[0];
lblEmail.Text = drMember.ItemArray[0].ToString();
tbxName.Text = drMember.ItemArray[2].ToString();
imgPersonalAvatar.ImageUrl = "MakeThumbnail.aspx?size=150&image=images/MemberAvatars/" + drMember.ItemArray[3].ToString();
tbxPhone.Text = drMember.ItemArray[4].ToString();
tbxInterests.Text = drMember.ItemArray[5].ToString().Replace("<br />", "\r\n");
tbxWebsite.Text = drMember.ItemArray[6].ToString();
tbxPersonalBio.Text = drMember.ItemArray[7].ToString().Replace("<br />", "\r\n");
tbxBusinessName.Text = drMember.ItemArray[8].ToString();
imgBusinessLogo.ImageUrl = "MakeThumbnail.aspx?size=150&image=images/BusinessLogos/" + drMember.ItemArray[9].ToString();
tbxBusinessBio.Text = drMember.ItemArray[10].ToString().Replace("<br />", "\r\n");
tbxAIM.Text = drMember.ItemArray[13].ToString();
tbxMSN.Text = drMember.ItemArray[14].ToString();
tbxYahoo.Text = drMember.ItemArray[15].ToString();
tbxGoogleTalk.Text = drMember.ItemArray[16].ToString();
tbxLocation.Text = drMember.ItemArray[17].ToString();
tbxSignature.Text = drMember.ItemArray[18].ToString().Replace("<br />", "\r\n");
cbxMemberNewsletter.Checked = Convert.ToBoolean(drMember.ItemArray[22]);
cbxDailyMotivator.Checked = Convert.ToBoolean(drMember.ItemArray[23]);
cbxShowEmail.Checked = Convert.ToBoolean(drMember.ItemArray[24]);
tbxTwitterUsername.Text = drMember.ItemArray[26].ToString();
string sGender = drMember.ItemArray[28].ToString();
if (sGender == "Not Specified")
ddlGender.SelectedIndex = 0;
else if (sGender == "Male")
ddlGender.SelectedIndex = 1;
else if (sGender == "Female")
ddlGender.SelectedIndex = 2;
DateTime dtBirthday = Convert.ToDateTime(drMember.ItemArray[30]);
for (int iIndex = 0; iIndex < ddlBirthYear.Items.Count; iIndex++)
{
if (dtBirthday.Year.ToString() == ddlBirthYear.Items[iIndex].ToString())
{
ddlBirthYear.SelectedIndex = iIndex;
break;
}
}
ddlBirthMonth.SelectedIndex = dtBirthday.Month - 1;
calBirthday.SelectedDate = Convert.ToDateTime(dtBirthday.Month.ToString() + "/" + dtBirthday.Day.ToString() + "/" + dtBirthday.Year.ToString());
calBirthday.VisibleDate = calBirthday.SelectedDate;
string sBusinessCategory = drMember.ItemArray[31].ToString();
if (sBusinessCategory != "Not Selected")
{
for (int iCount = 0; iCount < ddlBusinessCategory.Items.Count; iCount++)
{
if (sBusinessCategory == ddlBusinessCategory.Items[iCount].ToString())
{
ddlBusinessCategory.SelectedIndex = iCount;
break;
}
}
}
else
{
ddlBusinessCategory.SelectedIndex = 0;
}
}
else
{
sEmail = this.ViewState["sEmail"].ToString();
}
}