using System;
using System.Collections.Generic;
using System.Text;
using Fm.DataAccess;
using System.Data;
using System.Data.Common;
using System.Collections;

namespace Fm.Bussiness
{
    public class sys_affiche
    {
        /// <summary>
        /// 网站公告添加
        /// </summary>
        /// <param name="username"></param>
        /// <param name="title"></param>
        /// <param name="content"></param>
        /// <param name="btime"></param>
        /// <param name="etime"></param>
        /// <returns></returns>
        public bool Affiche_Add(Fm.EntityClass.Affiche sys)
        {
            DbCommand db = DataAccess.DataAccess.db.GetStoredProcCommand("Fm_affiche_ADD");
            DataAccess.DataAccess.db.AddOutParameter(db,"@aff_id",DbType.Int32,sys.aff_id);
            DataAccess.DataAccess.db.AddInParameter(db,"@aff_title",DbType.String,sys.aff_title);
            DataAccess.DataAccess.db.AddInParameter(db,"@aff_content",DbType.String,sys.aff_content);
            DataAccess.DataAccess.db.AddInParameter(db,"@aff_user",DbType.String,sys.aff_user);
            DataAccess.DataAccess.db.AddInParameter(db,"@aff_btime",DbType.Time,sys.aff_btime);
            DataAccess.DataAccess.db.AddInParameter(db,"@aff_look",DbType.Int32,sys.aff_look);
            return  DataAccess.DataAccess.GetData.Query<DbCommand>(db);
          
        }
        /// <summary>
        /// 网站公告修改
        /// </summary>
        /// <param name="aff_id"></param>
        /// <param name="username"></param>
        /// <param name="title"></param>
        /// <param name="content"></param>
        /// <param name="etime"></param>
        /// <returns></returns>
        public bool Affiche_Update(Fm.EntityClass.Affiche sys)
        {
            DbCommand db = DataAccess.DataAccess.db.GetStoredProcCommand("Fm_affiche_Update");
            DataAccess.DataAccess.db.AddInParameter(db, "@aff_id", DbType.Int32, sys.aff_id);
            DataAccess.DataAccess.db.AddInParameter(db, "@aff_title", DbType.String, sys.aff_title);
            DataAccess.DataAccess.db.AddInParameter(db, "@aff_content", DbType.String, sys.aff_content);
            DataAccess.DataAccess.db.AddInParameter(db, "@aff_user", DbType.String, sys.aff_user);
            DataAccess.DataAccess.db.AddInParameter(db, "@aff_btime", DbType.Time, sys.aff_btime);
            DataAccess.DataAccess.db.AddInParameter(db, "@aff_look", DbType.Int32, sys.aff_look);
            return DataAccess.DataAccess.GetData.Query<DbCommand>(db);
           
        }
        /// <summary>
        /// 公告信息的删除
        /// </summary>
        /// <param name="aff_id"></param>
        /// <returns></returns>
        public bool Affiche_Delete(Fm.EntityClass.Affiche sys)
        {
            DbCommand db = DataAccess.DataAccess.db.GetStoredProcCommand("Fm_affiche_Delete");
            DataAccess.DataAccess.db.AddInParameter(db, "@aff_id", DbType.Int32, sys.aff_id);
            return DataAccess.DataAccess.GetData.Query<DbCommand>(db);
        }
    }
}
