Esempio n. 1
0
        /// <summary>
        /// 根据功能Type和用户获取单独的权限
        /// </summary>
        /// <param name="EmployeeID"></param>
        /// <param name="Type"></param>
        /// <returns></returns>
        public Sys_UserJurisdiction GetUserJurisdictionByChanneltype(int?EmployeeID, string Type)
        {
            ChannelService ObjChannelBLL = new ChannelService();
            var            ChannelID     = ObjChannelBLL.GetbyClassType(Type).ChannelID;

            return(ObjEntity.Sys_UserJurisdiction.FirstOrDefault(C => C.EmployeeID == EmployeeID && C.ChannelID == ChannelID));
        }
Esempio n. 2
0
        public bool CheckByClassType(string Type, int?EmpLoyeeID)
        {
            ChannelService ObjChannelBLL = new ChannelService();
            var            objChannel    = ObjChannelBLL.GetbyClassType(Type);

            if (objChannel != null)
            {
                var ObjModel = ObjEntity.Sys_UserJurisdiction.FirstOrDefault(C => C.ChannelID == objChannel.ChannelID && C.EmployeeID == EmpLoyeeID && C.IsClose == false);
                if (ObjModel != null)
                {
                    return(true);
                }
            }
            return(false);
        }
Esempio n. 3
0
        /// <summary>
        /// 获取用户的派工人
        /// </summary>
        /// <param name="ChannelGetType"></param>
        /// <returns></returns>
        public int?GetDispatchingByChannelType(string ChannelGetType, int EmpLoyeeID)
        {
            ChannelService ObjChannelBLL  = new ChannelService();
            var            ChannelID      = ObjChannelBLL.GetbyClassType(ChannelGetType).ChannelID;
            var            ObjJurisdModel = ObjEntity.Sys_UserJurisdiction.FirstOrDefault(C => C.EmployeeID == EmpLoyeeID && C.ChannelID == ChannelID);

            if (ObjJurisdModel == null)
            {
                return(EmpLoyeeID);
            }
            else
            {
                return(ObjJurisdModel.Dispatching);
            }
        }
Esempio n. 4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="DepartmentID"></param>
        /// <returns></returns>
        public List <Sys_Department> GetByDataSourceDepartment(string Classtype)
        {
            Employee         ObjEmployeeBLL         = new Employee();
            UserJurisdiction ObjUserJurisdictionBLL = new UserJurisdiction();
            ChannelService   ObjChannelBLL          = new ChannelService();
            var ObjChannelList     = ObjChannelBLL.GetbyClassType(Classtype);
            var ObjEmpLoyeeKeyList = ObjUserJurisdictionBLL.GetEmpLoyeeByChannel(ObjChannelList.ChannelID);

            ///获得所有用户
            var        ObjEmployeeList  = ObjEmployeeBLL.GetByEmpLoyeeKeysList(ObjEmpLoyeeKeyList.ToArray());
            List <int> ObjDepartKeyList = new List <int>();

            foreach (var ObjKey in ObjEmployeeList)
            {
                ObjDepartKeyList.Add(ObjKey.DepartmentID);
            }

            return(this.GetByKeysList(ObjDepartKeyList.Distinct().ToArray()));

            //var ObjModel = ObjEntity.Sys_Department.FirstOrDefault(C=>C.DepartmentID==DepartmentID);
            //return ObjEntity.Sys_Department.Where(C => C.DataSource == ObjModel.DataSource).ToList();
        }
Esempio n. 5
0
        /// <summary>
        /// 获取频道下的用户上级审核人
        /// </summary>
        /// <param name="ChannelType"></param>
        /// <param name="EmpLoyeeID"></param>
        /// <returns></returns>
        public Sys_UserJurisdiction GetByChannelType(string ChannelType, int EmpLoyeeID)
        {
            ChannelService ObjChannelBLL   = new ChannelService();
            var            ObjChannemModel = ObjChannelBLL.GetbyClassType(ChannelType);

            if (ObjChannemModel != null)
            {
                var ObjUserJurisdiction = ObjEntity.Sys_UserJurisdiction.FirstOrDefault(C => C.EmployeeID == EmpLoyeeID && C.ChannelID == ObjChannemModel.ChannelID);
                if (ObjUserJurisdiction != null)
                {
                    return(ObjUserJurisdiction);
                }
                else
                {
                    return(null);
                }
            }
            else
            {
                return(null);
            }
        }