Пример #1
0
 private void detach_tblTalkers(tblTalker entity)
 {
     this.SendPropertyChanging();
     entity.tblSession = null;
 }
Пример #2
0
 partial void UpdatetblTalker(tblTalker instance);
Пример #3
0
 partial void DeletetblTalker(tblTalker instance);
Пример #4
0
 private void attach_tblTalkers(tblTalker entity)
 {
     this.SendPropertyChanging();
     entity.tblChatRoom = this;
 }
Пример #5
0
 partial void InserttblTalker(tblTalker instance);
Пример #6
0
 partial void DeletetblTalker(tblTalker instance);
Пример #7
0
		private void detach_tblTalkers(tblTalker entity)
		{
			this.SendPropertyChanging();
			entity.tblSession = null;
		}
Пример #8
0
 partial void UpdatetblTalker(tblTalker instance);
Пример #9
0
 partial void InserttblTalker(tblTalker instance);
Пример #10
0
		private void attach_tblTalkers(tblTalker entity)
		{
			this.SendPropertyChanging();
			entity.tblChatRoom = this;
		}
Пример #11
0
 public static bool SendMessage(tblTalker talker, string message)
 {
     try
     {
         SessionDBDataContext db = new SessionDBDataContext();
         tblMessagePool msgpool = new tblMessagePool();
         msgpool.message = message;
         msgpool.SendTime = DateTime.Now;
         msgpool.talkerID = talker.TalkerID;
         db.tblMessagePools.InsertOnSubmit(msgpool);
         db.SubmitChanges();
         return true;
     }
     catch
     {
         return false;
     }
 }
Пример #12
0
 public static bool JoinChatRoom(Guid ChatRoomID, HttpContext context,
     string alias)
 {
     if (!ChatManager.IsRoomFull(ChatRoomID))
     {
         SessionDBDataContext db = new SessionDBDataContext();
         if (db.tblSessions.Count(
             s => s.SessionID == context.Session.SessionID) == 0)
         {
             ChatManager.CreateSession(context, alias);
         }
         var session = ChatManager.GetSession(context);
         if (db.tblTalkers.Count(t => t.ChatRoomID == ChatRoomID &&
             t.SessionID == session.UID && t.CheckOutTime == null) > 0)
         {
             return false;
         }
         else
         {
             tblTalker talker = new tblTalker();
             talker.ChatRoomID = ChatRoomID;
             talker.CheckInTime = DateTime.Now;
             talker.CheckOutTime = null;
             talker.SessionID = session.UID;
             db.tblTalkers.InsertOnSubmit(talker);
             db.SubmitChanges();
             return true;
         }
     }
     else
     {
         return false;
     }
 }