Exemple #1
0
        public bool IsUserOrganisationMnager(Guid employeeId, User currentUser)
        {
            var userManager = new UserManager(_UOW);
            var orgManager  = new OrgUnitManager(_UOW);
            var orgId       = userManager.GetByID(employeeId).OrganizationUnit.ID;
            var orgmanager  = orgManager.GetByID(orgId);

            return(orgmanager.ManagerID == currentUser.ID);
        }
Exemple #2
0
        /// <summary>
        /// WorkHour متد مشخص کردن مدیر ستادی بودن کاربر جاری توسط آبجکت
        /// </summary>
        /// <param name="workHour"></param>
        /// <returns></returns>
        public bool IsUserOrganisationMnager(WorkHour workHour, string userName)
        {
            var userManager = new UserManager(_UOW);
            var orgManager  = new OrgUnitManager(_UOW);
            var currentUser = userManager.GetByUserName(userName);
            var orgId       = userManager.GetByID(workHour.EmployeeID).OrganizationUnit.ID;
            var orgmanager  = orgManager.GetByID(orgId);

            if (orgmanager.ManagerID == currentUser.ID)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }