Esempio n. 1
0
        public virtual ActionResult CheckProfile(long?userId)
        {
            var uid          = userId ?? long.Parse(User.Identity.GetUserId());
            var checkProfile = _authenticationManagementService.CheckProfile(uid);

            if (!checkProfile.Item1)
            {
                return(RedirectToAction(MVC.User.Profile.SaveProfile()));
            }
            switch (checkProfile.Item2)
            {
            case AuthenticationType.AdminUniversity:
                return(RedirectToAction(MVC.Admin.Person.Index()));

            case AuthenticationType.Personel:
                var postSignersofPerson = _personManagementService.GetPostSignersofPersonel(uid);
                if (postSignersofPerson.Item3.Any(p => p.Post.Signers.Count > 0))
                {
                    return(postSignersofPerson.Item3.Any(p => p.Post.Signers.Any(s => s.RowNumber == 1)) ?
                           RedirectToAction(MVC.Personel.Request.Index()) :
                           RedirectToAction(MVC.Personel.Cartable.Index()));
                }
                break;
            }
            return(HttpNotFound());
        }