Example #1
0
        public DataTable getChatRoomDetail(int uId)//获得所在的每个群组具体信息
        {
            string sql = "select [chatRoom].c_id as  CId, [chatRoom].name as Name, [chatRoom].time as Time, [chatRoom].limit_num as LimitNum,[chatRoom].leader_id as LeaderID,[chatRoom].chatroom_port as ChatRoomPort  from [chatroom],[chatroom_member] where [chatRoom].[c_id]=[chatroom_member].chatroom_id and [chatroom_member].u_id=@UId";
            List <SqlParameter> parameters = new List <SqlParameter>();
            SqlParameter        UId        = new SqlParameter("@UId", SqlDbType.Int);

            UId.Value = uId;
            parameters.Add(UId);
            DataTable result = SqlDbHelper.ExecueteDataTable(sql, CommandType.Text, parameters);

            return(result);
        }
Example #2
0
        //查找群主信息
        public DataTable searchLeader(int uId)
        {
            string sql = "select * from [user] where [user].u_id=@UId";
            List <SqlParameter> parameters = new List <SqlParameter>();
            SqlParameter        UId        = new SqlParameter("@UId", SqlDbType.Int);

            UId.Value = uId;
            parameters.Add(UId);
            DataTable result = SqlDbHelper.ExecueteDataTable(sql, CommandType.Text, parameters);

            return(result);
        }
Example #3
0
        //获得好友分组列表
        public DataTable getGroupList(int uId)
        {
            string sql = "select u_id as UId, g_id as GId, name as Name"
                         + " from [group] where u_id=@UId";
            List <SqlParameter> parameters = new List <SqlParameter>();
            SqlParameter        UId        = new SqlParameter("@UId", SqlDbType.Int);

            UId.Value = uId;
            parameters.Add(UId);
            DataTable result = SqlDbHelper.ExecueteDataTable(sql, CommandType.Text, parameters);

            return(result);
        }
Example #4
0
        public DataTable getAllFriend(int uId)
        {
            string sql = "select f.friend_id as FriendId, f.g_id as GId, f.time as Time, f.nick_name as NickName, "
                         + " u.[username] as FriendName"
                         + " from [friend] as f,[user] as u"
                         + " where u.[u_id]=f.[friend_id] and f.u_id=@UId";
            List <SqlParameter> parameters = new List <SqlParameter>();
            SqlParameter        UId        = new SqlParameter("@UId", SqlDbType.Int);

            UId.Value = uId;
            parameters.Add(UId);
            DataTable result = SqlDbHelper.ExecueteDataTable(sql, CommandType.Text, parameters);

            return(result);
        }
Example #5
0
        public DataTable getUserById(int uId)
        {
            string sql = "select [u_id] as [UId], [username] as [Username], [email] as [Email], [password] as [Password], " +
                         "[regTime] as [RegTime], [age] as [Age], [sex] as [Sex], [sign] as [Sign], [photo] as [Photo], " +
                         "[last_login_time] as [LastLoginTime], [last_login_ip] as [LastLoginIp], [status] as [Status] from [user] " +
                         "where [u_id]=@UId";
            List <SqlParameter> parameters = new List <SqlParameter>();
            SqlParameter        UId        = new SqlParameter("@UId", SqlDbType.VarChar, 50);

            UId.Value = uId;
            parameters.Add(UId);

            DataTable result = SqlDbHelper.ExecueteDataTable(sql, CommandType.Text, parameters);

            return(result);
        }