Пример #1
0
        /// <summary>
        /// 将队列下的主负责人更新为普通
        /// </summary>
        public void ClearLeadResource(long queueId, long userId)
        {
            sys_resource_department_dal srdDal = new sys_resource_department_dal();
            var list = srdDal.GetListByDepId(queueId);

            if (list != null && list.Count > 0)
            {
                var thisLead = list.FirstOrDefault(_ => _.is_lead == 1);  // &&_.is_active == 1
                if (thisLead != null)
                {
                    thisLead.is_lead = 0;
                    string temp = string.Empty;
                    EditQueueResource(thisLead, userId, ref temp);
                }
            }
        }
Пример #2
0
        /// <summary>
        /// 员工所属部门的校验
        /// </summary>
        public bool CheckResourceRole(sys_resource_department resDep)
        {
            sys_resource_department_dal srdDal = new sys_resource_department_dal();
            var list = srdDal.GetListByDepId(resDep.department_id);

            if (list != null && list.Count > 0)
            {
                var thisDep = list.FirstOrDefault(_ => _.resource_id == resDep.resource_id && _.role_id == resDep.role_id);
                if (thisDep != null)
                {
                    if (thisDep.id != resDep.id)
                    {
                        return(false);
                    }
                }
            }
            return(true);
        }