Example #1
0
 public static Guid CreateChatRoom(string roomName, string password,
     bool isLock, int maxUserNumber, bool needPassword)
 {
     SessionDBDataContext db = new SessionDBDataContext();
     tblChatRoom room = new tblChatRoom();
     room.ChatRoomID = Guid.NewGuid();
     room.ChatRoomName = roomName;
     room.ChatRoomPassword = password;
     room.IsLock = isLock;
     room.MaxUserNumber = maxUserNumber;
     room.NeedPassword = needPassword;
     db.tblChatRooms.InsertOnSubmit(room);
     db.SubmitChanges();
     return room.ChatRoomID;
 }
Example #2
0
 partial void DeletetblChatRoom(tblChatRoom instance);
Example #3
0
 partial void UpdatetblChatRoom(tblChatRoom instance);
Example #4
0
 partial void InserttblChatRoom(tblChatRoom instance);
 partial void DeletetblChatRoom(tblChatRoom instance);
 partial void UpdatetblChatRoom(tblChatRoom instance);
 partial void InserttblChatRoom(tblChatRoom instance);
Example #8
0
 public static List<tblMessagePool> RecieveMessage(tblChatRoom room)
 {
     SessionDBDataContext db = new SessionDBDataContext();
     if (db.tblMessagePools.Count(
         msg => room.tblTalkers.Contains(msg.tblTalker)) > 0)
     {
         return (from messages in db.tblMessagePools
                 where messages.tblTalker.ChatRoomID == room.ChatRoomID
                 select messages).ToList();
     }
     else
     {
         return null;
     }
 }