protected string GetPrayerBlogs() { string sql = "Select * from PrayerRequest Inner Join Users on Users.ID = PrayerRequest.UserID order by PrayerRequest.Added desc"; DataTable dt = new DataTable(); try { dt = gData.GetDataTable2(sql); }catch (Exception) { MsgBox("Error", "Contact [email protected]", this); } string html = "<table class=saved><tr><th width=20%>User</th><th width=20%>Added<th width=50%>Subject"; for (int y = 0; y < dt.Rows.Count; y++) { SavedObject s = RowToObject(dt.Rows[y]); string sUserName = NotNull(s.Props.UserName); if (sUserName == "") { sUserName = "******"; } string sAnchor = "<a href='PrayerView.aspx?id=" + s.Props.id.ToString() + "'>"; string div = sAnchor + "<tr><td>" + DataOps.GetAvatar(s.Props.Picture) + " " + sUserName + "</td>" + UICommon.GetTd(dt.Rows[y], "Added", sAnchor) + UICommon.GetTd(dt.Rows[y], "subject", sAnchor) + "</tr>"; html += div + "\r\n"; } html += "</table>"; return(html); }
public string GetTweet() { // Displays the tweet that the user clicked on from the web list. string id = Request.QueryString["id"] ?? ""; if (id == "") { return("N/A"); } MarkRead(id, gUser(this).UserId); string sql = "Select * from Tweet left Join Users on Users.ID = Tweet.UserID where Tweet.id = @id"; SqlCommand command = new SqlCommand(sql); command.Parameters.AddWithValue("@id", id); DataTable dt = gData.GetDataTable(command); if (dt.Rows.Count < 1) { MsgBox("Not Found", "We are unable to find this item.", this); return(""); } SavedObject s = RowToObject(dt.Rows[0]); string sUserPic = DataOps.GetAvatar(s.Props.Picture); string sUserName = NotNull(s.Props.UserName); if (sUserName == "") { sUserName = "******"; } string sHTMLBody = ReplaceURLs(s.Props.Body); string sBody = "<div style='min-height:300px'><span style=''>" + sHTMLBody + "</span></div>"; string div = "<table style='padding:10px;' width=73%><tr><td>User:<td>" + sUserPic + "</tr>" + "<tr><td>User Name:<td>" + sUserName + "</tr>" + "<tr><td>Added:<td>" + s.Props.Added.ToString() + "</td></tr>" + "<tr><td>Subject:<td>" + s.Props.Subject + "</td></tr>" + "<tr><td> </tr><tr><td width=8%>Body:<td style='border:1px solid lightgrey;min-height:300px' colspan=1 xbgcolor='grey' width=40%>" + sBody + "</td></tr></table>"; div += UICommon.GetComments(id, this); return(div); }
public string GetPrayer() { // Displays the prayer that the user clicked on from the web list. string id = Request.QueryString["id"] ?? ""; if (id == "") { return("N/A"); } string sql = "Select * from PrayerRequest Inner Join Users on Users.ID = PrayerRequest.UserID where prayerrequest.id = @id"; SqlCommand command = new SqlCommand(sql); command.Parameters.AddWithValue("@id", id); DataTable dt = gData.GetDataTable(command); if (dt.Rows.Count < 1) { MsgBox("Not Found", "We are unable to find this prayer.", this); return(""); } SavedObject s = RowToObject(dt.Rows[0]); string sUserPic = DataOps.GetAvatar(s.Props.Picture); string sUserName = NotNull(s.Props.UserName); if (sUserName == "") { sUserName = "******"; } string sBody = " <textarea style='width: 70%;' id=txtbody rows=25 cols=65>" + s.Props.Body + "</textarea>"; string div = "<table style='padding:10px;' width=100%><tr><td>User:<td>" + sUserPic + "</tr>" + "<tr><td>User Name:<td><h2>" + sUserName + "</h2></tr>" + "<tr><td>Added:<td>" + s.Props.Added.ToString() + "</td></tr>" + "<tr><td>Subject:<td>" + s.Props.Subject + "</td></tr>" + "<tr><td>Body:<td colspan=2>" + sBody + "</td></tr></table>"; div += UICommon.GetComments(id, this); return(div); }