Exemple #1
0
        public static int GetLastMessageID(LoginUser loginUser)
        {
            ChatMessages messages = new ChatMessages(loginUser);

            using (SqlCommand command = new SqlCommand())
            {
                command.CommandText = @"SELECT MAX(ChatMessageID) FROM ChatMessages";
                command.CommandType = CommandType.Text;
                object o = messages.ExecuteScalar(command, "ChatParticipants");
                if (o == null || o == DBNull.Value)
                {
                    return(-1);
                }
                return((int)o);
            }
        }