本文整理汇总了C#中DataLayer.AddComment方法的典型用法代码示例。如果您正苦于以下问题:C# DataLayer.AddComment方法的具体用法?C# DataLayer.AddComment怎么用?C# DataLayer.AddComment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataLayer
的用法示例。
在下文中一共展示了DataLayer.AddComment方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
}
}
示例2: btnAddComment_Click
protected void btnAddComment_Click(object sender, EventArgs e)
{
if (tbxCode.Text == Session["CaptchaImageText"].ToString())
{
int iBlogID = Convert.ToInt32(Request.QueryString["bid"]);
string sWebsite = tbxWebsite.Text;
if (tbxWebsite.Text.Length == 0)
{
sWebsite = "nosite";
}
DataLayer dl = new DataLayer();
dl.AddComment(tbxAuthor.Text, iBlogID, DateTime.Now, sWebsite, tbxComment.Text.Replace("\r", "<br />").Replace("\n", ""));
Response.Redirect(Request.RawUrl, true);
}
else
{
CustomValidator1.IsValid = false;
}
}
示例3: 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);
}
示例4: 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)
{
//.........这里部分代码省略.........
示例5: btnSubmit_Click
protected void btnSubmit_Click(object sender, EventArgs e)
{
this.Validate("signup");
if (Page.IsValid)
{
if (cbxAgree.Checked)
{
DataLayer dl = new DataLayer();
if (!dl.EmailExists(tbxEmail.Text))
{
//SmtpClient smtp = new SmtpClient("localhost");
//MailMessage mm;
dl.AddMember(tbxEmail.Text, tbxPassword.Text, tbxName.Text, "no_avatar.gif", "", "", "", "", "", "no_logo.gif", "", DateTime.Now, "", "", "", "", "", "", false, false, false, true, true, false, false, "", "", "Not Specified", 0, DateTime.Now, "Not Selected", "#77BB77,#ffffff,#DDFFDD,#444444,#1985b5,#77BB77,#ffffff,#ffffff,#000000,#0000EE,#CCDDCC", "None", "", "");
#region -= Add Comments to New Member Profile =-
int iPerson = rand.Next(2);
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.IsBodyHtml = true;
//mm.To.Add(tbxEmail.Text);
//mm.From = new MailAddress("[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>";
//smtp.Send(mm);
}
else if (iPerson == 1)
{
int iComment = rand.Next(6);
string sComment = "";
if (iComment == 0)
{
sComment = "Hi and welcome to Referral NetworX! Our mission is your success!<br /><br />- Walt";
}
else if (iComment == 1)
{
sComment = "Welcome to Referral NetworX! I am really looking forward to networking with you. Here's to you continued success!<br /><br />- Walt";
}
else if (iComment == 2)
{
sComment = "Its great to have you as a member of Referral NetworX! We are here to help you with your continued success!<br /><br />- Walt";
}
else if (iComment == 3)
{
sComment = "Congratulations! You are now a member of Referral NetworX. Our mission is your success!<br /><br />- Walt";
}
else if (iComment == 4)
{
sComment = "Welcome! Referral NetworX is your beginning to expanding your personal network! Relationship, Relationship, Relationship!<br /><br />- Walt";
//.........这里部分代码省略.........