using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using JuSNS.Factory;
using JuSNS.Model;
using JuSNS.Config;

namespace JuSNS.Home
{
    public class JUser
    {
        JuSNS.Factory.IJUser dal;
        public JUser()
        {
            dal = DataAccess.CreateJUser();
        }

        /// <summary>
        /// 获得最新心情
        /// </summary>
        /// <param name="UserID"></param>
        public IDataReader GetMoodInfo(int UserID)
        {
            return dal.GetMoodInfo(UserID);
        }

        /// <summary>
        /// 获得最新心情(通过ＩＤ)
        /// </summary>
        /// <param name="UserID"></param>
        public DataTable GetMoodIDInfo(int ID)
        {
            return dal.GetMoodIDInfo(ID);
        }

        /// <summary>
        /// 得到信息ID
        /// </summary>
        /// <param name="ID"></param>
        /// <param name="flg"></param>
        /// <returns></returns>
        public DataTable GetDynInfoId(int ID, int flg)
        {
            return dal.GetDynInfoId(ID, flg);
        }

        /// <summary>
        /// 获得BLOG(通过ＩＤ)
        /// </summary>
        /// <param name="UserID"></param>
        /// <param name="ID"></param>
        /// <returns></returns>
        public DataTable GetBlogIDInfo(int ID)
        {
            return dal.GetBlogIDInfo(ID);
        }

        /// <summary>
        /// 获取通知数量（未读）
        /// </summary>
        /// <param name="UserID"></param>
        /// <returns></returns>
        public int NoticeInfo(int UserID)
        {
            return dal.NoticeInfo(UserID);
        }

        /// <summary>
        /// 获取好友请求数量
        /// </summary>
        /// <param name="UserID">被请求的用户ID</param>
        /// <returns></returns>
        public int FriendRequest(int UserID, int Type)
        {
            return dal.FriendRequest(UserID, Type);
        }

        /// <summary>
        /// 得到新事件
        /// </summary>
        /// <param name="UserID"></param>
        /// <returns></returns>
        public int GetNoteNumber(int UserID)
        {
            return dal.GetNoteNumber(UserID);
        }

        /// <summary>
        /// 获取日志足迹
        /// </summary>
        /// <param name="UserID">用户名</param>
        /// <param name="Num">调用数量</param>
        /// <returns></returns>
        public IDataReader BlogFootList(int UserID,int Num)
        {
            return dal.BlogFootList(UserID, Num);
        }

        /// <summary>
        /// 获取用户实体类
        /// </summary>
        /// <param name="UserID">用户ID</param>
        /// <returns></returns>
        public UserInfo GetUserInfo(int UserID)
        {
            return dal.GetUserInfo(UserID);
        }

        /// <summary>
        /// 根据日志ID获取访问者
        /// </summary>
        /// <param name="BlogID">日志ID</param>
        /// <param name="Num">调用数量</param>
        /// <returns></returns>
        public IDataReader blogFootID(int BlogID, int Num,int UserID)
        {
            return dal.blogFootID(BlogID, Num, UserID);
        }

        /// <summary>
        /// 获得某用户的其他日志
        /// </summary>
        /// <param name="UserID">用户ID</param>
        /// <param name="blogID">当前所在的日志ID</param>
        /// <param name="Num">调用数量</param>
        /// <returns></returns>
        public IDataReader BlogMoreID(int UserID, int blogID, int Num)
        {
            return dal.BlogMoreID(UserID, blogID, Num);
        }

        /// <summary>
        /// 插入招呼表情
        /// </summary>
        /// <param name="UserID"></param>
        /// <param name="FriendID"></param>
        /// <param name="gType"></param>
        /// <param name="isPub"></param>
        /// <param name="poketo"></param>
        /// <param name="pokefrom"></param>
        /// <returns></returns>
        public int AddPoke(int UserID, int FriendID, int gType, int isPub, string poketo, string pokefrom)
        {
            return dal.AddPoke(UserID, FriendID, gType, isPub, poketo, pokefrom);
        }

        public int ChanagePokeState(int id,int UserID)
        {
            return dal.ChanagePokeState(id, UserID);
        }

        /// <summary>
        /// 删除招呼
        /// </summary>
        /// <param name="ID"></param>
        /// <param name="UserID"></param>
        /// <returns></returns>
        public int DelPoke(int ID, int UserID)
        {
            return dal.DelPoke(ID, UserID);
        }

        /// <summary>
        /// 得到在线用户
        /// </summary>
        /// <param name="UserID"></param>
        /// <returns></returns>
        public DataTable GetOnlineNumber(int UserID)
        {
            return dal.GetOnlineNumber(UserID);
        }

        public int GetUserCount()
        {
            return dal.GetUserCount();
        }

        //public bool CheckPrivacyInfo(int UserID, string Type)
        //{
        //    return dal.CheckPrivacyInfo(UserID, Type);
        //}
    }
}
