当前位置: 首页>>代码示例>>C#>>正文


C# Usr.HisString方法代码示例

本文整理汇总了C#中Bobs.Usr.HisString方法的典型用法代码示例。如果您正苦于以下问题:C# Usr.HisString方法的具体用法?C# Usr.HisString怎么用?C# Usr.HisString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Bobs.Usr的用法示例。


在下文中一共展示了Usr.HisString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Invite


//.........这里部分代码省略.........
							}
						}

						//We still add this user to the alertedusers list (even if !addThreadUsr) - this just makes sure we don't attempt to send them an invite a second time.
						alertedUsrs.Add(u.K);

						if (addThreadUsr)
						{
							ThreadUsr tu = this.GetThreadUsr(u);
							tu.ChangeStatus(ThreadUsr.StatusEnum.NewInvite, DateTime.Now, false, false);
							try
							{
								addedThreadUsrsUsrKs.Add(u.K);
							}
							catch { }
							tu.InvitingUsrK = invitingUsr.K;
							tu.StatusChangeObjectK = invitingUsr.K;
							tu.StatusChangeObjectType = Model.Entities.ObjectType.Usr;
							tu.Update();

							count++;

							#region sendInviteAlerts
							if (sendInviteAlerts)
							{
								try
								{
									Mailer usrMail = new Mailer();
									if (isNewThread && this.Private && this.ParentObjectType.Equals(Model.Entities.ObjectType.Photo))
									{
										usrMail.Subject = invitingUsr.NickName + " sent you a photo";
										usrMail.Body += "<h1>" + invitingUsr.NickName + " sent you a photo</h1>";
										usrMail.Body += "<p align=\"center\"><a href=\"[LOGIN]\"><img border=\"0\" src=\"" + this.ParentPhoto.WebPath + "\" width=\"" + this.ParentPhoto.WebWidth + "\" height=\"" + this.ParentPhoto.WebHeight + "\" class=\"BorderBlack All\" /></a></p>";
									}
									else if (isNewThread)
									{
										usrMail.Subject = invitingUsr.NickName + " posts: \"" + this.SubjectSnip(40) + "\"";
										usrMail.Body += "<h1>" + invitingUsr.NickName + " has posted a new topic</h1>";
									}
									else
									{
										usrMail.Subject = invitingUsr.NickName + " invites you to: \"" + this.SubjectSnip(40) + "\"";
										usrMail.Body += "<h1>" + invitingUsr.NickName + " invites you to a topic</h1>";
									}

									usrMail.Body += "<p>The subject is: \"" + this.Subject + "\"</p>";
									usrMail.Body += "<p>To read " + invitingUsr.HisString(false) + " message, check out the <a href=\"[LOGIN]\">topic page</a>.</p>";
									usrMail.Body += "<p>If you want to stop " + invitingUsr.HimString(false) + " inviting you to topics, click the <i>Stop " + invitingUsr.NickName + " inviting me to chat topics</i> button on <a href=\"[LOGIN(" + invitingUsr.Url() + ")]\">" + invitingUsr.HisString(false) + " profile page</a>.</p>";
									usrMail.TemplateType = Mailer.TemplateTypes.AnotherSiteUser;
									usrMail.RedirectUrl = this.UrlDiscussion();
									usrMail.UsrRecipient = u;
									//usrMail.Bulk=usInvites.Count>5;
									usrMail.Bulk = false; // This is interesting... if people are invited by email, they should get the invite really...
									usrMail.Inbox = true;
									usrMail.Send();
								}
								catch (Exception ex) { Global.Log("1d3726bf-0715-4404-9059-4e53ca9e3dc5", ex); }

								//try
								//{
								//    if (u.IsLoggedOn && u.DateTimeLastPageRequest > DateTime.Now.AddMinutes(-5))
								//    {
								//        XmlDocument xmlDoc = new XmlDocument();
								//        XmlNode n = xmlDoc.CreateElement("privateMessageAlert");
								//        n.AddAttribute("nickName", invitingUsr.NickNameSafe);
								//        n.AddAttribute("stmu", invitingUsr.StmuParams);
								//        n.AddAttribute("usrK", invitingUsr.K.ToString());
								//        if (invitingUsr.HasPic)
								//            n.AddAttribute("pic", invitingUsr.Pic.ToString());
								//        else
								//            n.AddAttribute("pic", "0");
								//        n.AddAttribute("k", this.K.ToString());
								//        if (postedComment == null)
								//        {
								//            n.InnerText = this.Url();
								//        }
								//        else
								//        {
								//            n.InnerText = postedComment.Url(this);
								//        }
								//        Chat.SendChatItem(ItemType.Invite, n, DateTime.Now.Ticks, u.K, Guid.NewGuid());

								//    }
								//}
								//catch (Exception ex) { Global.Log("2902fd82-e8a4-49c2-9e33-ccfca01ca1f9", ex); }
							}
							#endregion
						}
					}
				}
			}

			if (joinChatRoom)
			{
				Guid room = this.GetRoomSpec().Guid;
				Chat.JoinRoom(room, addedThreadUsrsUsrKs.ToArray());
			}

			return count;
		}
