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

namespace JuSNS.Home
{
    /// <summary>
    /// 私信类
    /// </summary>
    public class Gift
    {
        private IGift dal;

        public DataTable GiftListPage(int UserID,string classID,string n,int PageIndex, int PageSize, out int RecordCount, out int PageCount)
        {
            return dal.GiftListPage(UserID, classID, n, PageIndex, PageSize, out RecordCount, out PageCount);
        }

        /// <summary>
        /// 得到礼物信息
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        public IDataReader GiftInfo(int ID)
        {
            return dal.GiftInfo(ID);
        }

        /// <summary>
        /// 得到赠送附言
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        public IDataReader GiftUserInfo(int ID)
        {
            return dal.GiftUserInfo(ID);
        }

        public int SaveGift(int UserID, int gID, int SendUserID, int pType, string Content, DateTime CreatTime)
        { 
            return dal.SaveGift(UserID, gID, SendUserID, pType, Content, CreatTime);
        }

        public DataTable ShowGiftList(string t, int UserID, int PageIndex, int PageSize, out int RecordCount, out int PageCount)
        {
            return dal.ShowGiftList(t, UserID, PageIndex, PageSize, out RecordCount, out PageCount);
        }

        public int DelGift(int UserID, int ID)
        {
            return dal.DelGift(UserID, ID);
        }

        public IDataReader GetGiftClass()
        {
            return dal.GetGiftClass();
        }
        public DataTable getGiftClassID(int ID)
        {
            return dal.getGiftClassID(ID);
        }

        public DataTable GetGiftClassT()
        {
            return dal.GetGiftClassT();
        }

        public int DelGiftClass(int id)
        {
            return dal.DelGiftClass(id);
        }

        public int LockGift(int ID,int flg,int isdel)
        {
            return dal.LockGift(ID, flg, isdel);
        }
        public int addGift(string GName, string Picture, int point, string Content, int ClassID, int GID)
        {
            return dal.addGift(GName, Picture, point, Content, ClassID, GID);
        }

        public int UpdateGiftClassID(string className, int id)
        {
            return dal.UpdateGiftClassID(className, id);
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        public Gift()
        {
            dal = DataAccess.CreateGift();
        }



    }
}