Ejemplo n.º 1
0
        public void LogoutUser(string roomId, string chatUsrId)
        {
            try
            {
                var    dbChatAppDemoEntities = new ChatAppDemoEntities();
                string chatUserId            = chatUsrId;

                var loggedInUser = (dbChatAppDemoEntities.LoggedInUseIds.Where(lIu => lIu.UserId == chatUserId &&
                                                                               lIu.RoomId == roomId)).First();

                dbChatAppDemoEntities.DeleteObject(loggedInUser);
                dbChatAppDemoEntities.SaveChanges();

                InsertMess("Just Logged Out! " + DateTime.Now.ToString(CultureInfo.InvariantCulture), roomId, chatUsrId);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
        }
Ejemplo n.º 2
0
        public void LogoutUser(string roomId, string chatUsrId)
        {
            try
            {
                var dbChatAppDemoEntities = new ChatAppDemoEntities();
                string chatUserId = chatUsrId;

                var loggedInUser = (dbChatAppDemoEntities.LoggedInUseIds.Where(lIu => lIu.UserId == chatUserId
                                                                                      && lIu.RoomId == roomId)).First();

                dbChatAppDemoEntities.DeleteObject(loggedInUser);
                dbChatAppDemoEntities.SaveChanges();

                InsertMess("Just Logged Out! " + DateTime.Now.ToString(CultureInfo.InvariantCulture), roomId, chatUsrId);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
        }