开发者ID:davelondon,项目名称:dontstayin,代码行数:101,代码来源:Thread.cs

示例2: SendWelcomeEmail

		public bool SendWelcomeEmail(Usr invitingUsr, Group invitingGroup, string inviteMessage)
		{
			if (this.EmailHold)
				return false;

			Mailer sm = new Mailer();
			sm.UsrRecipient = this;
			if (invitingGroup == null)
			{
				if (invitingUsr == null)
				{
					sm.Subject = "We've created you a Don't Stay In account!";
					sm.Body = @"
<p>
Don't Stay In is <i>the</i> place to plan your clubbing calendar. Our 
team of spotters are busy taking photos of clubbers at the hottest 
parties in your area and throughout the world. 
</p>
<p>
If you've had your photo taken, you can look through our galleries 
to find it. You can chat live with other clubbers and catch up with 
the latest gossip.
</p>
<p align=""center"" style=""margin:10px 0px 8px 0px;"">
<a href=""[LOGIN]"" style=""font-size:18px;font-weight:bold;"">Click here 
to go to DontStayIn</a>
</p>
";
				}
				else
				{
					sm.Subject = invitingUsr.NickName + " has invited you to DontStayIn!";
					sm.Body = "<p><b>" + invitingUsr.NickName + @" has invited you to DontStayIn!</b></p>
<p>
DontStayIn is <i>the</i> place to plan your clubbing calendar. Our 
team of spotters are busy taking photos of clubbers at the hottest 
parties in your area and throughout the world. 
</p>
<p>
If you've had your photo taken, you can look through our galleries 
to find it. You can chat live with other clubbers and catch up with 
the latest gossip.
</p>
<p align=""center"" style=""margin:10px 0px 8px 0px;"">
<a href=""[LOGIN]"" style=""font-size:18px;font-weight:bold;"">Click here 
to go to DontStayIn</a>
</p>
";
				}
			}
			else
			{
				GroupUsr invitingGroupUsr = invitingGroup.GetGroupUsr(invitingUsr);
				sm.RedirectUrl = invitingGroup.Url();
				sm.Subject = invitingUsr.NickName + @" has invited you to " + (invitingGroupUsr != null && invitingGroupUsr.Moderator ? invitingUsr.HisString(false) : "a") + @" DontStayIn group: " + invitingGroup.FriendlyName;
				string pic = @"<table cellspacing=""0"" cellpadding=""0"" border=""0"" style=""margin:10px 5px 5px 1px;""><tr><td valign=""top"">";
				string picEnd = "</td></tr></table>";
				if (invitingUsr.HasPic)
				{
					pic = @"<table cellspacing=""0"" cellpadding=""0"" border=""0"" style=""margin:10px 5px 5px 1px;""><tr><td valign=""top"" style=""padding:0px 10px 0px 0px;"">";
					pic += "<a href=\"[LOGIN]\"><img src=\"" + invitingUsr.PicPath + "\" class=\"BorderBlack All\" width=\"100\" height=\"100\" vspace=\"3\" border=\"0\"></a></td><td valign=\"top\">";
					picEnd = "</td></tr></table>";
				}
				string members = "";
				if (invitingGroup.TotalMembers > 5)
				{
					Query q = new Query();
					q.TableElement = Usr.GroupJoin;
					q.QueryCondition = new And(new Q(Group.Columns.K, invitingGroup.K), new Q(Usr.Columns.Pic, QueryOperator.NotEqualTo, Guid.Empty));
					q.TopRecords = 5;
					q.OrderBy = new OrderBy(OrderBy.OrderDirection.Random);
					q.Columns = Usr.LinkColumns;
					UsrSet us = new UsrSet(q);
					if (us.Count == 5)
					{
						members = @"<p><b>" + invitingGroup.FriendlyName + @"</b> has " + invitingGroup.TotalMembers.ToString("#,##0") + @" members. Here's a few of them:</p>";
						members += @"<table cellspacing=""4"" cellpadding=""4"" border=""0"" width=""100%""><tr>";
						foreach (Usr uPic in us)
						{
							members += "<td width=\"20%\" valign=\"top\"><center><a href=\"[LOGIN(" + uPic.Url() + ")]\"><img src=\"" + uPic.PicPath + "\" width=\"75\" height=\"75\" style=\"margin:0px 0px 5px 0px;\" class=\"BorderBlack All\"><br>" + Cambro.Misc.Utility.Snip(uPic.NickName, 12) + "</a></center></td>";
						}
						members += @"</tr></table>";
					}
				}
				sm.Body = @"
" + pic + @"
<i style=""font-size:18px;""><b>""</b>" + Cambro.Web.Helpers.Strip(inviteMessage, true, true, false, true).Replace("\n", "<br>") + @"<b>""</b></i>
" + picEnd + @"
<p>" + invitingUsr.LinkEmail() + @" (" + invitingUsr.FirstName + @") has invited you to " +
	 (invitingGroupUsr != null && invitingGroupUsr.Moderator ? invitingUsr.HisString(false) : "a") + @" DontStayIn group!
You can use this to keep in contact with your friends. Here's a quick description 
of <b>" + invitingGroup.FriendlyName + @"</b>:</p>
<p>
<i>" + invitingGroup.Description + @"</i>
</p>
" + members + @"
";
			}

			sm.Send();
//.........这里部分代码省略.........
开发者ID:davelondon,项目名称:dontstayin,代码行数:101,代码来源:Usr.cs

示例3: InvitePrivate

		private void InvitePrivate(Usr InvitedUsr, GroupUsr InvitedGroupUsr, Usr InvitingUsr, GroupUsr InvitingGroupUsr, 
			string InviteMessage)
		{
			string inviteMessageStripped = Cambro.Web.Helpers.Strip(InviteMessage,true,true,false,true);
			if (InvitedGroupUsr==null)
			{
				InvitedGroupUsr = new GroupUsr();
				InvitedGroupUsr.UsrK = InvitedUsr.K;
				InvitedGroupUsr.GroupK = this.K;
			}
			InvitedGroupUsr.Status = GroupUsr.StatusEnum.Invite;
			InvitedGroupUsr.StatusChangeDateTime = DateTime.Now;
			InvitedGroupUsr.StatusChangeUsrK = InvitingUsr.K;
			if (InvitedGroupUsr.InviteUsrK==0)
			{
				InvitedGroupUsr.InviteUsrK = InvitingUsr.K;
				InvitedGroupUsr.InviteMessage = inviteMessageStripped;
			}
			else if (InvitedGroupUsr.InviteUsrK != InvitingUsr.K)
			{
				//already had an inviting usr
				InvitingUsr = InvitedGroupUsr.InviteUsr;
				InvitingGroupUsr = GetGroupUsr(InvitingUsr);
				InviteMessage = InvitedGroupUsr.InviteMessage;
				inviteMessageStripped = Cambro.Web.Helpers.Strip(InviteMessage, true, true, false, true);
			}
			
			

			if (InvitedUsr.AddedByGroupK!=this.K)
			{
				string messageString = "";
				if (InviteMessage.Length>0)
					messageString = "</p><p>"+InvitedGroupUsr.InviteUsr.LinkEmail()+" left you this messsage:</p><p><b>"+inviteMessageStripped+"</b></p><p>";

				Mailer sm = new Mailer();
				sm.UsrRecipient = InvitedUsr;

				sm.RedirectUrl = this.Url();

				sm.Subject = InvitingUsr.NickName + @" has invited you to " + (InvitingGroupUsr!=null && InvitingGroupUsr.Moderator ? InvitingUsr.HisString(false) : "a") + @" group: " + this.FriendlyName;
				string pic = "<p>";
				string picEnd = "</p>";
				if (InvitingUsr.HasPic)
				{
					pic = @"<table cellspacing=""0"" cellpadding=""0"" border=""0"" style=""margin:10px 5px 5px 1px;""><tr><td valign=""top"" style=""padding:0px 10px 0px 0px;"">";
					pic += "<a href=\"[LOGIN(" + InvitingUsr.Url() + ")]\"><img src=\"" + InvitingUsr.PicPath + "\" class=\"BorderBlack All\" width=\"100\" height=\"100\" vspace=\"3\" border=\"0\"></a></td><td valign=\"top\">";
					picEnd = "</td></tr></table>";
				}
				string members = "";
				if (this.TotalMembers>5)
				{
					Query q = new Query();
					q.TableElement = Usr.GroupJoin;
					q.QueryCondition = new And(new Q(Group.Columns.K, this.K), new Q(Usr.Columns.Pic,QueryOperator.NotEqualTo,Guid.Empty));
					q.TopRecords=5;
					q.OrderBy=new OrderBy(OrderBy.OrderDirection.Random);
					q.Columns=Usr.LinkColumns;
					UsrSet us = new UsrSet(q);
					if (us.Count==5)
					{
						members = @"<p><b>"[email protected]"</b> has "+this.TotalMembers.ToString("#,##0")[email protected]" members. Here's a few of them:</p>";
						members += @"<table cellspacing=""4"" cellpadding=""4"" border=""0"" width=""100%""><tr>";
						foreach (Usr uPic in us)
						{
							members += "<td width=\"20%\" valign=\"top\"><center><a href=\"[LOGIN(" + uPic.Url() + ")]\"><img src=\"" + uPic.PicPath + "\" width=\"75\" height=\"75\" style=\"margin:0px 0px 5px 0px;\" class=\"BorderBlack All\"><br>" + Cambro.Misc.Utility.Snip(uPic.NickName, 12) + "</a></center></td>";
						}
						members += @"</tr></table>";
					}
				}
				string inviteMessage = "";
				if (Cambro.Web.Helpers.Strip(InviteMessage,true,true,true,true).Length==0)
					inviteMessage = "Hi!";
				else
					inviteMessage = Cambro.Web.Helpers.Strip(InviteMessage,true,true,false,true).Replace("\n","<br>");


				[email protected]"
"[email protected]"
<i style=""font-size:18px;""><b>""</b>"[email protected]"<b>""</b></i>
"[email protected]"
<p>" + InvitingUsr.LinkEmail() + @" has invited you to " + (InvitingGroupUsr != null && InvitingGroupUsr.Moderator ? InvitingUsr.HisString(false) : "a") + @" group!
You can use this to keep in contact with your friends. Here's a quick 
description of <b>" [email protected]"</b>:</p>
<p>
<i>"[email protected]"</i>
</p>
"+members+ @"
<p align=""center"" style=""margin:10px 0px 8px 0px;"">
<a href=""[LOGIN("+this.UrlApp("join")[email protected]")]"" style=""font-size:18px;font-weight:bold;"">Join the group</a> | <a href=""[LOGIN]"" style=""font-size:18px;font-weight:bold;"">decline the invite</a>
</p>
";
				sm.Send();


			}
			InvitedGroupUsr.Update();
		}
开发者ID:davelondon,项目名称:dontstayin,代码行数:98,代码来源:Group.cs


注:本文中的Bobs.Usr.HisString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。