Beispiel #1
0
        public void SendDelegationEmplEmail(DelegationView delegationView)
        {
            if (delegationView != null)
            {
                var             emplTableFrom = _EmplService.Find(delegationView.EmplTableFromId);
                var             emplTableTo   = _EmplService.Find(delegationView.EmplTableToId);
                ApplicationUser userTable     = _AccountService.Find(emplTableTo.ApplicationUserId);

                if (userTable.Email != String.Empty)
                {
                    string documentUri = "http://" + HttpContext.Current.Request.Url.Authority;
                    CreateMessange(EmailTemplateType.Delegation, null, userTable, @"Views\\EmailTemplate\\DelegationEmailTemplate.cshtml", documentUri, UIElementRes.UIElement.SendDelegationEmplEmail, "На вас настроенно делегирование", new string[] { emplTableTo.FullName, emplTableFrom.FullName });
                }
            }
        }
Beispiel #2
0
        private EmplTable WFMatchingUpManagerFinder(EmplTable emplTable, int level, string currentUserName, string profileName = "")
        {
            if ((level == 0 && profileName == null) || (emplTable.ProfileName == profileName || emplTable.TitleTable.ProfileName == profileName))
            {
                return(emplTable);
            }
            EmplTable manager = _EmplService.Find(emplTable.ManageId, currentUserName);

            if (manager == null)
            {
                return(null);
            }

            level--;
            return(WFMatchingUpManagerFinder(manager, level, currentUserName, profileName));
        }