本文整理汇总了C#中DataLayer.GetFullMemberNameBy_Email方法的典型用法代码示例。如果您正苦于以下问题:C# DataLayer.GetFullMemberNameBy_Email方法的具体用法?C# DataLayer.GetFullMemberNameBy_Email怎么用?C# DataLayer.GetFullMemberNameBy_Email使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataLayer
的用法示例。
在下文中一共展示了DataLayer.GetFullMemberNameBy_Email方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnSumbit_Click
protected void btnSumbit_Click(object sender, EventArgs e)
{
DataLayer dl = new DataLayer();
string sMemberName = "<i>Anonymous</i>";
if (User.Identity.IsAuthenticated)
{
if (!cbxAnonymous.Checked)
{
sMemberName = dl.GetFullMemberNameBy_Email(User.Identity.Name);
}
}
SmtpMail.SmtpServer = "relay-hosting.secureserver.net";
MailMessage mm;
mm = new MailMessage();
mm.BodyFormat = MailFormat.Html;
mm.To = "[email protected];[email protected]";
mm.From = "[email protected]";
mm.Subject = "New \"Ask The Success Coach\" question!";
mm.Body = sMemberName + " submitted a question to the Success Coach.<br /><br />";
mm.Body += tbxQuestion.Text.Replace("\n", "<br />").Replace("\r", "");
SmtpMail.Send(mm);
Session["resultColor"] = "#007700";
Session["resultTitle"] = "Question Sent";
Session["resultMessage"] = "The Success Coach will answer your question in his next blog update.";
Session["resultReturnURL"] = "Blogs.aspx";
Response.Redirect("Result.aspx", true);
}
示例2: lbtnQuotePost_Click
protected void lbtnQuotePost_Click(object sender, EventArgs e)
{
if (Request.QueryString["rt"] != null)
{
int iRTPostID = Convert.ToInt32(Request.QueryString["rt"]);
DataLayer dl = new DataLayer();
DataTable dtRTPost = dl.GetForumPostBy_PostID(iRTPostID);
rteBody.Value += "<div style=\"background-color:#ddddee; border: solid 2px #000077;padding:10px;\">";
rteBody.Value += dtRTPost.Rows[0].ItemArray[4].ToString();
rteBody.Value += "<br /><br /><div style=\"font-size: 12px;font-weight:bold;\">Posted by <a href=\"Profile.aspx?member=" + dtRTPost.Rows[0].ItemArray[2].ToString() + "\">";
rteBody.Value += dl.GetFullMemberNameBy_Email(dtRTPost.Rows[0].ItemArray[2].ToString());
rteBody.Value += "</a> on " + dtRTPost.Rows[0].ItemArray[3].ToString() + "</div></div><br />";
}
else
{
int iRTTopicID = Convert.ToInt32(Request.QueryString["topic"]);
DataLayer dl = new DataLayer();
DataTable dtRTTopic = dl.GetForumTopicBy_TopicID(iRTTopicID);
rteBody.Value += "<div style=\"background-color:#ddddee; border: solid 2px #000077;padding:10px;\">";
rteBody.Value += dtRTTopic.Rows[0].ItemArray[5].ToString();
rteBody.Value += "<br /><br /><div style=\"font-size: 12px;font-weight:bold;\">Posted by <a href=\"Profile.aspx?member=" + dtRTTopic.Rows[0].ItemArray[2].ToString() + "\">";
rteBody.Value += dl.GetFullMemberNameBy_Email(dtRTTopic.Rows[0].ItemArray[2].ToString());
rteBody.Value += "</a> on " + dtRTTopic.Rows[0].ItemArray[3].ToString() + "</div></div><br />";
}
}
示例3: btnSubmit_Click
protected void btnSubmit_Click(object sender, EventArgs e)
{
DataLayer dl = new DataLayer();
if (Request.QueryString["post"] != null)
{
int iPostID = Convert.ToInt32(Request.QueryString["post"]);
int iTopicID = Convert.ToInt32(Request.QueryString["topic"]);
dl.UpdateForumPost(iPostID, rteBody.Value);
Response.Redirect("Topic.aspx?topic=" + iTopicID.ToString(), true);
}
else
{
int iTopicID = Convert.ToInt32(Request.QueryString["topic"]);
DataTable dtTopic = dl.GetForumTopicBy_TopicID(iTopicID);
DateTime dtPostedDate = DateTime.Now;
dl.AddForumPost(iTopicID, User.Identity.Name, dtPostedDate, rteBody.Value);
SmtpMail.SmtpServer = "relay-hosting.secureserver.net";
MailMessage mm;
mm = new MailMessage();
mm.BodyFormat = MailFormat.Html;
mm.To = "[email protected];[email protected]";
mm.From = "[email protected]";
mm.Subject = "Someone replied to a forum topic.";
mm.Body = dl.GetFullMemberNameBy_Email(User.Identity.Name) + " replied to the forum topic titled: " + dtTopic.Rows[0].ItemArray[4].ToString();
mm.Body += "<br /><a href=\"http://www.referralnetworx.com/Topic.aspx?topic=" + iTopicID.ToString() + "\">Click to view</a>";
mm.Body += "<br /><br />The post reply is below:<br /><br />" + rteBody.Value;
SmtpMail.Send(mm);
if (User.Identity.Name.ToLower() != dtTopic.Rows[0].ItemArray[2].ToString().ToLower())
{
mm = new MailMessage();
mm.BodyFormat = MailFormat.Html;
mm.To = dtTopic.Rows[0].ItemArray[2].ToString();
mm.From = "[email protected]";
mm.Subject = "Someone replied to your forum topic.";
mm.Body = dl.GetFullMemberNameBy_Email(User.Identity.Name) + " replied to your forum topic titled: " + dtTopic.Rows[0].ItemArray[4].ToString();
mm.Body += "<br /><a href=\"http://www.referralnetworx.com/Topic.aspx?topic=" + iTopicID.ToString() + "\">Click to view</a>";
SmtpMail.Send(mm);
}
Response.Redirect("Topic.aspx?topic=" + iTopicID.ToString(), true);
}
}
示例4: btnAddComment_Click
protected void btnAddComment_Click(object sender, EventArgs e)
{
if ((User.Identity.IsAuthenticated) || (tbxCode.Text == Session["CaptchaImageText"].ToString()))
{
int iBlogID = Convert.ToInt32(Request.QueryString["bid"]);
DataLayer dl = new DataLayer();
DataTable dtBlog = dl.GetBlogBy_BlogID(iBlogID);
string sName = "";
if (User.Identity.IsAuthenticated)
{
dl.AddComment(User.Identity.Name, DateTime.Now, tbxAddComment.Text, "Blog", cbxThumbsUp.Checked, iBlogID, "");
sName = dl.GetFullMemberNameBy_Email(User.Identity.Name);
}
else
{
dl.AddComment("ANON|" + tbxAnonymousName.Text + "|" + tbxAnonymousWebsite.Text, DateTime.Now, tbxAddComment.Text, "Blog", false, iBlogID, "");
sName = tbxAnonymousName.Text;
}
SmtpMail.SmtpServer = "relay-hosting.secureserver.net";
MailMessage mm;
mm = new MailMessage();
mm.BodyFormat = MailFormat.Html;
mm.To = "[email protected];[email protected]";
mm.From = "[email protected]";
mm.Subject = "Someone posted a blog comment.";
mm.Body = sName + " posted a comment on a blog: " + dtBlog.Rows[0].ItemArray[3].ToString();
mm.Body += "<br /><br />Here is the comment:<br />" + tbxAddComment.Text;
mm.Body += "<br /><br /><a href=\"http://www.referralnetworx.com/Blog.aspx?bid=" + iBlogID.ToString() + "\">Click to view</a>";
SmtpMail.Send(mm);
if (User.Identity.Name.ToLower() != dtBlog.Rows[0].ItemArray[1].ToString().ToLower())
{
mm = new MailMessage();
mm.BodyFormat = MailFormat.Html;
mm.To = dtBlog.Rows[0].ItemArray[1].ToString();
mm.From = "[email protected]";
mm.Subject = "Someone posted a comment on your blog.";
mm.Body = sName + " posted a comment on your blog titled: " + dtBlog.Rows[0].ItemArray[3].ToString();
mm.Body += "<br /><a href=\"http://www.referralnetworx.com/Blog.aspx?bid=" + iBlogID.ToString() + "\">Click to view</a>";
SmtpMail.Send(mm);
}
Session["resultColor"] = "#009900";
Session["resultTitle"] = "Comment Added";
Session["resultMessage"] = "Thank you for your comment!";
Session["resultReturnURL"] = Request.RawUrl;
Response.Redirect("Result.aspx", true);
}
else
{
cvInvalidCode.IsValid = false;
}
}
示例5: btnSubmit_Click
protected void btnSubmit_Click(object sender, EventArgs e)
{
DataLayer dl = new DataLayer();
if (Request.QueryString["topic"] != null)
{
int iTopicID = Convert.ToInt32(Request.QueryString["topic"]);
dl.UpdateForumTopic(iTopicID, tbxTitle.Text, rteBody.Value);
Response.Redirect("Topic.aspx?topic=" + iTopicID.ToString(), true);
}
else
{
int iBoardID = Convert.ToInt32(Request.QueryString["board"]);
DateTime dtPostedDate = DateTime.Now;
dl.AddForumTopic(iBoardID, User.Identity.Name, tbxTitle.Text, rteBody.Value, dtPostedDate, cbxSticky.Checked, cbxLocked.Checked);
SqlCommand sc = new SqlCommand("SELECT TopicID FROM rnxForumTopics WHERE [email protected] AND [email protected]");
sc.Parameters.Add(new SqlParameter("Title", tbxTitle.Text));
sc.Parameters.Add(new SqlParameter("Date", dtPostedDate));
DataSet ds = dl.CustomQuery(sc);
try
{
WebRequest wrGETURL;
wrGETURL = WebRequest.Create("http://tinyurl.com/api-create.php?url=http://www.ReferralNetworX.com/Topic.aspx?topic=" + ds.Tables[0].Rows[0].ItemArray[0].ToString());
Stream objStream;
objStream = wrGETURL.GetResponse().GetResponseStream();
StreamReader objReader = new StreamReader(objStream);
string sURL = objReader.ReadToEnd();
Yedda.Twitter t = new Yedda.Twitter();
t.Update("ReferralNetworX", "1million!", "New RNX Forum Topic: " + tbxTitle.Text + " " + sURL, Yedda.Twitter.OutputFormatType.XML);
t.Update("Chevex", "Ch3vyF0rd!", "New RNX Forum Topic: " + tbxTitle.Text + " " + sURL, Yedda.Twitter.OutputFormatType.XML);
t.Update("WALTatRNX", "robinwalt98", "New RNX Forum Topic: " + tbxTitle.Text + " " + sURL, Yedda.Twitter.OutputFormatType.XML);
}
catch
{
}
SmtpMail.SmtpServer = "relay-hosting.secureserver.net";
MailMessage mm;
mm = new MailMessage();
mm.BodyFormat = MailFormat.Html;
mm.To = "[email protected];[email protected]";
mm.From = "[email protected]";
mm.Subject = "Someone posted a new forum topic.";
mm.Body = dl.GetFullMemberNameBy_Email(User.Identity.Name) + " posted a new forum topic titled: " + tbxTitle.Text;
mm.Body += "<br /><a href=\"http://www.referralnetworx.com/Topic.aspx?topic=" + ds.Tables[0].Rows[0].ItemArray[0].ToString() + "\">Click to view</a>";
mm.Body += "<br /><br />The post is below:<br /><br />" + rteBody.Value;
SmtpMail.Send(mm);
Response.Redirect("Topic.aspx?topic=" + ds.Tables[0].Rows[0].ItemArray[0].ToString(), true);
}
}
示例6: btnAddComment_Click
protected void btnAddComment_Click(object sender, EventArgs e)
{
DataLayer dl = new DataLayer();
dl.AddComment(User.Identity.Name, DateTime.Now, tbxAddComment.Text.Replace("\r", "<br />").Replace("\n", ""), "Member", cbxThumbsUp.Checked, -1, sMember);
if (cbxThumbsUp.Checked)
{
dl.AddThumbsUp(sMember);
}
SmtpMail.SmtpServer = "relay-hosting.secureserver.net";
MailMessage mm;
mm = new MailMessage();
mm.BodyFormat = MailFormat.Html;
mm.To = "[email protected];[email protected]";
mm.From = "[email protected]";
mm.Subject = "Someone posted a profile comment.";
mm.Body = dl.GetFullMemberNameBy_Email(User.Identity.Name) + " posted a comment on " + dl.GetFullMemberNameBy_Email(sMember) + "'s profile.";
mm.Body += "<br /><a href=\"http://www.referralnetworx.com/profile.aspx?member=" + sMember + "\">Click to view</a>";
mm.Body += "<br /><br />The comment is below:<br /><br />" + tbxAddComment.Text.Replace("\r", "<br />").Replace("\n", "");
SmtpMail.Send(mm);
if (sMember.ToLower() != User.Identity.Name.ToLower())
{
mm = new MailMessage();
mm.BodyFormat = MailFormat.Html;
mm.To = sMember;
mm.From = "[email protected]";
mm.Subject = "Someone posted a comment on your profile!";
mm.Body = dl.GetFullMemberNameBy_Email(User.Identity.Name) + " posted a comment on your profile.";
mm.Body += "<br /><a href=\"http://www.referralnetworx.com/profile.aspx?member=" + sMember + "\">Click to view</a>";
SmtpMail.Send(mm);
}
Session["resultColor"] = "#009900";
Session["resultTitle"] = "Comment Added";
Session["resultMessage"] = "Thank you for your comment! ";
Session["resultReturnURL"] = Request.RawUrl;
Response.Redirect("Result.aspx", true);
}
示例7: btnSend_Click
protected void btnSend_Click(object sender, EventArgs e)
{
DataLayer dl = new DataLayer();
SmtpMail.SmtpServer = "relay-hosting.secureserver.net";
MailMessage mm;
mm = new MailMessage();
mm.BodyFormat = MailFormat.Html;
mm.To = lblTo.Text;
mm.From = "[email protected]";
mm.Subject = dl.GetFullMemberNameBy_Email(User.Identity.Name) + " sent you a message.";
mm.Body += tbxBody.Text.Replace("\n", "<br />").Replace("\r", "") + "<br /><br /><a href=\"http://www.referralnetworx.com/SendMessage.aspx?member=" + User.Identity.Name + "\">Click here to reply</a>";
SmtpMail.Send(mm);
Session["resultColor"] = "#007700";
Session["resultTitle"] = "Message Sent";
Session["resultMessage"] = "Your message has been sent.";
Session["resultReturnURL"] = "Profile.aspx?member=" + lblTo.Text;
Response.Redirect("Result.aspx", true);
}
示例8: 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();
//.........这里部分代码省略.........
示例9: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if (Request.QueryString["board"] != null)
{
int iBoardID = Convert.ToInt32(Request.QueryString["board"]);
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"] = "Topics.aspx?board=" + iBoardID.ToString();
Response.Redirect("Result.aspx", true);
}
hlAddTopic.NavigateUrl = "AddEditTopic.aspx?board=" + iBoardID.ToString();
hlAddTopic2.NavigateUrl = "AddEditTopic.aspx?board=" + iBoardID.ToString();
DataLayer dl = new DataLayer();
int iMaxPages = Convert.ToInt32(Math.Ceiling(Convert.ToDecimal(dl.GetTopicCountBy_BoardID(iBoardID)) / 15m));
pageNav1.NumPages = iMaxPages;
pageNav2.NumPages = iMaxPages;
DataTable dtBoard = dl.GetForumBoardBy_BoardID(iBoardID);
boardtitle.InnerText = dtBoard.Rows[0].ItemArray[1].ToString();
this.Title = dtBoard.Rows[0].ItemArray[1].ToString();
if (Convert.ToBoolean(dtBoard.Rows[0].ItemArray[3]))
{
hlAddTopic.Visible = false;
hlAddTopic2.Visible = false;
}
DataTable dtTopics = dl.GetFifteenTopicsBy_Page(iPageNumber, iBoardID);
DataTable dtStickyTopics = dl.GetStickyTopics(iBoardID);
if (dtStickyTopics.Rows.Count > 0)
{
stickypanel.Visible = true;
}
else
{
stickypanel.Visible = false;
}
bool bColored = true;
foreach (DataRow dr in dtStickyTopics.Rows)
{
stickytopics.Controls.Add(new LiteralControl("<div style=\"background-color:"));
if (bColored)
{
stickytopics.Controls.Add(new LiteralControl("#CCDDCC"));
bColored = false;
}
else
{
stickytopics.Controls.Add(new LiteralControl("#ffffff"));
bColored = true;
}
int iNumReplies = dl.GetReplyCountBy_TopicID(Convert.ToInt32(dr.ItemArray[0]));
stickytopics.Controls.Add(new LiteralControl(";padding:10px;\"><a style=\"font-size:20px;\" href=\"Topic.aspx?topic=" + dr.ItemArray[0].ToString() + "\">" + dr.ItemArray[4].ToString() + "</a><b> <b>|</b> " + iNumReplies.ToString() + " replies</b><br /><div style=\"font-size:13px;\">Posted by <a href=\"Profile.aspx?member=" + dr.ItemArray[2].ToString() + "\">" + dl.GetFullMemberNameBy_Email(dr.ItemArray[2].ToString()) + "</a> on " + dr.ItemArray[3].ToString()));
if (iNumReplies > 0)
{
DataTable dtLastReply = dl.GetLastTopicReplyBy_TopicID(Convert.ToInt32(dr.ItemArray[0]));
stickytopics.Controls.Add(new LiteralControl(" <b>|</b> last reply by <a href=\"Profile.aspx?member=" + dtLastReply.Rows[0].ItemArray[0].ToString() + "\">" + dl.GetFullMemberNameBy_Email(dtLastReply.Rows[0].ItemArray[0].ToString()) + "</a> on " + dtLastReply.Rows[0].ItemArray[1].ToString()));
}
stickytopics.Controls.Add(new LiteralControl("</div></div>"));
}
if (dtTopics.Rows.Count == 0)
{
if (Convert.ToBoolean(dtBoard.Rows[0].ItemArray[3]))
{
topics.Controls.Add(new LiteralControl("<div style=\"padding:10px;background-color:#CCDDCC;font-size:20px;\">No Topics.</div>"));
}
else
{
topics.Controls.Add(new LiteralControl("<div style=\"padding:10px;background-color:#CCDDCC;font-size:20px;\">No Topics. <a href=\"AddEditTopic.aspx?board=" + iBoardID.ToString() + "\">Click here</a> to create a topic of your own.</div>"));
}
}
bColored = true;
foreach (DataRow dr in dtTopics.Rows)
{
topics.Controls.Add(new LiteralControl("<div style=\"background-color:"));
if (bColored)
{
topics.Controls.Add(new LiteralControl("#CCDDCC"));
bColored = false;
}
else
{
topics.Controls.Add(new LiteralControl("#ffffff"));
bColored = true;
}
int iNumReplies = dl.GetReplyCountBy_TopicID(Convert.ToInt32(dr.ItemArray[0]));
topics.Controls.Add(new LiteralControl(";padding:10px;\"><a style=\"font-size:20px;\" href=\"Topic.aspx?topic=" + dr.ItemArray[0].ToString() + "\">" + dr.ItemArray[4].ToString() + "</a><b> <b>|</b> " + iNumReplies.ToString() + " replies</b><br /><div style=\"font-size:13px;\">Posted by <a href=\"Profile.aspx?member=" + dr.ItemArray[2].ToString() + "\">" + dl.GetFullMemberNameBy_Email(dr.ItemArray[2].ToString()) + "</a> on " + dr.ItemArray[3].ToString()));
if (iNumReplies > 0)
{
DataTable dtLastReply = dl.GetLastTopicReplyBy_TopicID(Convert.ToInt32(dr.ItemArray[0]));
//.........这里部分代码省略.........
示例10: btnSubmit_Click
protected void btnSubmit_Click(object sender, EventArgs e)
{
if (lbxMembers.SelectedIndex == -1)
{
string sSubscriptionID = "Free";
string sMembershipType = "0.00";
DataLayer dl = new DataLayer();
DateTime dtJoinDate = DateTime.Now;
int iPassword = rPassword.Next(9999999);
dl.AddMember(tbxEmail.Text, iPassword.ToString(), tbxName.Text, "no_avatar.gif", "", "", "", "", tbxBusinessName.Text, "no_logo.gif", "", dtJoinDate, "", "", "", "", "", "", cbxAdmin.Checked, cbxModerator.Checked, cbxCanPostBlog.Checked, cbxMemberNewsletter.Checked, cbxDailyMotivator.Checked, false, false, "", "", "Not Specified", 0, DateTime.Today, "", "#77BB77,#ffffff,#DDFFDD,#444444,#1985b5,#77BB77,#ffffff,#ffffff,#000000,#0000EE,#CCDDCC", ddlArticleColumn.SelectedValue, sSubscriptionID, sMembershipType);
try
{
WebRequest wrGETURL;
wrGETURL = WebRequest.Create("http://tinyurl.com/api-create.php?url=http://www.ReferralNetworX.com/Profile.aspx?member=" + tbxEmail.Text);
Stream objStream;
objStream = wrGETURL.GetResponse().GetResponseStream();
StreamReader objReader = new StreamReader(objStream);
string sURL = objReader.ReadToEnd();
Yedda.Twitter t = new Yedda.Twitter();
t.Update("ReferralNetworX", "1million!", "New Member! " + dl.GetFullMemberNameBy_Email(tbxEmail.Text) + " has joined us on ReferralNetworX.com " + sURL, Yedda.Twitter.OutputFormatType.XML);
t.Update("Chevex", "Ch3vyF0rd", "New Member! " + dl.GetFullMemberNameBy_Email(tbxEmail.Text) + " has joined us on ReferralNetworX.com " + sURL, Yedda.Twitter.OutputFormatType.XML);
t.Update("WALTatRNX", "robinwalt98", "New Member! " + dl.GetFullMemberNameBy_Email(tbxEmail.Text) + " has joined us on ReferralNetworX.com " + sURL, Yedda.Twitter.OutputFormatType.XML);
}
catch
{
}
SmtpMail.SmtpServer = "relay-hosting.secureserver.net";
MailMessage mm;
////////////////// -= Add Comment To New Member's Profile =- ////////////////////////
int iPerson = rand.Next(2);
string sPerson;
if (iPerson == 0)
{
int iComment = rand.Next(10);
string sComment = "";
if (iComment == 0)
{
sComment = "Welcome to the site! I hope you like what you find.<br /><br />- Alex";
}
else if (iComment == 1)
{
sComment = "Welcome to Referral NetworX! We are glad to have you as a member.<br /><br />- Alex";
}
else if (iComment == 2)
{
sComment = "I love seeing new faces! Welcome to the site.<br /><br />- Alex";
}
else if (iComment == 3)
{
sComment = "Welcome to the site! I look forward to networking with you.<br /><br />- Alex";
}
else if (iComment == 4)
{
sComment = "A new member! I am excited that you have joined us!<br /><br />- Alex";
}
else if (iComment == 5)
{
sComment = "Welcome to the site! We are excited to benefit from the knowledge you have to offer!<br /><br />- Alex";
}
else if (iComment == 6)
{
sComment = "We are excited to have you here! I am confident you will make a great addition to the RNX community!<br /><br />- Alex";
}
else if (iComment == 7)
{
sComment = "Glad you could join us! I look forward to networking with you.<br /><br />- Alex";
}
else if (iComment == 8)
{
sComment = "I am happy you decided to be a part of Referral NetworX! Here is your first thumbs up!<br /><br />- Alex";
}
else if (iComment == 9)
{
sComment = "Welcome to ReferralNetworX.com! Let me know if you need anything at all!<br /><br />- Alex";
}
dl.AddComment("[email protected]", DateTime.Now, sComment, "Member", true, -1, tbxEmail.Text);
dl.AddThumbsUp(tbxEmail.Text);
mm = new MailMessage();
mm.BodyFormat = MailFormat.Html;
mm.To = tbxEmail.Text;
mm.From = "[email protected]";
mm.Subject = "Someone posted a comment on your profile!";
mm.Body = "Alex Ford posted a comment on your profile.";
mm.Body += "<br /><a href=\"http://www.referralnetworx.com/profile.aspx?member=" + tbxEmail.Text + "\">Click to view</a>";
SmtpMail.Send(mm);
}
else if (iPerson == 1)
{
int iComment = rand.Next(6);
string sComment = "";
if (iComment == 0)
{
//.........这里部分代码省略.........
示例11: lbxArticles_SelectedIndexChanged
protected void lbxArticles_SelectedIndexChanged(object sender, EventArgs e)
{
checklist.Visible = false;
cbxDeleteArticle.Checked = false;
cbxDeleteArticle_CheckedChanged(null, null);
addedit.InnerText = "Edit Article";
DataLayer dl = new DataLayer();
DataTable dtArticle = dl.GetArticleBy_ArticleID(Convert.ToInt32(lbxArticles.SelectedValue));
cbxDeleteArticle.Visible = true;
spanAuthor.InnerText = dl.GetFullMemberNameBy_Email(dtArticle.Rows[0].ItemArray[4].ToString());
tbxTitle.Text = dtArticle.Rows[0].ItemArray[2].ToString();
rteBody.Value = dtArticle.Rows[0].ItemArray[3].ToString();
postedby.Visible = true;
cbxDiscussionThread.Checked = false;
cbxDiscussionThread.Visible = false;
}
示例12: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
DataLayer dl = new DataLayer();
if (Request.QueryString["post"] != null)
{
int iPostID = Convert.ToInt32(Request.QueryString["post"]);
Object[] oPost = dl.GetForumPostBy_PostID(iPostID).Rows[0].ItemArray;
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"] = "AddEditPost.aspx?post=" + Request.QueryString["post"];
Response.Redirect("Result.aspx", true);
}
else if ((User.Identity.IsAuthenticated) && (User.Identity.Name.ToLower() != oPost[2].ToString().ToLower()) && (!dl.IsMemberAdmin(User.Identity.Name)))
{
Session["resultColor"] = "#ff0000";
Session["resultTitle"] = "Not Authorized";
Session["resultMessage"] = "You are not authorized to edit this post.";
Session["resultReturnURL"] = "Boards.aspx";
Response.Redirect("Result.aspx", true);
}
else
{
if (!this.IsPostBack)
{
addedit.InnerText = "Edit Post";
rteBody.Value = oPost[4].ToString();
}
}
}
else
{
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"] = "AddEditPost.aspx?topic=" + Request.QueryString["topic"];
Response.Redirect("Result.aspx", true);
}
addedit.InnerText = "Reply To Topic";
}
if (Request.QueryString["rt"] != null)
{
int iRTPostID = Convert.ToInt32(Request.QueryString["rt"]);
DataTable dtRTPost = dl.GetForumPostBy_PostID(iRTPostID);
replyto.InnerHtml = dtRTPost.Rows[0].ItemArray[4].ToString();
postedby.InnerHtml = "Posted by <a href=\"Profile.aspx?member=" + dtRTPost.Rows[0].ItemArray[2].ToString() + "\">" + dl.GetFullMemberNameBy_Email(dtRTPost.Rows[0].ItemArray[2].ToString()) + "</a> on " + dtRTPost.Rows[0].ItemArray[3].ToString();
}
else
{
int iRTTopicID = Convert.ToInt32(Request.QueryString["topic"]);
DataTable dtRTTopic = dl.GetForumTopicBy_TopicID(iRTTopicID);
replyto.InnerHtml = dtRTTopic.Rows[0].ItemArray[5].ToString();
postedby.InnerHtml = "Posted by <a href=\"Profile.aspx?member=" + dtRTTopic.Rows[0].ItemArray[2].ToString() + "\">" + dl.GetFullMemberNameBy_Email(dtRTTopic.Rows[0].ItemArray[2].ToString()) + "</a> on " + dtRTTopic.Rows[0].ItemArray[3].ToString();
}
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>"));
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>"));
}
示例13: btnSubmit_Click
//.........这里部分代码省略.........
HttpWebResponse objResponse = (HttpWebResponse)objRequest.GetResponse();
using (StreamReader responseStream = new StreamReader(objResponse.GetResponseStream()))
{
post_response = responseStream.ReadToEnd();
responseStream.Close();
}
// the response string is broken into an array
// The split character specified here must match the delimiting character specified above
String[] response_array = post_response.Split('|');
////////////////////////////////////////////////////////////////////////////////
DateTime dtNextBillDate = DateTime.Now;
string sSubscriptionID = "Free";
if (response_array[0] == "1")
{
dtNextBillDate = DateTime.Now.AddMonths(1);
ARB arb = new ARB();
sSubscriptionID = arb.CreateSubscription(tbxBillingCreditCard.Text, ddlBillingExpirationYear.SelectedValue + "-" + ddlBillingExpirationMonth.SelectedValue, tbxBillingFirstName.Text, tbxBillingLastName.Text, User.Identity.Name, sPrice, dtNextBillDate);
dl.UpgradeMembership(User.Identity.Name, sSubscriptionID, sMembershipType);
}
else if (response_array[0] == "2")
{
CustomValidator3.IsValid = false;
}
else if (response_array[0] == "3")
{
CustomValidator3.ErrorMessage = "There was an error in processing your transaction.<br />" + response_array[3];
CustomValidator3.IsValid = false;
}
else if (response_array[0] == "4")
{
CustomValidator3.ErrorMessage = "Held for review by Authorize.net.";
CustomValidator3.IsValid = false;
}
upgradeform.Visible = false;
receiptform.Visible = true;
customernextbilldate.InnerText = dtNextBillDate.ToString("D");
customernextbilldate2.InnerText = dtNextBillDate.ToString("D");
customername.InnerText = tbxBillingLastName.Text + ", " + tbxBillingFirstName.Text;
customersubscriptionid.InnerText = sSubscriptionID;
customeraddress.InnerText = tbxBillingAddress.Text;
customercity.InnerText = tbxBillingCity.Text;
customerstate.InnerText = ddlBillingState.SelectedValue;
customerzip.InnerText = tbxBillingZip.Text;
customerlast4.InnerText = tbxBillingCreditCard.Text.Remove(0, tbxBillingCreditCard.Text.Length - 4);
customerexpiration.InnerText = ddlBillingExpirationMonth.SelectedValue.PadLeft(2, '0') + "/" + ddlBillingExpirationYear.SelectedValue;
receiptprice.InnerText = sPrice;
}
else
{
string sSubscriptionID = dl.GetSubscriptionIDBy_Email(User.Identity.Name);
ARB arb = new ARB();
bool bSubscriptionComplete = arb.UpdateSubscription(sSubscriptionID, sPrice);
if (bSubscriptionComplete)
{
dl.UpgradeMembership(User.Identity.Name, sSubscriptionID, sMembershipType);
Session["resultColor"] = "#007700";
Session["resultTitle"] = "Subscription Updated";
Session["resultMessage"] = "Thank you for upgrading, we hope you enjoy your new subscription!";
Session["resultReturnURL"] = "Default.aspx";
Response.Redirect("Result.aspx");
}
else
{
Session["resultColor"] = "#ff0000";
Session["resultTitle"] = "Error";
Session["resultMessage"] = "Something went wrong, your subscription was not updated.";
Session["resultReturnURL"] = "Default.aspx";
Response.Redirect("Result.aspx");
}
}
SmtpMail.SmtpServer = "relay-hosting.secureserver.net";
MailMessage mm;
mm = new MailMessage();
mm.BodyFormat = MailFormat.Html;
mm.To = "[email protected];[email protected]";
mm.From = "[email protected]";
mm.Subject = "Someone upgraded their membership on ReferralNetworX.com!";
mm.Body = dl.GetFullMemberNameBy_Email(User.Identity.Name) + " upgraded their membership to " + sMembershipType + " status.";
SmtpMail.Send(mm);
mm = new MailMessage();
mm.BodyFormat = MailFormat.Html;
mm.To = User.Identity.Name;
mm.From = "[email protected]";
mm.Subject = "Thank you for upgrading!";
mm.Body = "We are glad to have your business and we are eager to get to know you! If you did not request a membership upgrade on ReferralNetworX.com please contact us by emailing [email protected]";
SmtpMail.Send(mm);
}
}
else
{
CustomValidator2.IsValid = false;
}
}
示例14: 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"] = "Blogs.aspx";
// Response.Redirect("Result.aspx", true);
//}
int iPageNumber = 0;
if (Request.QueryString["p"] != null)
{
iPageNumber = Convert.ToInt32(Request.QueryString["p"]);
}
DataLayer dl = new DataLayer();
int iBlogCount;
DataTable dtBlogs;
if (User.Identity.IsAuthenticated)
{
dtBlogs = dl.GetFiveBlogsBy_Page(iPageNumber, "Members Only");
iBlogCount = dl.GetBlogCount("Members Only");
}
else
{
dtBlogs = dl.GetFiveBlogsBy_Page(iPageNumber, "Everyone");
iBlogCount = dl.GetBlogCount("Everyone");
}
int iMaxPages = Convert.ToInt32(Math.Ceiling(Convert.ToDecimal(iBlogCount) / 5m));
pageNav1.NumPages = iMaxPages;
pageNav2.NumPages = iMaxPages;
foreach (DataRow dr in dtBlogs.Rows)
{
if (dr.ItemArray[5].ToString() == "Members Only")
{
blogs.InnerHtml += "<div style=\"background-color:#ddddff; padding:5px;\"><div style=\"text-align:center;\">-= <i>Members Only Blog</i> =-</div><br />";
}
else
{
blogs.InnerHtml += "<div>";
}
blogs.InnerHtml += "<div style=\"text-align:left;font-size:35px;font-family:arial;\"><a class=\"navlink\" href=\"Blog.aspx?bid=" + dr.ItemArray[0].ToString() + "\">" + dr.ItemArray[3].ToString() + "</a></div>";
blogs.InnerHtml += "<div style=\"text-align:left;\">Posted by <a href=\"Profile.aspx?member=" + dr.ItemArray[1].ToString() + "\">" + dl.GetFullMemberNameBy_Email(dr.ItemArray[1].ToString()) + "</a> | " + Convert.ToDateTime(dr.ItemArray[2]).ToString("D") + " | " + dl.GetBlogCommentCount(Convert.ToInt32(dr.ItemArray[0])) + " Comment(s)</div><br />";
string sBody = dr.ItemArray[4].ToString();
if (sBody.Contains('~'))
{
sBody = sBody.Remove(sBody.IndexOf('~'));
blogs.InnerHtml += "<div style=\"text-align:left;\"><table style=\"width:100%;\"><tr><td>" + dr.ItemArray[4].ToString().Remove(dr.ItemArray[4].ToString().IndexOf('~')) + "<br /><br /><b><a class=\"navlink\" href=\"Blog.aspx?bid=" + dr.ItemArray[0].ToString() + "\">(Read More)</a></b><br /></td></tr></table></div>";
}
else
{
blogs.InnerHtml += "<div><i>No Summary.</i><br /><br /><b><a class=\"navlink\" href=\"Blog.aspx?bid=" + dr.ItemArray[0].ToString() + "\">(Read More)</a></b><br /></div>";
}
blogs.InnerHtml += "</div><hr /><br />";
}
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>"));
}
}
示例15: btnSubmit_Click
protected void btnSubmit_Click(object sender, EventArgs e)
{
if (lbxArticles.SelectedIndex == -1)
{
DataLayer dl = new DataLayer();
DateTime dtPostTime = DateTime.Now;
dl.AddArticle(dtPostTime, tbxTitle.Text, rteBody.Value, User.Identity.Name, ddlCategory.SelectedValue);
SqlCommand sc = new SqlCommand("SELECT ArticleID FROM rnxArticles WHERE [email protected] AND [email protected]");
sc.Parameters.Add(new SqlParameter("Title", tbxTitle.Text));
sc.Parameters.Add(new SqlParameter("Date", dtPostTime));
DataSet ds = dl.CustomQuery(sc);
try
{
WebRequest wrGETURL;
wrGETURL = WebRequest.Create("http://tinyurl.com/api-create.php?url=http://www.ReferralNetworX.com/Article.aspx?aid=" + ds.Tables[0].Rows[0].ItemArray[0].ToString());
Stream objStream;
objStream = wrGETURL.GetResponse().GetResponseStream();
StreamReader objReader = new StreamReader(objStream);
string sURL = objReader.ReadToEnd();
Yedda.Twitter t = new Yedda.Twitter();
t.Update("ReferralNetworX", "1million!", "New RNX Article: " + tbxTitle.Text + " " + sURL, Yedda.Twitter.OutputFormatType.XML);
t.Update("Chevex", "Ch3vyF0rd!", "New RNX Article: " + tbxTitle.Text + " " + sURL, Yedda.Twitter.OutputFormatType.XML);
t.Update("WALTatRNX", "robinwalt98", "New RNX Article: " + tbxTitle.Text + " " + sURL, Yedda.Twitter.OutputFormatType.XML);
}
catch
{ }
if (cbxDiscussionThread.Checked)
{
dl.AddForumTopic(14, User.Identity.Name, tbxTitle.Text, "<a href=\"Article.aspx?aid=" + ds.Tables[0].Rows[0].ItemArray[0].ToString() + "\">Click to view article</a><br /><br />Discuss this article below.", dtPostTime, false, false);
SqlCommand sc2 = new SqlCommand("SELECT TopicID FROM rnxForumTopics WHERE [email protected] AND [email protected]");
sc2.Parameters.Add(new SqlParameter("Title", tbxTitle.Text));
sc2.Parameters.Add(new SqlParameter("Date", dtPostTime));
DataSet ds2 = dl.CustomQuery(sc2);
string sTopicID = ds2.Tables[0].Rows[0].ItemArray[0].ToString();
dl.UpdateArticle(Convert.ToInt32(ds.Tables[0].Rows[0].ItemArray[0]), tbxTitle.Text, rteBody.Value + "<br /><br /><a href=\"Topic.aspx?topic=" + sTopicID + "\">Click to discuss this article</a>");
}
SmtpClient smtp = new SmtpClient("localhost");
MailMessage mm;
mm = new MailMessage();
mm.IsBodyHtml = true;
mm.To.Add("[email protected]");
mm.To.Add("[email protected]");
mm.From = new MailAddress("[email protected]");
mm.Subject = "Someone posted an article.";
mm.Body = dl.GetFullMemberNameBy_Email(User.Identity.Name) + " posted an article titled: " + tbxTitle.Text;
mm.Body += "<br /><a href=\"http://www.referralnetworx.com/Article.aspx?aid=" + ds.Tables[0].Rows[0].ItemArray[0].ToString() + "\">Click to view</a>";
mm.Body += "<br /><br />The article is below:<br /><br />" + rteBody.Value;
smtp.Send(mm);
Session["resultColor"] = "#007700";
Session["resultTitle"] = "Article Added";
Session["resultMessage"] = "Article Added Successfuly";
Session["resultReturnURL"] = "Article.aspx?aid=" + ds.Tables[0].Rows[0].ItemArray[0].ToString();
Response.Redirect("Result.aspx");
}
else
{
if (cbxDeleteArticle.Checked)
{
DataLayer dl = new DataLayer();
DataTable dtArticle = dl.GetArticleBy_ArticleID(Convert.ToInt32(lbxArticles.SelectedValue));
try
{
SqlCommand sc = new SqlCommand("SELECT TopicID FROM rnxForumTopics WHERE [email protected] AND [email protected]");
sc.Parameters.Add(new SqlParameter("Title", dtArticle.Rows[0].ItemArray[2].ToString()));
sc.Parameters.Add(new SqlParameter("Date", Convert.ToDateTime(dtArticle.Rows[0].ItemArray[1])));
DataSet ds = dl.CustomQuery(sc);
dl.DeleteForumTopic(Convert.ToInt32(ds.Tables[0].Rows[0].ItemArray[0]));
}
catch
{
}
dl.DeleteArticle(Convert.ToInt32(lbxArticles.SelectedValue));
Session["resultColor"] = "#007700";
Session["resultTitle"] = "Article Deleted";
Session["resultMessage"] = "Article Deleted Successfuly";
Session["resultReturnURL"] = "ManageArticles.aspx";
Response.Redirect("Result.aspx");
}
else
{
DataLayer dl = new DataLayer();
dl.UpdateArticle(Convert.ToInt32(lbxArticles.SelectedValue), tbxTitle.Text, rteBody.Value);
Session["resultColor"] = "#007700";
Session["resultTitle"] = "Article Updated";
Session["resultMessage"] = "Article Updated Successfuly";
Session["resultReturnURL"] = "ManageArticles.aspx";
Response.Redirect("Result.aspx");
}
}
}