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

namespace Fm.Bussiness
{
    public class model_controls
    {
        /// <summary>
        /// 模型控件添加
        /// </summary>
        /// <param name="controls"></param>
        /// <returns></returns>
        public bool Model_controls_Add(Fm.Entity.controls controls)
        {
            DbCommand db = DataAccess.DataAccess.db.GetStoredProcCommand("Query_Fm_model_controls_ADD");
            DataAccess.DataAccess.db.AddOutParameter(db, "@cid",DbType.Int32,controls.cid);
            DataAccess.DataAccess.db.AddInParameter(db, "@typeid",DbType.Int32,controls.typeid);
            DataAccess.DataAccess.db.AddInParameter(db, "@info", DbType.String, controls.info);
            DataAccess.DataAccess.db.AddInParameter(db, "@intro",DbType.String,controls.intro);
            DataAccess.DataAccess.db.AddInParameter(db, "@getvalue",DbType.String,controls.getvalue);
            DataAccess.DataAccess.db.AddInParameter(db, "@setvalue",DbType.String,controls.setvalue);
            DataAccess.DataAccess.db.AddInParameter(db, "@register",DbType.String,controls.register);
            return DataAccess.DataAccess.GetData.Query<DbCommand>(db);
           
        }
        /// <summary>
        /// 模型控件的修改
        /// </summary>
        /// <param name="controls"></param>
        /// <returns></returns>
        public bool Model_controls_Update(Fm.Entity.controls controls)
        {
            DbCommand db = DataAccess.DataAccess.db.GetStoredProcCommand("Query_Fm_model_controls_Update");
            DataAccess.DataAccess.db.AddInParameter(db, "@cid", DbType.Int32, controls.cid);
            DataAccess.DataAccess.db.AddInParameter(db, "@typeid", DbType.Int32, controls.typeid);
            DataAccess.DataAccess.db.AddInParameter(db, "@info", DbType.String, controls.info);
            DataAccess.DataAccess.db.AddInParameter(db, "@intro", DbType.String, controls.intro);
            DataAccess.DataAccess.db.AddInParameter(db, "@getvalue", DbType.String, controls.getvalue);
            DataAccess.DataAccess.db.AddInParameter(db, "@setvalue", DbType.String, controls.setvalue);
            DataAccess.DataAccess.db.AddInParameter(db, "@register", DbType.String, controls.register);
            return DataAccess.DataAccess.GetData.Query<DbCommand>(db);
        }
        /// <summary>
        /// 模型控件的删除
        /// </summary>
        /// <param name="controls"></param>
        /// <returns></returns>
        public bool Model_controls_Del(Fm.Entity.controls controls)
        {
            DbCommand db = DataAccess.DataAccess.db.GetStoredProcCommand("Query_Fm_model_controls_Delete");
            DataAccess.DataAccess.db.AddInParameter(db, "@cid", DbType.Int32, controls.cid);
            return DataAccess.DataAccess.GetData.Query<DbCommand>(db);
        }
    }
}
