using Edu.Common.Enum.User;
using Edu.Model.Entity.User;
using Edu.Model.ViewModel.User;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace Edu.Repository.User
{
    /// <summary>
    /// 出差审批模行程板扩展信息
    /// </summary>
    public partial class Rb_Workflow_VisualrangeRepository : BaseRepository<Rb_Workflow_Visualrange>
    {
        /// <summary>
        /// 删除模版可见范围
        /// </summary>
        /// <param name="tid"></param>
        /// <returns></returns>
        public bool DeleteVisualrange(int tid) 
        {
            return Execute($@" delete from Rb_Workflow_Visualrange where TemplateId={tid}") >0;
        }

        /// <summary>
        /// 根据模版id获取可见范围的人
        /// </summary>
        /// <param name="tid"></param>
        /// <returns></returns>
        public List<Rb_Workflow_Visualrange_Extend> GetList(int tid) 
        {
            return Get<Rb_Workflow_Visualrange_Extend>($@" select * from Rb_Workflow_Visualrange where TemplateId={tid}").ToList();
        }
    }
}
