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 Title=@Title AND Date=@Date"); 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 = "*****@*****.**"; 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); } }
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); }
protected void btnSubmit_Click(object sender, EventArgs e) { if (!cbxDelete.Checked) { if (bNew) { dtDate = DateTime.Now; int iBlogNum = DataLayer.GetBlogCountDeleted(); DataLayer.AddBlog(tbxTitle.Text, rteBody.Text.Replace("<", "<").Replace(">", ">").Replace("&", "&"), dtDate); try { Yedda.Twitter t = new Yedda.Twitter(); WebRequest wrGETURL; wrGETURL = WebRequest.Create("http://tinyurl.com/api-create.php?url=http://www.fordscleaning.com/Blog.aspx?blog=" + iBlogNum.ToString()); Stream objStream; objStream = wrGETURL.GetResponse().GetResponseStream(); StreamReader objReader = new StreamReader(objStream); string sURL = objReader.ReadToEnd(); t.Update("WALTatRNX", "robinwalt98", "New Blog Post: " + tbxTitle.Text + " " + sURL, Yedda.Twitter.OutputFormatType.XML); } catch { } Response.Redirect("http://www.fordscleaning.com/Blog.aspx?blog=" + Convert.ToString(DataLayer.GetBlogCountDeleted() - 1)); } else { DataLayer.UpdateBlog(iBlogID, tbxTitle.Text, rteBody.Text.Replace("<", "<").Replace(">", ">").Replace("&", "&")); Response.Redirect("http://www.fordscleaning.com/Blog.aspx?blog=" + iBlogID.ToString()); } } else { DataLayer.DeleteBlog(iBlogID); Response.Redirect("http://www.fordscleaning.com/FordsBlog.aspx"); } }
protected void btnSubmit_Click(object sender, EventArgs e) { if (lbxBlogs.SelectedIndex == -1) { DataLayer dl = new DataLayer(); DateTime dtPostTime = DateTime.Now; dl.AddBlog(User.Identity.Name, dtPostTime, tbxTitle.Text, rteBody.Value, ddlAccessLevel.SelectedValue); SqlCommand sc = new SqlCommand("SELECT BlogID FROM rnxBlogs WHERE Title=@Title AND Date=@Date"); 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/Blog.aspx?bid=" + 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 Blog: " + tbxTitle.Text + " " + sURL, Yedda.Twitter.OutputFormatType.XML); t.Update("Chevex", "Ch3vyF0rd!", "New RNX Blog: " + tbxTitle.Text + " " + sURL, Yedda.Twitter.OutputFormatType.XML); t.Update("WALTatRNX", "robinwalt98", "New RNX Blog: " + tbxTitle.Text + " " + sURL, Yedda.Twitter.OutputFormatType.XML); } catch { } SmtpClient smtp = new SmtpClient("localhost"); MailMessage mm; mm = new MailMessage(); mm.IsBodyHtml = true; mm.To.Add("*****@*****.**"); mm.To.Add("*****@*****.**"); mm.From = new MailAddress("*****@*****.**"); mm.Subject = "Someone posted a blog."; mm.Body = dl.GetFullMemberNameBy_Email(User.Identity.Name) + " posted a blog titled: " + tbxTitle.Text; mm.Body += "<br /><a href=\"http://www.referralnetworx.com/Blog.aspx?bid=" + ds.Tables[0].Rows[0].ItemArray[0].ToString() + "\">Click to view</a>"; mm.Body += "<br /><br />The blog is below:<br /><br />" + rteBody.Value; smtp.Send(mm); Session["resultColor"] = "#007700"; Session["resultTitle"] = "Blog Added"; Session["resultMessage"] = "Blog Added Successfuly"; Session["resultReturnURL"] = "Blog.aspx?bid=" + ds.Tables[0].Rows[0].ItemArray[0].ToString(); Response.Redirect("Result.aspx"); } else { if (cbxDeleteBlog.Checked) { DataLayer dl = new DataLayer(); dl.DeleteBlog(Convert.ToInt32(lbxBlogs.SelectedValue)); Session["resultColor"] = "#007700"; Session["resultTitle"] = "Blog Deleted"; Session["resultMessage"] = "Blog Deleted Successfuly"; Session["resultReturnURL"] = "ManageBlogs.aspx"; Response.Redirect("Result.aspx"); } else { DataLayer dl = new DataLayer(); dl.UpdateBlog(Convert.ToInt32(lbxBlogs.SelectedValue), tbxTitle.Text, rteBody.Value, ddlAccessLevel.SelectedValue); Session["resultColor"] = "#007700"; Session["resultTitle"] = "Blog Updated"; Session["resultMessage"] = "Blog Updated Successfuly"; Session["resultReturnURL"] = "ManageBlogs.aspx"; Response.Redirect("Result.aspx"); } } }
private bool PostTheUpdate() { LocationFinder.StopGPS(); if (!string.IsNullOrEmpty(StatusText)) { Cursor.Current = Cursors.WaitCursor; string UpdateText = TrimTo140(StatusText); if (string.IsNullOrEmpty(UpdateText)) { MessageBox.Show("There was an error shortening the text. Please shorten the message or try again later."); return false; } if (!string.IsNullOrEmpty(picturePath) && pictureService.CanUploadMessage && ClientSettings.SendMessageToMediaService ) { PicturePostObject ppo = new PicturePostObject(); ppo.Filename = picturePath; ppo.Username = AccountToSet.UserName; ppo.Password = AccountToSet.Password; ppo.Message = StatusText; if (pictureService.CanUploadGPS && this.GPSLocation != null) { try { ppo.Lat = GPSLocation.Split(',')[0]; ppo.Lon = GPSLocation.Split(',')[1]; } catch { } } return pictureService.PostPictureMessage(ppo); } else { Yedda.Twitter TwitterConn = new Yedda.Twitter(); TwitterConn.AccountInfo = this.AccountToSet; try { if (this.GPSLocation != null) { TwitterConn.SetLocation(this.GPSLocation); } } catch { } string retValue = TwitterConn.Update(UpdateText, in_reply_to_status_id, Yedda.Twitter.OutputFormatType.XML); uploadedPictureURL = string.Empty; uploadingPicture = false; if (string.IsNullOrEmpty(retValue)) { MessageBox.Show("Error posting status -- empty response. You may want to try again later."); return false; } try { Library.status.DeserializeSingle(retValue, AccountToSet); } catch { MessageBox.Show("Error posting status -- bad response. You may want to try again later."); return false; } return true; } } return true; }
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("*****@*****.**", 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 = "*****@*****.**"; 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) { 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"; } else if (iComment == 5) { sComment = "Welcome to Referral NetworX! Your journey to building quality relationships and expanding your network has begun!<br /><br />- Walt"; } dl.AddComment("*****@*****.**", 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 = "*****@*****.**"; mm.Subject = "Someone posted a comment on your profile!"; mm.Body = "Walt 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); } ////////////////////////////////////////////////////////////// mm = new MailMessage(); mm.BodyFormat = MailFormat.Html; mm.To = "[email protected];[email protected]"; mm.From = "*****@*****.**"; mm.Subject = "Someone signed up on ReferralNetworX.com!"; 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 = "*****@*****.**"; 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"); } } }
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 Title=@Title AND Date=@Date"); 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 Title=@Title AND Date=@Date"); 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("*****@*****.**"); mm.To.Add("*****@*****.**"); mm.From = new MailAddress("*****@*****.**"); 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 Title=@Title AND Date=@Date"); 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"); } } }
private bool PostTheUpdate() { LocationFinder.StopPosition(); if (!string.IsNullOrEmpty(StatusText) || (!string.IsNullOrEmpty(picturePath) && pictureService.CanUploadMessage && ClientSettings.SendMessageToMediaService)) { Cursor.Current = Cursors.WaitCursor; var updateText = TrimTo140(StatusText); if(updateText.Length>140) { if (PockeTwit.Localization.LocalizedMessageBox.Show("The text is still too long. If you post it twitter will cut off the end. Post anyway?", "Long Text", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == System.Windows.Forms.DialogResult.No) { return false; } } if (!string.IsNullOrEmpty(picturePath) && pictureService.CanUploadMessage && ClientSettings.SendMessageToMediaService ) { PicturePostObject ppo = new PicturePostObject(); ppo.Filename = picturePath; ppo.Username = AccountToSet.UserName; ppo.Password = AccountToSet.Password; ppo.Message = StatusText; if (pictureService.CanUploadGPS && GPSLocation != null) { try { ppo.Lat = GPSLocation.Split(',')[0]; ppo.Lon = GPSLocation.Split(',')[1]; } catch { } } return pictureService.PostPictureMessage(ppo); } else { Yedda.Twitter TwitterConn = new Yedda.Twitter(); TwitterConn.AccountInfo = AccountToSet; try { if (GPSLocation != null) { TwitterConn.SetLocation(GPSLocation); } } catch { } string retValue = string.Empty; string userID = IsDirectMessage(updateText); if (string.IsNullOrEmpty(userID)) retValue = TwitterConn.Update(updateText, in_reply_to_status_id, Yedda.Twitter.OutputFormatType.XML); else { retValue = TwitterConn.SendDirectMessage(userID, updateText.Substring(updateText.IndexOf(userID) + userID.Length + 1), in_reply_to_status_id, Yedda.Twitter.OutputFormatType.XML); } uploadedPictureURL = string.Empty; uploadingPicture = false; if (string.IsNullOrEmpty(retValue)) { PockeTwit.Localization.LocalizedMessageBox.Show("Error posting status -- empty response. You may want to try again later."); return false; } try { Library.status.DeserializeSingle(retValue, AccountToSet); } catch { PockeTwit.Localization.LocalizedMessageBox.Show("Error posting status -- bad response. You may want to try again later."); return false; } return true; } } return true; }
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("*****@*****.**", 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 = "*****@*****.**"; 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) { 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"; } else if (iComment == 5) { sComment = "Welcome to Referral NetworX! Your journey to building quality relationships and expanding your network has begun!<br /><br />- Walt"; } dl.AddComment("*****@*****.**", 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 = "*****@*****.**"; mm.Subject = "Someone posted a comment on your profile!"; mm.Body = "Walt 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); } ////////////////////////////////////////////////////////////// mm = new MailMessage(); mm.BodyFormat = MailFormat.Html; mm.To = "[email protected];[email protected]"; mm.From = "*****@*****.**"; mm.Subject = "Someone signed up on ReferralNetworX.com!"; 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 = "*****@*****.**"; 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"); } } }