Esempio n. 1
0
 private void detach_tblTalkers(tblTalker entity)
 {
     this.SendPropertyChanging();
     entity.tblSession = null;
 }
Esempio n. 2
0
 partial void UpdatetblTalker(tblTalker instance);
Esempio n. 3
0
 partial void DeletetblTalker(tblTalker instance);
Esempio n. 4
0
 private void attach_tblTalkers(tblTalker entity)
 {
     this.SendPropertyChanging();
     entity.tblChatRoom = this;
 }
Esempio n. 5
0
 partial void InserttblTalker(tblTalker instance);
 partial void DeletetblTalker(tblTalker instance);
		private void detach_tblTalkers(tblTalker entity)
		{
			this.SendPropertyChanging();
			entity.tblSession = null;
		}
 partial void UpdatetblTalker(tblTalker instance);
 partial void InserttblTalker(tblTalker instance);
Esempio n. 10
0
		private void attach_tblTalkers(tblTalker entity)
		{
			this.SendPropertyChanging();
			entity.tblChatRoom = this;
		}
Esempio n. 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;
     }
 }
Esempio n. 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;
     }
 }