Beispiel #1
0
        public IActionResult List()
        {
            OperationResultListVo <ProfileViewModel> serviceResult = profileAppService.GetAll(CurrentUserId);

            List <ProfileViewModel> profiles = serviceResult.Value.OrderByDescending(x => x.CreateDate).ToList();

            return(View(profiles));
        }
Beispiel #2
0
        // [ClaimsAuthorize(claimType: TypePermissionEnum.PROFILE, claimValue: ValuePermissionEnum.CONSULT)]
        public ActionResult Index(string ResearchName, string ResearchActive)
        {
            var name   = (ResearchName == null || ResearchName.Trim().Equals("")) ? null : ResearchName.Trim();
            var active = (ResearchActive == null || ResearchActive.Trim().Equals("")) ? null : ResearchActive.Trim();
            ProfileViewIndex Profiles = new ProfileViewIndex();

            if (name == null && active == null)
            {
                Profiles.ProfileList = new List <ProfileViewModel>(_profileAppService.GetAll());
            }
            else
            {
                Expression <Func <ProfileViewModel, bool> > filter = null;

                filter = (ProfileViewModel p) => ((name != null) ? p.Name.ToUpper().Contains(name.ToUpper()) : true) &&
                         ((active != null) ? p.Active.Equals(active) : true);

                Profiles.ProfileList  = new List <ProfileViewModel>(_profileAppService.Get(filter, orderBy: q => q.OrderBy(d => d.Name)));
                Profiles.ResearchName = ResearchName;
            }
            return(View(Profiles));
        }
Beispiel #3
0
        public IActionResult Get()
        {
            var profiles = profileAppService.GetAll();

            return(Ok(profiles));
        }