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

namespace JuSNS.SQLServer
{
    public class ram : DbBase, Iram
    {
        public IDataReader GetUser(int TN, int Num, int ProID, int UserID, int Sex)
        {
            SqlParameter[] param = new SqlParameter[5];
            param[0] = new SqlParameter("@TN", SqlDbType.Int, 4);
            param[0].Value = TN;
            param[1] = new SqlParameter("@Num", SqlDbType.Int, 4);
            param[1].Value = Num;
            param[2] = new SqlParameter("@ProID", SqlDbType.Int, 4);
            param[2].Value = ProID;
            param[3] = new SqlParameter("@UserID", SqlDbType.Int, 4);
            param[3].Value = UserID;
            param[4] = new SqlParameter("@Sex", SqlDbType.Int, 4);
            param[4].Value = Sex;
            return DbHelper.ExecuteReader(CommandType.StoredProcedure, "JuSNS_TopUser", param);
        }

        public IDataReader GetMood(int Num,int By)
        {
            SqlParameter[] param = new SqlParameter[2];
            param[0] = new SqlParameter("@Num", SqlDbType.Int, 4);
            param[0].Value = Num;
            param[1] = new SqlParameter("@By", SqlDbType.Int, 4);
            param[1].Value = By;
            return DbHelper.ExecuteReader(CommandType.StoredProcedure, "JuSNS_ramTopMood", param);
        }

        public IDataReader GetBlog(int Num, int By)
        {
            SqlParameter[] param = new SqlParameter[2];
            param[0] = new SqlParameter("@Num", SqlDbType.Int, 4);
            param[0].Value = Num;
            param[1] = new SqlParameter("@By", SqlDbType.Int, 4);
            param[1].Value = By;
            return DbHelper.ExecuteReader(CommandType.StoredProcedure, "JuSNS_ramTopBlog", param);
        }

        public IDataReader GetShare(int Num, int By)
        {
            SqlParameter[] param = new SqlParameter[2];
            param[0] = new SqlParameter("@Num", SqlDbType.Int, 4);
            param[0].Value = Num;
            param[1] = new SqlParameter("@By", SqlDbType.Int, 4);
            param[1].Value = By;
            return DbHelper.ExecuteReader(CommandType.StoredProcedure, "JuSNS_ramTopShare", param);
        }

        public DataTable  GetAlbum(int Num, int By,int UserID)
        {
            SqlParameter[] param = new SqlParameter[3];
            param[0] = new SqlParameter("@Num", SqlDbType.Int, 4);
            param[0].Value = Num;
            param[1] = new SqlParameter("@By", SqlDbType.Int, 4);
            param[1].Value = By;
            param[2] = new SqlParameter("@UserID", SqlDbType.Int, 4);
            param[2].Value = UserID;
            return DbHelper.ExecuteTable(CommandType.StoredProcedure, "JuSNS_ramTopAlbum", param);
        }
    }
}
