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

namespace JuSNS.Home
{
    public class Notepad
    {
        JuSNS.Factory.INotepad dal;
        public Notepad()
        {
            dal = DataAccess.CreateNotepad();
        }
        /// <summary>
        /// 获取记事本内容
        /// </summary>
        /// <param name="UserID">会员编号</param>
        /// <returns></returns>
        public IDataReader GetContent(int UserID,int NoteID)
        {
            return dal.GetContent(UserID, NoteID);
        }
        /// <summary>
        /// 保存记事本信息
        /// </summary>
        public int SaveNote(int UserID, string title, string Content, DateTime txtime, int flg, int noteID)
        {
            return dal.SaveNote(UserID, title, Content, txtime, flg,noteID);
        }
        /// <summary>
        /// 获取Notepad实例
        /// </summary>
        /// <param name="MiniID">NotepadID</param>
        /// <returns></returns>
        public NotePadInfo GetNoteInfo(int NoteID)
        {
            return dal.GetNoteInfo(NoteID);
        }

        /// <summary>
        /// 删除事件
        /// </summary>
        /// <param name="UserID"></param>
        /// <param name="NoteID"></param>
        /// <returns></returns>
        public int DelNote(int UserID, int NoteID)
        {
            return dal.DelNote(UserID, NoteID);
        }

        /// <summary>
        /// 检查是否有查看的权限
        /// </summary>
        /// <param name="guest"></param>
        /// <param name="masterid"></param>
        /// <returns></returns>
        public bool Authority(int guest, int masterid)
        {
            return dal.Authority(guest, masterid);
        }
    }
}
