using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Reflection;

namespace JuSNS.Factory
{
    public interface IGBook
    {
        /// <summary>
        /// 新增留言
        /// </summary>
        /// <param name="id"></param>
        /// <param name="senderId"></param>
        /// <param name="recieverId"></param>
        /// <param name="content"></param>
        /// <returns></returns>
        int Edit(int id, int senderId, int receiverId, string content, int pid, int ispub);
        /// <summary>
        /// 删除留言
        /// </summary>
        /// <param name="userId">操作用户的ID</param>
        /// <param name="id">要删除的留言ID</param>
        /// <returns></returns>
        int Delete(int userId, int id);


        IDataReader GetRepayBook(int UserID, int ParentID);
        /// <summary>
        /// 查看是否有权查看某人留言
        /// </summary>
        /// <param name="guestId"></param>
        /// <param name="masterId"></param>
        /// <returns></returns>
        bool CheckAuthority(int guestId, int masterId);
    }

    public sealed partial class DataAccess
    {
        public static IGBook CreateGBook()
        {
            string className = path + ".GBook";
            return (IGBook)Assembly.Load(path).CreateInstance(className);
        }
    }
}
