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 Bill
    {
        private IBill dal;

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

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


        /// <summary>
        /// 得到分类名称
        /// </summary>
        /// <param name="ClassID"></param>
        /// <returns></returns>
        public string GetClassName(int ClassID,int UserID)
        {
            return dal.GetClassName(ClassID,UserID);
        }

        /// <summary>
        /// 增加记账
        /// </summary>
        /// <param name="UserID"></param>
        /// <param name="bName"></param>
        /// <param name="bType"></param>
        /// <param name="bmoney"></param>
        /// <param name="ClassID"></param>
        /// <param name="fID"></param>
        /// <param name="Content"></param>
        /// <param name="isPub"></param>
        /// <returns></returns>
        public int addBill(int bID,int UserID, string bName, int bType, double bmoney,DateTime billTime, int ClassID, int fID, string Content, int isPub)
        {
            return dal.addBill(bID,UserID, bName, bType, bmoney, billTime, ClassID, fID, Content, isPub);
        }


        public string GetFamily(int fID,int UserID)
        {
            return dal.GetFamily(fID, UserID);
        }

        /// <summary>
        /// 得到家庭成员实例
        /// </summary>
        /// <param name="UserID"></param>
        /// <returns></returns>
        public IDataReader GetFamilyList(int UserID)
        {
            return dal.GetFamilyList(UserID);
        }

        /// <summary>
        /// 得到分类实例
        /// </summary>
        /// <param name="UserID"></param>
        /// <returns></returns>
        public IDataReader GetClassList(int UserID)
        {
            return dal.GetClassList(UserID);
        }

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

        public int DelBillInfo(int UserID, int ID)
        {
            return dal.DelBillInfo(UserID, ID);
        }
        /// <summary>
        /// 增加分类
        /// </summary>
        /// <param name="UserID"></param>
        /// <param name="cName"></param>
        /// <returns></returns>
        public int addbillClass(int UserID, string cName)
        {
            return dal.addbillClass(UserID, cName);
        }

        /// <summary>
        /// 增加成员
        /// </summary>
        /// <param name="UserID"></param>
        /// <param name="cName"></param>
        /// <returns></returns>
        public int addbillfamily(int UserID, string cName)
        {
            return dal.addbillfamily(UserID, cName);
        }

        public int EditbillClass(int UserID, string cName,int id)
        {
            return dal.EditbillClass(UserID, cName, id);
        }

        public int EditbillFamily(int UserID, string cName, int id)
        {
            return dal.EditbillFamily(UserID, cName, id);
        }

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

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

        /// <summary>
        /// 得到统计
        /// </summary>
        /// <param name="UserID"></param>
        /// <param name="Num"></param>
        /// <returns></returns>
        public double GetBillStat(int UserID, int Num)
        {
            return dal.GetBillStat(UserID, Num);
        }
    }
}
