//by JuSNS v1.0系列
//官方站：www.juSNS.com，演示站:www.ju001.com，www.julala.cn
//QQ:655071(技术)，QQ:9170617（客服）
//MSN:simplt@163.com EMail:simplt@163.com
//program design by Simplt.Xie，arjun
//========================================
using System;
using System.Collections.Generic;
using System.Reflection;
using JuSNS.Model;

namespace JuSNS.Factory
{
    /// <summary>
    /// 相册接口类
    /// </summary>
    public interface IAlbum
    {
        /// <summary>
        /// 添加相册
        /// </summary>
        /// <param name="Info">相册实体类</param>
        /// <returns>添加成功返回1</returns>
        int Add(AlbumInfo Info);

        /// <summary>
        /// 修改相册信息
        /// </summary>
        /// <param name="Info">相册实体类</param>
        /// <returns>修改成功返回1</returns>
        int Edit(AlbumInfo Info);

        /// <summary>
        /// 删除相册(后台)
        /// </summary>
        /// <param name="AlbumID">相册编号</param>
        /// <returns>删除成功返回1</returns>
        int Del(int AlbumID);

        /// <summary>
        /// 删除相册(前台)
        /// </summary>
        /// <param name="AlbumID">相册编号</param>
        /// <param name="UserID">会员编号</param>
        /// <returns>删除成功返回1</returns>
        int Del(int AlbumID, int UserID);

        /// <summary>
        /// 取得相册照片记录数
        /// </summary>
        /// <param name="AlbumID">相册编号</param>
        /// <returns>返回照片记录数</returns>
        int Count(int AlbumID);
        
        /// <summary>
        /// 取得相册下属相册所有相片路径，以做BLL层删除之用
        /// </summary>
        /// <param name="AlubmID">相册编号</param>
        /// <returns>返回编号</returns>
        string A_s_PPath(int AlubmID);

        /// <summary>
        /// 相册信息
        /// </summary>
        /// <param name="AlbumID">相册编号</param>
        /// <returns>返回相册实体类</returns>
        AlbumInfo Info(int AlbumID);

        /// <summary>
        /// 获取指定用户相册集
        /// </summary>
        /// <param name="UserID">用户编号</param>
        /// <returns>返回相册实体类集合</returns>
        List<AlbumInfo> AlbumList(int UserID);

        /// <summary>
        /// 获取指定用户最新相册ID
        /// </summary>
        /// <param name="UserID">用户编号</param>
        /// <returns>相册ID</returns>
        int LastAlbumID(int UserID);

        /// <summary>
        /// 指定相册封面图片地址
        /// </summary>
        /// <param name="AlbumID">相册ID</param>
        /// <returns>图片路径</returns>
        string CoverPath(int AlbumID);

        /// <summary>
        /// 取得好友最新相册
        /// </summary>
        /// <param name="UserID">用户名</param>
        /// <returns></returns>
        List<AlbumInfo> FriendAlbumList(int UserID);
        /// <summary>
        /// 取得群组最新相册
        /// </summary>
        /// <param name="UserID">群组ID</param>
        /// <returns></returns>
        List<AlbumInfo> GroupAlbumList(int GroupID);
    }
    public sealed partial class DataAccess
    {
        public static IAlbum CreateAlbum()
        {
            string className = path + ".Album";
            return (IAlbum)Assembly.Load(path).CreateInstance(className);
        }
    }
}
